@fedify/fedify 2.3.1 → 2.3.2-dev.1556

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 (62) hide show
  1. package/README.md +10 -7
  2. package/dist/{builder-hivpmhlD.mjs → builder-DosLp_w5.mjs} +2 -2
  3. package/dist/{circuit-breaker-CSWsyoef.mjs → circuit-breaker-DLS_n1x5.mjs} +190 -7
  4. package/dist/circuit-breaker-test-utils-BVnv3T76.mjs +14 -0
  5. package/dist/compat/mod.d.cts +1 -1
  6. package/dist/compat/mod.d.ts +1 -1
  7. package/dist/compat/transformers.test.mjs +1 -1
  8. package/dist/{context-BBVLF7lx.d.cts → context-Bjswu3eC.d.cts} +18 -1
  9. package/dist/{context-BU6jSQdo.d.ts → context-COxc_O-c.d.ts} +18 -1
  10. package/dist/{deno-C8RG0HM3.mjs → deno-Bg8I1L40.mjs} +1 -1
  11. package/dist/{docloader-YZA0m_3O.mjs → docloader-Dxsk3R8v.mjs} +2 -2
  12. package/dist/federation/builder.test.mjs +1 -1
  13. package/dist/federation/circuit-breaker.test.mjs +622 -3
  14. package/dist/federation/handler.test.mjs +3 -3
  15. package/dist/federation/idempotency.test.mjs +2 -2
  16. package/dist/federation/metrics.test.mjs +1 -1
  17. package/dist/federation/middleware.test.mjs +16 -8
  18. package/dist/federation/mod.cjs +1 -1
  19. package/dist/federation/mod.d.cts +2 -2
  20. package/dist/federation/mod.d.ts +2 -2
  21. package/dist/federation/mod.js +1 -1
  22. package/dist/federation/send.test.mjs +3 -3
  23. package/dist/federation/temporal.test.mjs +1 -1
  24. package/dist/federation/webfinger.test.mjs +1 -1
  25. package/dist/{http-PCt0862M.mjs → http-BaUm6xbz.mjs} +3 -3
  26. package/dist/{http-DPOMa1DD.js → http-Bw8wN_Uk.js} +1 -1
  27. package/dist/{http-BajqV0pH.cjs → http-y8Cigpuq.cjs} +1 -1
  28. package/dist/{key-BKYwmbur.mjs → key-DOnwUeY9.mjs} +2 -2
  29. package/dist/{kv-cache-CVG3m2_-.cjs → kv-cache-B9AAXEOS.cjs} +1 -1
  30. package/dist/{kv-cache-Ceg0c1wh.mjs → kv-cache-CE_QUNa6.mjs} +1 -1
  31. package/dist/{kv-cache-IjRceERu.js → kv-cache-DilyIIfz.js} +1 -1
  32. package/dist/{ld-Dcw2skfn.mjs → ld-CiONXo2U.mjs} +3 -3
  33. package/dist/{metrics-Pue1x4ta.mjs → metrics-CmX7KEfY.mjs} +1 -1
  34. package/dist/{middleware-By8lqc18.js → middleware-BEhF8uxY.js} +193 -10
  35. package/dist/{middleware-CyxqoeW9.mjs → middleware-CRMohX8-.mjs} +1 -1
  36. package/dist/{middleware-WU_5fbGS.mjs → middleware-Cf0dFqr9.mjs} +13 -13
  37. package/dist/{middleware-BiXEAbn2.cjs → middleware-DZf3vcun.cjs} +193 -10
  38. package/dist/{mod-C0F6kvgS.d.cts → mod-0bIqGrKQ.d.cts} +1 -1
  39. package/dist/{mod-vPYVoa5n.d.ts → mod-3H9Gym5G.d.ts} +1 -1
  40. package/dist/mod.cjs +4 -4
  41. package/dist/mod.d.cts +2 -2
  42. package/dist/mod.d.ts +2 -2
  43. package/dist/mod.js +4 -4
  44. package/dist/nodeinfo/handler.test.mjs +1 -1
  45. package/dist/{owner-pVJ0Twi7.mjs → owner-C7h5_D1P.mjs} +2 -2
  46. package/dist/{proof-HzavUYxN.cjs → proof-BKOUYRRh.cjs} +1 -1
  47. package/dist/{proof-pXYODmNV.mjs → proof-BVuILGqP.mjs} +3 -3
  48. package/dist/{proof-DA8Kbchf.js → proof-DNlVt3rz.js} +1 -1
  49. package/dist/{send-BfAp60BJ.mjs → send-7kSXrsl4.mjs} +3 -3
  50. package/dist/sig/http.test.mjs +2 -2
  51. package/dist/sig/key.test.mjs +1 -1
  52. package/dist/sig/ld.test.mjs +2 -2
  53. package/dist/sig/mod.cjs +2 -2
  54. package/dist/sig/mod.js +2 -2
  55. package/dist/sig/owner.test.mjs +1 -1
  56. package/dist/sig/proof.test.mjs +1 -1
  57. package/dist/{temporal-HZHBbbk4.mjs → temporal-D3Bspq6d.mjs} +1 -1
  58. package/dist/utils/docloader.test.mjs +2 -2
  59. package/dist/utils/kv-cache.test.mjs +1 -1
  60. package/dist/utils/mod.cjs +1 -1
  61. package/dist/utils/mod.js +1 -1
  62. package/package.json +6 -6
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
4
  const require_transformers = require("./transformers-NeAONrAq.cjs");
5
- const require_http = require("./http-BajqV0pH.cjs");
6
- const require_proof = require("./proof-HzavUYxN.cjs");
5
+ const require_http = require("./http-y8Cigpuq.cjs");
6
+ const require_proof = require("./proof-BKOUYRRh.cjs");
7
7
  const require_types = require("./types-KC4QAoxe.cjs");
8
- const require_kv_cache = require("./kv-cache-CVG3m2_-.cjs");
8
+ const require_kv_cache = require("./kv-cache-B9AAXEOS.cjs");
9
9
  let _logtape_logtape = require("@logtape/logtape");
10
10
  let _fedify_uri_template = require("@fedify/uri-template");
11
11
  let _fedify_vocab = require("@fedify/vocab");
@@ -681,6 +681,13 @@ function createFederationBuilder() {
681
681
  //#endregion
682
682
  //#region src/federation/circuit-breaker.ts
683
683
  const MAX_CUSTOM_FAILURE_HISTORY = 100;
684
+ const LEGACY_SWEEP_MARKER = ["__fedify_meta", "circuit_breaker_state_ttl_sweep_v1"];
685
+ const LEGACY_SWEEP_DELETING_MARKER = { __fedifyDeletingCircuitBreakerLegacyState: true };
686
+ const CIRCUIT_BREAKER_STATE_VERSION = 1;
687
+ const LEGACY_SWEEP_LOCK_TTL = Temporal.Duration.from({ minutes: 5 });
688
+ const LEGACY_SWEEP_RETRY_WINDOW = Temporal.Duration.from({ hours: 168 });
689
+ const LEGACY_SWEEP_WAIT_INTERVAL = 10;
690
+ const LEGACY_SWEEP_CAS_ATTEMPTS = 3;
684
691
  /**
685
692
  * Tracks reachability state for remote outbox delivery hosts.
686
693
  * @since 2.3.0
@@ -690,6 +697,8 @@ var CircuitBreaker = class {
690
697
  #prefix;
691
698
  #options;
692
699
  #now;
700
+ #legacySweep;
701
+ #legacySweepDone;
693
702
  #stateChangeObserver;
694
703
  constructor(options) {
695
704
  this.#kv = options.kv;
@@ -706,6 +715,7 @@ var CircuitBreaker = class {
706
715
  return now.until(this.#capHeldRetryAt(now, heldSince, now.add(delay)));
707
716
  }
708
717
  async beforeSend(remoteHost, message) {
718
+ this.#sweepLegacyStates();
709
719
  const heldSince = parseHeldSince(message.circuitHeldSince);
710
720
  const now = this.#now();
711
721
  if (heldSince != null && Temporal.Instant.compare(heldSince.add(this.#options.heldActivityTtl), now) <= 0) return {
@@ -787,6 +797,7 @@ var CircuitBreaker = class {
787
797
  throw new Error(`Failed to update circuit breaker state for ${remoteHost}`);
788
798
  }
789
799
  async recordSuccess(remoteHost) {
800
+ this.#sweepLegacyStates();
790
801
  for (let attempt = 0; attempt < 10; attempt++) {
791
802
  const oldState = await this.#get(remoteHost);
792
803
  if (oldState == null) return void 0;
@@ -807,6 +818,7 @@ var CircuitBreaker = class {
807
818
  return await this.recordSuccess(remoteHost);
808
819
  }
809
820
  async recordFailure(remoteHost) {
821
+ this.#sweepLegacyStates();
810
822
  const now = this.#now();
811
823
  for (let attempt = 0; attempt < 10; attempt++) {
812
824
  const oldState = await this.#get(remoteHost);
@@ -854,26 +866,122 @@ var CircuitBreaker = class {
854
866
  }
855
867
  }
856
868
  async getState(remoteHost) {
857
- return await this.#get(remoteHost);
869
+ this.#sweepLegacyStates();
870
+ return stripStoredCircuitBreakerState(await this.#get(remoteHost));
871
+ }
872
+ /**
873
+ * The currently running background legacy sweep, if any.
874
+ * @internal
875
+ */
876
+ get pendingSweep() {
877
+ return this.#legacySweep;
858
878
  }
859
879
  #key(remoteHost) {
860
880
  return [...this.#prefix, remoteHost];
861
881
  }
882
+ #legacySweepMarkerKey() {
883
+ return [...this.#prefix, ...LEGACY_SWEEP_MARKER];
884
+ }
885
+ #sweepLegacyStates() {
886
+ if (this.#kv.cas == null) return;
887
+ if (this.#options.stateTtl == null) return;
888
+ if (this.#legacySweep != null) return;
889
+ if (this.#isLegacySweepDone()) return;
890
+ this.#legacySweep = this.#sweepLegacyStatesImpl().catch((error) => {
891
+ (0, _logtape_logtape.getLogger)([
892
+ "fedify",
893
+ "federation",
894
+ "circuit"
895
+ ]).warn("Failed to sweep legacy circuit breaker state:\n{error}", { error });
896
+ }).finally(() => {
897
+ this.#legacySweep = void 0;
898
+ });
899
+ }
900
+ async #sweepLegacyStatesImpl() {
901
+ const markerKey = this.#legacySweepMarkerKey();
902
+ const marker = await this.#acquireLegacySweep(markerKey);
903
+ if (marker === "done") return;
904
+ try {
905
+ for await (const { key, value } of this.#kv.list(this.#prefix)) {
906
+ if (key.length !== this.#prefix.length + 1) continue;
907
+ await this.#migrateLegacyState(key, value);
908
+ }
909
+ } catch (error) {
910
+ await this.#deleteIfUnchanged(markerKey, marker);
911
+ throw error;
912
+ }
913
+ const finishedMarker = this.#finishLegacySweepMarker(marker);
914
+ if (await this.#kv.cas(markerKey, marker, finishedMarker)) this.#rememberLegacySweepMarker(finishedMarker);
915
+ }
916
+ #finishLegacySweepMarker(marker) {
917
+ const retryUntil = getLegacySweepRetryUntil(marker);
918
+ if (retryUntil != null && Temporal.Instant.compare(this.#now(), Temporal.Instant.from(retryUntil)) < 0) return {
919
+ state: "done",
920
+ retryUntil
921
+ };
922
+ return { state: "final" };
923
+ }
924
+ async #migrateLegacyState(key, value) {
925
+ if (isCurrentCircuitBreakerState(value)) return;
926
+ const state = parseCircuitBreakerKvState(value);
927
+ if (state != null) {
928
+ await this.#kv.cas(key, value, markCircuitBreakerState(state), this.#setOptions());
929
+ return;
930
+ }
931
+ await this.#deleteIfUnchanged(key, value);
932
+ }
933
+ async #deleteIfUnchanged(key, value) {
934
+ if (await this.#kv.cas(key, value, LEGACY_SWEEP_DELETING_MARKER, { ttl: LEGACY_SWEEP_LOCK_TTL })) await this.#kv.delete(key);
935
+ }
936
+ async #acquireLegacySweep(markerKey) {
937
+ for (let attempt = 0; attempt < LEGACY_SWEEP_CAS_ATTEMPTS; attempt++) {
938
+ const marker = await this.#kv.get(markerKey);
939
+ const now = this.#now();
940
+ if (isLegacySweepActive(marker, now)) {
941
+ this.#rememberLegacySweepMarker(marker);
942
+ return "done";
943
+ }
944
+ const retryUntil = isLegacySweepRetryDue(marker, now) ? marker.retryUntil : getLegacySweepRetryUntil(marker) ?? now.add(LEGACY_SWEEP_RETRY_WINDOW).toString();
945
+ const sweeping = {
946
+ state: "sweeping",
947
+ started: now.toString(),
948
+ retryUntil
949
+ };
950
+ if (await this.#kv.cas(markerKey, marker ?? void 0, sweeping, { ttl: LEGACY_SWEEP_LOCK_TTL })) return sweeping;
951
+ await delay(LEGACY_SWEEP_WAIT_INTERVAL);
952
+ }
953
+ return "done";
954
+ }
955
+ #isLegacySweepDone() {
956
+ if (this.#legacySweepDone === "final") return true;
957
+ if (this.#legacySweepDone == null) return false;
958
+ if (Temporal.Instant.compare(this.#now(), this.#legacySweepDone) < 0) return true;
959
+ this.#legacySweepDone = void 0;
960
+ return false;
961
+ }
962
+ #rememberLegacySweepMarker(marker) {
963
+ const doneUntil = getLegacySweepDoneUntil(marker, this.#now());
964
+ if (doneUntil != null) this.#legacySweepDone = doneUntil;
965
+ }
862
966
  #capHeldRetryAt(now, heldSince, retryAt) {
863
967
  const expiresAt = (heldSince ?? now).add(this.#options.heldActivityTtl);
864
968
  return Temporal.Instant.compare(expiresAt, retryAt) < 0 ? expiresAt : retryAt;
865
969
  }
866
970
  async #get(remoteHost) {
867
- return parseCircuitBreakerKvState(await this.#kv.get(this.#key(remoteHost)));
971
+ return parseStoredCircuitBreakerKvState(await this.#kv.get(this.#key(remoteHost)));
868
972
  }
869
973
  async #replace(remoteHost, oldState, newState) {
870
974
  const key = this.#key(remoteHost);
975
+ const storedState = newState == null ? void 0 : markCircuitBreakerState(newState);
871
976
  if (this.#kv.cas == null) {
872
- if (newState == null) await this.#kv.delete(key);
873
- else await this.#kv.set(key, newState);
977
+ if (storedState == null) await this.#kv.delete(key);
978
+ else await this.#kv.set(key, storedState, this.#setOptions());
874
979
  return true;
875
980
  }
876
- return await this.#kv.cas(key, oldState, newState);
981
+ return await this.#kv.cas(key, oldState, storedState, storedState == null ? void 0 : this.#setOptions());
982
+ }
983
+ #setOptions() {
984
+ return this.#options.stateTtl == null ? void 0 : { ttl: this.#options.stateTtl };
877
985
  }
878
986
  async #notifyStateChange(remoteHost, previousState, newState) {
879
987
  try {
@@ -913,18 +1021,25 @@ var CircuitBreaker = class {
913
1021
  * @param options The public circuit breaker options supplied to Fedify.
914
1022
  * @returns The normalized failure predicate, failure pruning function,
915
1023
  * duration values, and optional callbacks with defaults applied.
916
- * @throws {RangeError} If any configured duration is not positive.
1024
+ * @throws {RangeError} If any configured duration is not positive, or if
1025
+ * `stateTtl` is shorter than `recoveryDelay`.
917
1026
  * @throws {TypeError} If `failureThreshold` is not a positive integer.
918
1027
  */
919
1028
  function normalizeCircuitBreakerOptions(options) {
920
1029
  const recoveryDelay = toInstantDuration(options.recoveryDelay ?? { minutes: 30 });
921
1030
  const heldActivityTtl = toInstantDuration(options.heldActivityTtl ?? { hours: 168 });
922
1031
  const releaseInterval = toInstantDuration(options.releaseInterval ?? { seconds: 1 });
1032
+ const configuredStateTtl = options.stateTtl == null ? void 0 : toInstantDuration(options.stateTtl);
923
1033
  assertPositiveDuration(recoveryDelay, "recoveryDelay");
924
1034
  assertPositiveDuration(heldActivityTtl, "heldActivityTtl");
925
1035
  assertPositiveDuration(releaseInterval, "releaseInterval");
1036
+ if (configuredStateTtl != null) {
1037
+ assertPositiveDuration(configuredStateTtl, "stateTtl");
1038
+ if (Temporal.Duration.compare(configuredStateTtl, recoveryDelay) < 0) throw new RangeError("stateTtl must be at least recoveryDelay.");
1039
+ }
926
1040
  let failure;
927
1041
  let pruneFailures;
1042
+ let stateTtl;
928
1043
  if (options.failure == null) {
929
1044
  const failureThreshold = options.failureThreshold ?? 5;
930
1045
  if (!Number.isInteger(failureThreshold) || failureThreshold <= 0) throw new TypeError("failureThreshold must be a positive integer.");
@@ -940,9 +1055,11 @@ function normalizeCircuitBreakerOptions(options) {
940
1055
  const last = timestamps[timestamps.length - 1];
941
1056
  return Temporal.Duration.compare(first.until(last), failureWindow) <= 0;
942
1057
  };
1058
+ stateTtl = configuredStateTtl ?? maxDuration(recoveryDelay.add(failureWindow), recoveryDelay.add(heldActivityTtl));
943
1059
  } else {
944
1060
  failure = options.failure;
945
1061
  pruneFailures = (timestamps) => timestamps.slice(-MAX_CUSTOM_FAILURE_HISTORY);
1062
+ stateTtl = configuredStateTtl;
946
1063
  }
947
1064
  return {
948
1065
  failure,
@@ -950,10 +1067,72 @@ function normalizeCircuitBreakerOptions(options) {
950
1067
  recoveryDelay,
951
1068
  heldActivityTtl,
952
1069
  releaseInterval,
1070
+ stateTtl,
953
1071
  onStateChange: options.onStateChange,
954
1072
  onActivityDrop: options.onActivityDrop
955
1073
  };
956
1074
  }
1075
+ function maxDuration(duration, ...durations) {
1076
+ return durations.reduce((max, candidate) => Temporal.Duration.compare(candidate, max) > 0 ? candidate : max, duration);
1077
+ }
1078
+ function isLegacySweepDone(value, now) {
1079
+ return getLegacySweepDoneUntil(value, now) != null;
1080
+ }
1081
+ function getLegacySweepDoneUntil(value, now) {
1082
+ if (typeof value !== "object" || value == null || !("state" in value)) return;
1083
+ if (value.state === "final") return "final";
1084
+ if (value.state === "done" && "retryUntil" in value && typeof value.retryUntil === "string") try {
1085
+ const retryUntil = Temporal.Instant.from(value.retryUntil);
1086
+ return Temporal.Instant.compare(now, retryUntil) < 0 ? retryUntil : void 0;
1087
+ } catch {
1088
+ return;
1089
+ }
1090
+ }
1091
+ function isLegacySweepRetryDue(value, now) {
1092
+ if (typeof value !== "object" || value == null || !("state" in value) || value.state !== "done" || !("retryUntil" in value) || typeof value.retryUntil !== "string") return false;
1093
+ try {
1094
+ return Temporal.Instant.compare(now, Temporal.Instant.from(value.retryUntil)) >= 0;
1095
+ } catch {
1096
+ return false;
1097
+ }
1098
+ }
1099
+ function isLegacySweepActive(value, now) {
1100
+ return isLegacySweepDone(value, now) || isLegacySweepInProgress(value, now);
1101
+ }
1102
+ function isLegacySweepInProgress(value, now) {
1103
+ if (typeof value !== "object" || value == null || !("state" in value) || value.state !== "sweeping" || !("started" in value) || typeof value.started !== "string") return false;
1104
+ try {
1105
+ return Temporal.Instant.compare(now, Temporal.Instant.from(value.started).add(LEGACY_SWEEP_LOCK_TTL)) < 0;
1106
+ } catch {
1107
+ return false;
1108
+ }
1109
+ }
1110
+ function getLegacySweepRetryUntil(value) {
1111
+ if (typeof value !== "object" || value == null || !("retryUntil" in value) || typeof value.retryUntil !== "string") return;
1112
+ try {
1113
+ Temporal.Instant.from(value.retryUntil);
1114
+ return value.retryUntil;
1115
+ } catch {
1116
+ return;
1117
+ }
1118
+ }
1119
+ function isCurrentCircuitBreakerState(value) {
1120
+ return typeof value === "object" && value != null && "__fedifyCircuitBreakerStateVersion" in value && value.__fedifyCircuitBreakerStateVersion === CIRCUIT_BREAKER_STATE_VERSION;
1121
+ }
1122
+ function markCircuitBreakerState(state) {
1123
+ return {
1124
+ ...state,
1125
+ __fedifyCircuitBreakerStateVersion: CIRCUIT_BREAKER_STATE_VERSION
1126
+ };
1127
+ }
1128
+ function stripStoredCircuitBreakerState(state) {
1129
+ if (state == null) return void 0;
1130
+ const { __fedifyCircuitBreakerStateVersion: _, ...publicState } = state;
1131
+ return publicState;
1132
+ }
1133
+ function delay(milliseconds) {
1134
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
1135
+ }
957
1136
  function toInstantDuration(duration) {
958
1137
  const parsed = Temporal.Duration.from(duration);
959
1138
  return Temporal.Duration.from({ milliseconds: Math.trunc(parsed.total({
@@ -988,6 +1167,9 @@ function parseHeldSince(value) {
988
1167
  * valid instant strings, or `undefined` when the stored value is malformed.
989
1168
  */
990
1169
  function parseCircuitBreakerKvState(value) {
1170
+ return stripStoredCircuitBreakerState(parseStoredCircuitBreakerKvState(value));
1171
+ }
1172
+ function parseStoredCircuitBreakerKvState(value) {
991
1173
  const isInstantString = (v) => {
992
1174
  if (typeof v !== "string") return false;
993
1175
  try {
@@ -1007,7 +1189,8 @@ function parseCircuitBreakerKvState(value) {
1007
1189
  state: record.state,
1008
1190
  failures: record.failures,
1009
1191
  ...record.opened == null ? {} : { opened: record.opened },
1010
- ...record.halfOpened == null ? {} : { halfOpened: record.halfOpened }
1192
+ ...record.halfOpened == null ? {} : { halfOpened: record.halfOpened },
1193
+ ...record.__fedifyCircuitBreakerStateVersion === CIRCUIT_BREAKER_STATE_VERSION ? { __fedifyCircuitBreakerStateVersion: CIRCUIT_BREAKER_STATE_VERSION } : {}
1011
1194
  };
1012
1195
  }
1013
1196
  //#endregion
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-BBVLF7lx.cjs";
2
+ import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-Bjswu3eC.cjs";
3
3
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
4
4
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
5
5
 
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-BU6jSQdo.js";
2
+ import { G as ActorDispatcher, K as ActorHandleMapper, W as ActorAliasMapper, l as RequestContext, pt as WebFingerLinksDispatcher } from "./context-COxc_O-c.js";
3
3
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
4
4
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
5
5
 
package/dist/mod.cjs CHANGED
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("./chunk-DDcVe30Y.cjs");
5
5
  const require_transformers = require("./transformers-NeAONrAq.cjs");
6
6
  require("./compat/mod.cjs");
7
- const require_http = require("./http-BajqV0pH.cjs");
8
- const require_middleware = require("./middleware-BiXEAbn2.cjs");
9
- const require_proof = require("./proof-HzavUYxN.cjs");
7
+ const require_http = require("./http-y8Cigpuq.cjs");
8
+ const require_middleware = require("./middleware-DZf3vcun.cjs");
9
+ const require_proof = require("./proof-BKOUYRRh.cjs");
10
10
  const require_types = require("./types-KC4QAoxe.cjs");
11
- const require_kv_cache = require("./kv-cache-CVG3m2_-.cjs");
11
+ const require_kv_cache = require("./kv-cache-B9AAXEOS.cjs");
12
12
  const require_federation_mod = require("./federation/mod.cjs");
13
13
  require("./nodeinfo/mod.cjs");
14
14
  require("./runtime/mod.cjs");
package/dist/mod.d.cts CHANGED
@@ -2,11 +2,11 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CAM_bQXx.cjs";
3
3
  import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-VyDTd4G3.cjs";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
5
- import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-BBVLF7lx.cjs";
5
+ import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-Bjswu3eC.cjs";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
7
7
  import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-D8uSFzxe.cjs";
8
8
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
9
- import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-C0F6kvgS.cjs";
9
+ import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-0bIqGrKQ.cjs";
10
10
  import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-B0hW12_O.cjs";
11
11
  import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-yvIXFAEi.cjs";
12
12
  export * from "@fedify/vocab-runtime";
package/dist/mod.d.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CSddvgWN.js";
3
3
  import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-lf8Hsd91.js";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CnngXDNJ.js";
5
- import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-BU6jSQdo.js";
5
+ import { $ as CustomCollectionCursor, A as Rfc6570Expression, At as parseCircuitBreakerKvState, B as createFederationBuilder, C as FederationStartQueueOptions, Ct as CircuitBreakerFailurePolicy, D as InboxListenerSetters, Dt as CircuitBreakerStateChange, E as InboxChallengePolicy, Et as CircuitBreakerState, F as CreateExponentialBackoffPolicyOptions, G as ActorDispatcher, H as respondWithObject, I as RetryContext, J as AuthorizePredicate, K as ActorHandleMapper, L as RetryPolicy, M as FederationOrigin, N as FederationQueueOptions, O as ObjectCallbackSetters, Ot as NormalizedCircuitBreakerOptions, P as createFederation, Q as CustomCollectionCounter, R as createExponentialBackoffPolicy, S as FederationOptions, St as CircuitBreakerCreateOptions, T as IdempotencyStrategy, Tt as CircuitBreakerOptions, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as ActorAliasMapper, X as CollectionCursor, Y as CollectionCounter, Z as CollectionDispatcher, _ as Federatable, _t as buildCollectionSynchronizationHeader, a as GetSignedKeyOptions, at as ObjectDispatcher, b as FederationBuilder, bt as CircuitBreakerActivityDrop, c as ParseUriResult, ct as OutboxListenerErrorHandler, d as SendActivityOptions, dt as UnverifiedActivityHandler, et as CustomCollectionDispatcher, f as SendActivityOptionsForCollection, ft as UnverifiedActivityReason, g as CustomCollectionCallbackSetters, gt as PageItems, h as ConstructorWithTypeId, ht as SenderKeyPair, i as GetActorOptions, it as ObjectAuthorizePredicate, j as FederationKvPrefixes, jt as ActivityTransformer, k as OutboxListenerSetters, kt as normalizeCircuitBreakerOptions, l as RequestContext, lt as OutboxPermanentFailureHandler, m as CollectionCallbackSetters, mt as SendActivityError, n as Context, nt as InboxListener, o as InboxContext, ot as OutboxErrorHandler, p as ActorCallbackSetters, pt as WebFingerLinksDispatcher, q as ActorKeyPairsDispatcher, r as ForwardActivityOptions, rt as NodeInfoDispatcher, s as OutboxContext, st as OutboxListener, t as ActorKeyPair, tt as InboxErrorHandler, u as RouteActivityOptions, ut as SharedInboxKeyDispatcher, v as Federation, vt as digest, w as IdempotencyKeyCallback, wt as CircuitBreakerKvState, x as FederationFetchOptions, xt as CircuitBreakerBeforeSendDecision, y as FederationBenchmarkOptions, yt as CircuitBreaker, z as Message } from "./context-COxc_O-c.js";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
7
7
  import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-D-nlpY04.js";
8
8
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
9
- import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-vPYVoa5n.js";
9
+ import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-3H9Gym5G.js";
10
10
  import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-COIAjwRS.js";
11
11
  import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DFvNJcNb.js";
12
12
  export * from "@fedify/vocab-runtime";
package/dist/mod.js CHANGED
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./chunk-CRNNMoPX.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
5
5
  import "./compat/mod.js";
6
- import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "./http-DPOMa1DD.js";
7
- import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "./middleware-By8lqc18.js";
8
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-DA8Kbchf.js";
6
+ import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "./http-Bw8wN_Uk.js";
7
+ import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "./middleware-BEhF8uxY.js";
8
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-DNlVt3rz.js";
9
9
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-IjRceERu.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DilyIIfz.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
@@ -5,7 +5,7 @@ import { r as createRequestContext } from "../context-DVoTs_wM.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
6
6
  import "../std__assert-BBjXFNOb.mjs";
7
7
  import { t as MemoryKvStore } from "../kv-rV3vodCc.mjs";
8
- import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-WU_5fbGS.mjs";
8
+ import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-Cf0dFqr9.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -1,8 +1,8 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
5
- import "./key-BKYwmbur.mjs";
4
+ import { n as version, t as name } from "./deno-Bg8I1L40.mjs";
5
+ import "./key-DOnwUeY9.mjs";
6
6
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
7
7
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  const require_chunk = require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-BajqV0pH.cjs");
4
+ const require_http = require("./http-y8Cigpuq.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let _fedify_vocab = require("@fedify/vocab");
7
7
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -1,9 +1,9 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-Pue1x4ta.mjs";
6
- import { n as fetchKey, o as validateCryptoKey } from "./key-BKYwmbur.mjs";
4
+ import { n as version, t as name } from "./deno-Bg8I1L40.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-CmX7KEfY.mjs";
6
+ import { n as fetchKey, o as validateCryptoKey } from "./key-DOnwUeY9.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "./public-audience-Cvbr2Gzt.mjs";
8
8
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-L_DbOaFe.mjs";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { F as version, P as name, _ as measureSignatureKeyFetch, d as validateCryptoKey, f as getDurationMs, p as getFederationMetrics, s as fetchKey } from "./http-DPOMa1DD.js";
3
+ import { F as version, P as name, _ as measureSignatureKeyFetch, d as validateCryptoKey, f as getDurationMs, p as getFederationMetrics, s as fetchKey } from "./http-Bw8wN_Uk.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,9 +1,9 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-C8RG0HM3.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-Pue1x4ta.mjs";
6
- import { n as doubleKnock } from "./http-PCt0862M.mjs";
4
+ import { n as version, t as name } from "./deno-Bg8I1L40.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-CmX7KEfY.mjs";
6
+ import { n as doubleKnock } from "./http-BaUm6xbz.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError } from "@fedify/vocab-runtime";
@@ -7,8 +7,8 @@ import { r as assertExists, t as assertStringIncludes } from "../std__assert-BBj
7
7
  import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
9
9
  import { t as assert } from "../assert-OguE97r2.mjs";
10
- import { t as exportJwk } from "../key-BKYwmbur.mjs";
11
- import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-PCt0862M.mjs";
10
+ import { t as exportJwk } from "../key-DOnwUeY9.mjs";
11
+ import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-BaUm6xbz.mjs";
12
12
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
13
13
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { FetchError, exportSpki } from "@fedify/vocab-runtime";
@@ -5,7 +5,7 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import "../std__assert-BBjXFNOb.mjs";
6
6
  import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
8
- import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-BKYwmbur.mjs";
8
+ import { a as importJwk, i as generateCryptoKeyPair, n as fetchKey, o as validateCryptoKey, r as fetchKeyDetailed, t as exportJwk } from "../key-DOnwUeY9.mjs";
9
9
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
10
10
  import { CryptographicKey, Multikey } from "@fedify/vocab";
11
11
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -5,9 +5,9 @@ import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
5
5
  import { n as assertGreaterOrEqual, r as assertFalse, t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
6
6
  import { t as assertThrows } from "../assert_throws-BOkhLGYc.mjs";
7
7
  import { t as assert } from "../assert-OguE97r2.mjs";
8
- import { i as generateCryptoKeyPair } from "../key-BKYwmbur.mjs";
8
+ import { i as generateCryptoKeyPair } from "../key-DOnwUeY9.mjs";
9
9
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
10
- import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-Dcw2skfn.mjs";
10
+ import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-CiONXo2U.mjs";
11
11
  import { CryptographicKey } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
13
13
  import { encodeBase64 } from "byte-encodings/base64";
package/dist/sig/mod.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_http = require("../http-BajqV0pH.cjs");
5
- const require_proof = require("../proof-HzavUYxN.cjs");
4
+ const require_http = require("../http-y8Cigpuq.cjs");
5
+ const require_proof = require("../proof-BKOUYRRh.cjs");
6
6
  exports.attachSignature = require_proof.attachSignature;
7
7
  exports.createProof = require_proof.createProof;
8
8
  exports.createSignature = require_proof.createSignature;
package/dist/sig/mod.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "../http-DPOMa1DD.js";
4
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-DA8Kbchf.js";
3
+ import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "../http-Bw8wN_Uk.js";
4
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "../proof-DNlVt3rz.js";
5
5
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
@@ -6,7 +6,7 @@ import "../std__assert-BBjXFNOb.mjs";
6
6
  import { r as assertFalse } from "../assert_rejects-DN60FHPX.mjs";
7
7
  import { t as assert } from "../assert-OguE97r2.mjs";
8
8
  import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DGu1NFwu.mjs";
9
- import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-pVJ0Twi7.mjs";
9
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-C7h5_D1P.mjs";
10
10
  import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
11
11
  import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
12
12
  //#region src/sig/owner.test.ts
@@ -8,7 +8,7 @@ import { t as assertInstanceOf } from "../assert_instance_of-DBC5X09g.mjs";
8
8
  import { t as assert } from "../assert-OguE97r2.mjs";
9
9
  import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DGu1NFwu.mjs";
10
10
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-L_DbOaFe.mjs";
11
- import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-pXYODmNV.mjs";
11
+ import { a as verifyProof, i as verifyObject, n as hasProofLike, r as signObject, t as createProof } from "../proof-BVuILGqP.mjs";
12
12
  import { Create, DataIntegrityProof, Document, Multikey, Note, PUBLIC_COLLECTION, Place } from "@fedify/vocab";
13
13
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
14
14
  import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { c as getNormalizationContextLoader } from "./ld-Dcw2skfn.mjs";
4
+ import { c as getNormalizationContextLoader } from "./ld-CiONXo2U.mjs";
5
5
  import jsonld from "@fedify/vocab-runtime/jsonld";
6
6
  //#region src/federation/temporal.ts
7
7
  function isPlainObject(value) {
@@ -5,9 +5,9 @@ import { t as esm_default } from "../esm-vrlUxr60.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-C-ZRDbaf.mjs";
6
6
  import "../std__assert-BBjXFNOb.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-DN60FHPX.mjs";
8
- import { l as verifyRequest } from "../http-PCt0862M.mjs";
8
+ import { l as verifyRequest } from "../http-BaUm6xbz.mjs";
9
9
  import { i as rsaPrivateKey2 } from "../keys-DGu1NFwu.mjs";
10
- import { t as getAuthenticatedDocumentLoader } from "../docloader-YZA0m_3O.mjs";
10
+ import { t as getAuthenticatedDocumentLoader } from "../docloader-Dxsk3R8v.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
12
12
  import { UrlError } from "@fedify/vocab-runtime";
13
13
  //#region src/utils/docloader.test.ts
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as kvCache, t as MockKvStore } from "../kv-cache-Ceg0c1wh.mjs";
4
+ import { n as kvCache, t as MockKvStore } from "../kv-cache-CE_QUNa6.mjs";
5
5
  import { deepStrictEqual, throws } from "node:assert";
6
6
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
7
7
  import { preloadedContexts } from "@fedify/vocab-runtime";
@@ -1,6 +1,6 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require_kv_cache = require("../kv-cache-CVG3m2_-.cjs");
4
+ const require_kv_cache = require("../kv-cache-B9AAXEOS.cjs");
5
5
  exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
6
6
  exports.kvCache = require_kv_cache.kvCache;
package/dist/utils/mod.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-IjRceERu.js";
3
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-DilyIIfz.js";
4
4
  export { getAuthenticatedDocumentLoader, kvCache };