@fedify/fedify 2.1.25 → 2.1.27

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 (76) hide show
  1. package/dist/{builder-DsBAef6b.mjs → builder-CKQkP3a2.mjs} +11 -3
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +2 -2
  5. package/dist/{context-D4s0Wk3N.d.cts → context-BNwv9Q1v.d.cts} +1 -1
  6. package/dist/{context-BgU5UWTx.d.ts → context-DLLaDau8.d.ts} +1 -1
  7. package/dist/{deno-9AaebKOA.mjs → deno-BR2CGENT.mjs} +1 -1
  8. package/dist/{docloader-DX96uPUj.mjs → docloader-BDHKVMoV.mjs} +2 -2
  9. package/dist/federation/builder.test.mjs +38 -3
  10. package/dist/federation/collection.test.mjs +1 -1
  11. package/dist/federation/handler.test.mjs +7 -7
  12. package/dist/federation/idempotency.test.mjs +3 -3
  13. package/dist/federation/inbox.test.mjs +1 -1
  14. package/dist/federation/keycache.test.mjs +33 -2
  15. package/dist/federation/kv.test.mjs +1 -1
  16. package/dist/federation/middleware.test.mjs +122 -7
  17. package/dist/federation/mod.cjs +1 -1
  18. package/dist/federation/mod.d.cts +3 -3
  19. package/dist/federation/mod.d.ts +3 -3
  20. package/dist/federation/mod.js +1 -1
  21. package/dist/federation/send.test.mjs +3 -3
  22. package/dist/federation/temporal.test.mjs +1 -1
  23. package/dist/federation/webfinger.test.mjs +2 -2
  24. package/dist/{http-BJEMpnnY.cjs → http-CsQRvInz.cjs} +1 -1
  25. package/dist/{http-CdJ6n4rA.js → http-DQVY5EMT.js} +1 -1
  26. package/dist/{http-B5qAeoJd.mjs → http-QzHm1vsW.mjs} +2 -2
  27. package/dist/{inbox-BSyjaFbo.mjs → inbox-DEXoNgGa.mjs} +1 -1
  28. package/dist/{key-x9f-H7eO.mjs → key-CDIMbgsc.mjs} +1 -1
  29. package/dist/{keycache-CaO7wyQA.mjs → keycache-RFlZObU3.mjs} +23 -2
  30. package/dist/{kv-gJ8LYbxX.d.cts → kv-CZKl1IUS.d.cts} +3 -2
  31. package/dist/{kv-D6hNiMTK.d.ts → kv-CxaI4eGo.d.ts} +3 -2
  32. package/dist/{kv-cache-BDp2c_QE.cjs → kv-cache-FfmHQljR.cjs} +1 -1
  33. package/dist/{kv-cache-Dx3QwNBI.js → kv-cache-cTsPZ49Z.js} +1 -1
  34. package/dist/{ld-cfUwoi0C.mjs → ld-BpkaBh2H.mjs} +2 -2
  35. package/dist/{middleware-XXuSt_6b.cjs → middleware-Bla8jBXk.cjs} +43 -12
  36. package/dist/{middleware-DDT9ljTQ.mjs → middleware-C9vVE-6R.mjs} +1 -1
  37. package/dist/{middleware-DHHRwSZH.mjs → middleware-DVaturw-.mjs} +24 -21
  38. package/dist/{middleware-BXJpAXhO.cjs → middleware-Ddrg18eD.cjs} +1 -1
  39. package/dist/{middleware-CP35ElZv.js → middleware-DwEVn3gK.js} +42 -11
  40. package/dist/{mod-Bx80LUTA.d.cts → mod-BmlfRBmU.d.cts} +1 -1
  41. package/dist/{mod-DcAiY74j.d.ts → mod-CWJNbyju.d.ts} +1 -1
  42. package/dist/{mod-DkE98l_7.d.cts → mod-Cn9GJ5ex.d.cts} +1 -1
  43. package/dist/{mod-DqkY4FDr.d.ts → mod-DNEgTI8M.d.ts} +1 -1
  44. package/dist/mod.cjs +4 -4
  45. package/dist/mod.d.cts +4 -4
  46. package/dist/mod.d.ts +4 -4
  47. package/dist/mod.js +4 -4
  48. package/dist/nodeinfo/client.test.mjs +1 -1
  49. package/dist/nodeinfo/handler.test.mjs +2 -2
  50. package/dist/nodeinfo/types.test.mjs +1 -1
  51. package/dist/otel/exporter.test.mjs +1 -1
  52. package/dist/otel/mod.d.cts +1 -1
  53. package/dist/otel/mod.d.ts +1 -1
  54. package/dist/{owner-DklgvZXn.mjs → owner-DnOwKsK6.mjs} +2 -2
  55. package/dist/{proof-CI4rsVLu.mjs → proof-CShmVLWt.mjs} +2 -2
  56. package/dist/{proof-DzFzyfIc.cjs → proof-JfqNWc2E.cjs} +1 -1
  57. package/dist/{proof-Dsa_ZC-M.js → proof-uEay4EIq.js} +1 -1
  58. package/dist/{send-DJmW6Z-I.mjs → send-DCg0WblG.mjs} +2 -2
  59. package/dist/sig/http.test.mjs +62 -3
  60. package/dist/sig/key.test.mjs +1 -1
  61. package/dist/sig/ld.test.mjs +2 -2
  62. package/dist/sig/mod.cjs +2 -2
  63. package/dist/sig/mod.js +2 -2
  64. package/dist/sig/owner.test.mjs +1 -1
  65. package/dist/sig/proof.test.mjs +1 -1
  66. package/dist/{temporal-BanFifxu.mjs → temporal-C96jXvaM.mjs} +1 -1
  67. package/dist/utils/docloader.test.mjs +2 -2
  68. package/dist/utils/mod.cjs +1 -1
  69. package/dist/utils/mod.d.cts +1 -1
  70. package/dist/utils/mod.d.ts +1 -1
  71. package/dist/utils/mod.js +1 -1
  72. package/package.json +5 -5
  73. /package/dist/{client-DM72NZuk.mjs → client-CjDMsn4a.mjs} +0 -0
  74. /package/dist/{collection-ChgDTHLz.mjs → collection-BD6-SZ6O.mjs} +0 -0
  75. /package/dist/{kv-BrZHNugx.mjs → kv-HvthQAHr.mjs} +0 -0
  76. /package/dist/{types-C37hquWI.mjs → types-DCP0WLdt.mjs} +0 -0
@@ -2,6 +2,7 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { CryptographicKey, Multikey } from "@fedify/vocab";
5
+ import { FetchError, UrlError } from "@fedify/vocab-runtime";
5
6
  //#region src/federation/keycache.ts
6
7
  const KEY_CACHE_GENERATION = "2";
7
8
  var KvKeyCache = class {
@@ -76,8 +77,15 @@ var KvKeyCache = class {
76
77
  })
77
78
  };
78
79
  else if ("errorName" in cached && typeof cached.errorName === "string" && "errorMessage" in cached && typeof cached.errorMessage === "string") {
79
- const error = new Error(cached.errorMessage);
80
+ let error;
81
+ if ("errorType" in cached && cached.errorType === "FetchError" && "errorUrl" in cached && typeof cached.errorUrl === "string" && URL.canParse(cached.errorUrl)) {
82
+ error = new FetchError(cached.errorUrl);
83
+ error.message = cached.errorMessage;
84
+ } else if ("errorType" in cached && cached.errorType === "UrlError" && "errorReason" in cached && (cached.errorReason === "dns" || cached.errorReason === "disallowed")) error = new UrlError(cached.errorMessage, { reason: cached.errorReason });
85
+ else error = new Error(cached.errorMessage);
80
86
  error.name = cached.errorName;
87
+ if ("errorCause" in cached && cached.errorCause != null && typeof cached.errorCause === "object" && "name" in cached.errorCause && typeof cached.errorCause.name === "string" && "message" in cached.errorCause && typeof cached.errorCause.message === "string") if ("isDomException" in cached.errorCause && cached.errorCause.isDomException === true) error.cause = new DOMException(cached.errorCause.message, cached.errorCause.name);
88
+ else error.cause = Object.assign(new Error(cached.errorCause.message), { name: cached.errorCause.name });
81
89
  return { error };
82
90
  }
83
91
  }
@@ -95,9 +103,22 @@ var KvKeyCache = class {
95
103
  }, { ttl: this.unavailableKeyTtl });
96
104
  return;
97
105
  }
106
+ const cause = error.error.cause;
98
107
  await this.kv.set(this.#getFetchErrorKey(keyId), {
99
108
  errorName: error.error.name,
100
- errorMessage: error.error.message
109
+ errorMessage: error.error.message,
110
+ ...error.error instanceof FetchError ? {
111
+ errorType: "FetchError",
112
+ errorUrl: error.error.url.href
113
+ } : error.error instanceof UrlError ? {
114
+ errorType: "UrlError",
115
+ errorReason: error.error.reason
116
+ } : {},
117
+ ...cause instanceof Error || cause instanceof DOMException ? { errorCause: {
118
+ name: cause.name,
119
+ message: cause.message,
120
+ isDomException: cause instanceof DOMException
121
+ } } : {}
101
122
  }, { ttl: this.unavailableKeyTtl });
102
123
  }
103
124
  };
@@ -41,14 +41,15 @@ interface KvStore {
41
41
  /**
42
42
  * Gets the value for the given key.
43
43
  * @param key The key to get the value for.
44
- * @returns The value for the key, or `undefined` if the key does not exist.
44
+ * @returns The value for the key, including `null` if stored, or `undefined`
45
+ * if the key does not exist.
45
46
  * @template T The type of the value to get.
46
47
  */
47
48
  get<T = unknown>(key: KvKey): Promise<T | undefined>;
48
49
  /**
49
50
  * Sets the value for the given key.
50
51
  * @param key The key to set the value for.
51
- * @param value The value to set.
52
+ * @param value The value to set. `null` is a storable value.
52
53
  * @param options Additional options for setting the value.
53
54
  */
54
55
  set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
@@ -41,14 +41,15 @@ interface KvStore {
41
41
  /**
42
42
  * Gets the value for the given key.
43
43
  * @param key The key to get the value for.
44
- * @returns The value for the key, or `undefined` if the key does not exist.
44
+ * @returns The value for the key, including `null` if stored, or `undefined`
45
+ * if the key does not exist.
45
46
  * @template T The type of the value to get.
46
47
  */
47
48
  get<T = unknown>(key: KvKey): Promise<T | undefined>;
48
49
  /**
49
50
  * Sets the value for the given key.
50
51
  * @param key The key to set the value for.
51
- * @param value The value to set.
52
+ * @param value The value to set. `null` is a storable value.
52
53
  * @param options Additional options for setting the value.
53
54
  */
54
55
  set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
3
  require("./chunk-DDcVe30Y.cjs");
4
- const require_http = require("./http-BJEMpnnY.cjs");
4
+ const require_http = require("./http-CsQRvInz.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let es_toolkit = require("es-toolkit");
7
7
  let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { f as validateCryptoKey, t as doubleKnock } from "./http-CdJ6n4rA.js";
3
+ import { f as validateCryptoKey, t as doubleKnock } from "./http-DQVY5EMT.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { curry } from "es-toolkit";
6
6
  import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -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-9AaebKOA.mjs";
5
- import { r as fetchKey, s as validateCryptoKey } from "./key-x9f-H7eO.mjs";
4
+ import { n as version, t as name } from "./deno-BR2CGENT.mjs";
5
+ import { r as fetchKey, s as validateCryptoKey } from "./key-CDIMbgsc.mjs";
6
6
  import { Activity, CryptographicKey, Object as Object$1, getTypeId } from "@fedify/vocab";
7
7
  import { SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -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-BJEMpnnY.cjs");
5
+ const require_http = require("./http-CsQRvInz.cjs");
6
6
  const require_types = require("./types-DRPjmHVV.cjs");
7
- const require_proof = require("./proof-DzFzyfIc.cjs");
8
- const require_kv_cache = require("./kv-cache-BDp2c_QE.cjs");
7
+ const require_proof = require("./proof-JfqNWc2E.cjs");
8
+ const require_kv_cache = require("./kv-cache-FfmHQljR.cjs");
9
9
  let _logtape_logtape = require("@logtape/logtape");
10
10
  let _fedify_vocab = require("@fedify/vocab");
11
11
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -328,6 +328,7 @@ var FederationBuilderImpl = class {
328
328
  * Symbol registry for unique identification of unnamed symbols.
329
329
  */
330
330
  #symbolRegistry = /* @__PURE__ */ new Map();
331
+ #collectionNames = /* @__PURE__ */ new Map();
331
332
  constructor() {
332
333
  this.router = new Router();
333
334
  this.objectCallbacks = {};
@@ -336,7 +337,7 @@ var FederationBuilderImpl = class {
336
337
  this.collectionTypeIds = {};
337
338
  }
338
339
  async build(options) {
339
- const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-BXJpAXhO.cjs"));
340
+ const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-Ddrg18eD.cjs"));
340
341
  const f = new FederationImpl(options);
341
342
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
342
343
  f.router = this.router.clone();
@@ -349,6 +350,8 @@ var FederationBuilderImpl = class {
349
350
  f.objectTypeIds = { ...this.objectTypeIds };
350
351
  f.collectionCallbacks = { ...this.collectionCallbacks };
351
352
  f.collectionTypeIds = { ...this.collectionTypeIds };
353
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
354
+ f.#collectionNames = new Map(this.#collectionNames);
352
355
  f.inboxPath = this.inboxPath;
353
356
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
354
357
  f.outboxCallbacks = this.outboxCallbacks == null ? void 0 : { ...this.outboxCallbacks };
@@ -761,6 +764,7 @@ var FederationBuilderImpl = class {
761
764
  if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
762
765
  if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
763
766
  if (this.router.add(path, routeName).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
767
+ this.#collectionNames.set(routeName, name);
764
768
  const callbacks = { dispatcher };
765
769
  this.collectionCallbacks[name] = callbacks;
766
770
  this.collectionTypeIds[name] = itemType;
@@ -797,6 +801,10 @@ var FederationBuilderImpl = class {
797
801
  const routeName = this.#uniqueCollectionId(name);
798
802
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
799
803
  }
804
+ /** Resolves a custom collection route to its original name. */
805
+ getCollectionName(routeName) {
806
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
807
+ }
800
808
  setOutboxPermanentFailureHandler(handler) {
801
809
  this.outboxPermanentFailureHandler = handler;
802
810
  }
@@ -935,8 +943,15 @@ var KvKeyCache = class {
935
943
  })
936
944
  };
937
945
  else if ("errorName" in cached && typeof cached.errorName === "string" && "errorMessage" in cached && typeof cached.errorMessage === "string") {
938
- const error = new Error(cached.errorMessage);
946
+ let error;
947
+ if ("errorType" in cached && cached.errorType === "FetchError" && "errorUrl" in cached && typeof cached.errorUrl === "string" && URL.canParse(cached.errorUrl)) {
948
+ error = new _fedify_vocab_runtime.FetchError(cached.errorUrl);
949
+ error.message = cached.errorMessage;
950
+ } else if ("errorType" in cached && cached.errorType === "UrlError" && "errorReason" in cached && (cached.errorReason === "dns" || cached.errorReason === "disallowed")) error = new _fedify_vocab_runtime.UrlError(cached.errorMessage, { reason: cached.errorReason });
951
+ else error = new Error(cached.errorMessage);
939
952
  error.name = cached.errorName;
953
+ if ("errorCause" in cached && cached.errorCause != null && typeof cached.errorCause === "object" && "name" in cached.errorCause && typeof cached.errorCause.name === "string" && "message" in cached.errorCause && typeof cached.errorCause.message === "string") if ("isDomException" in cached.errorCause && cached.errorCause.isDomException === true) error.cause = new DOMException(cached.errorCause.message, cached.errorCause.name);
954
+ else error.cause = Object.assign(new Error(cached.errorCause.message), { name: cached.errorCause.name });
940
955
  return { error };
941
956
  }
942
957
  }
@@ -954,9 +969,22 @@ var KvKeyCache = class {
954
969
  }, { ttl: this.unavailableKeyTtl });
955
970
  return;
956
971
  }
972
+ const cause = error.error.cause;
957
973
  await this.kv.set(this.#getFetchErrorKey(keyId), {
958
974
  errorName: error.error.name,
959
- errorMessage: error.error.message
975
+ errorMessage: error.error.message,
976
+ ...error.error instanceof _fedify_vocab_runtime.FetchError ? {
977
+ errorType: "FetchError",
978
+ errorUrl: error.error.url.href
979
+ } : error.error instanceof _fedify_vocab_runtime.UrlError ? {
980
+ errorType: "UrlError",
981
+ errorReason: error.error.reason
982
+ } : {},
983
+ ...cause instanceof Error || cause instanceof DOMException ? { errorCause: {
984
+ name: cause.name,
985
+ message: cause.message,
986
+ isDomException: cause instanceof DOMException
987
+ } } : {}
960
988
  }, { ttl: this.unavailableKeyTtl });
961
989
  }
962
990
  };
@@ -3806,10 +3834,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3806
3834
  onNotFound
3807
3835
  });
3808
3836
  case "collection": {
3809
- const name = route.name.replace(/^collection:/, "");
3837
+ const name = this.getCollectionName(route.name);
3810
3838
  const callbacks = this.collectionCallbacks[name];
3811
3839
  return await handleCustomCollection(request, {
3812
- name,
3840
+ name: String(name),
3813
3841
  context,
3814
3842
  values: route.values,
3815
3843
  collectionCallbacks: callbacks,
@@ -3819,10 +3847,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3819
3847
  });
3820
3848
  }
3821
3849
  case "orderedCollection": {
3822
- const name = route.name.replace(/^orderedCollection:/, "");
3850
+ const name = this.getCollectionName(route.name);
3823
3851
  const callbacks = this.collectionCallbacks[name];
3824
3852
  return await handleOrderedCollection(request, {
3825
- name,
3853
+ name: String(name),
3826
3854
  context,
3827
3855
  values: route.values,
3828
3856
  collectionCallbacks: callbacks,
@@ -4005,8 +4033,10 @@ var ContextImpl = class ContextImpl {
4005
4033
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
4006
4034
  const match = route.name.match(collectionRegex);
4007
4035
  if (match !== null) {
4008
- const [, type, name] = match;
4036
+ const [, type] = match;
4037
+ const name = this.federation.getCollectionName(route.name);
4009
4038
  const cls = this.federation.collectionTypeIds[name];
4039
+ if (cls == null) return null;
4010
4040
  return {
4011
4041
  type,
4012
4042
  name,
@@ -4353,7 +4383,7 @@ var ContextImpl = class ContextImpl {
4353
4383
  "inbox"
4354
4384
  ]);
4355
4385
  const contextLoader = options.contextLoader ?? this.contextLoader;
4356
- const json = await activity.toJsonLd({ contextLoader });
4386
+ let json = await activity.toJsonLd({ contextLoader });
4357
4387
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
4358
4388
  if (await require_proof.verifyObject(_fedify_vocab.Activity, json, {
4359
4389
  contextLoader,
@@ -4409,6 +4439,7 @@ var ContextImpl = class ContextImpl {
4409
4439
  }
4410
4440
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
4411
4441
  activity = fetched;
4442
+ json = await fetched.toJsonLd({ contextLoader });
4412
4443
  } else logger.debug("Object Integrity Proofs are verified.", {
4413
4444
  recipient,
4414
4445
  activity: json
@@ -1,5 +1,5 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-DHHRwSZH.mjs";
4
+ import { n as FederationImpl } from "./middleware-DVaturw-.mjs";
5
5
  export { FederationImpl };
@@ -2,25 +2,25 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { n as RouterError } from "./router-CrMLXoOr.mjs";
5
- import { n as version, t as name } from "./deno-9AaebKOA.mjs";
5
+ import { n as version, t as name } from "./deno-BR2CGENT.mjs";
6
6
  import { t as formatAcceptSignature } from "./accept-BavzedPB.mjs";
7
- import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-x9f-H7eO.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-B5qAeoJd.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-DX96uPUj.mjs";
7
+ import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-CDIMbgsc.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-QzHm1vsW.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-BDHKVMoV.mjs";
10
10
  import { n as kvCache } from "./kv-cache-DqEKe5E0.mjs";
11
- import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-cfUwoi0C.mjs";
12
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-DklgvZXn.mjs";
13
- import { n as signObject, r as verifyObject } from "./proof-CI4rsVLu.mjs";
14
- import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-DM72NZuk.mjs";
15
- import { t as nodeInfoToJson } from "./types-C37hquWI.mjs";
16
- import { n as routeActivity } from "./inbox-BSyjaFbo.mjs";
17
- import { t as FederationBuilderImpl } from "./builder-DsBAef6b.mjs";
18
- import { t as buildCollectionSynchronizationHeader } from "./collection-ChgDTHLz.mjs";
19
- import { t as KvKeyCache } from "./keycache-CaO7wyQA.mjs";
11
+ import { t as KvKeyCache } from "./keycache-RFlZObU3.mjs";
12
+ import { a as compactJsonLd, c as getNormalizationContextLoader, d as isInvalidUrlTypeError, f as signJsonLd, g as wrapContextLoaderForJsonLd, l as hasSignature, p as verifyCompactJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as isClearlyMalformedContextReference } from "./ld-BpkaBh2H.mjs";
13
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-DnOwKsK6.mjs";
14
+ import { n as signObject, r as verifyObject } from "./proof-CShmVLWt.mjs";
15
+ import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-CjDMsn4a.mjs";
16
+ import { t as nodeInfoToJson } from "./types-DCP0WLdt.mjs";
17
+ import { n as routeActivity } from "./inbox-DEXoNgGa.mjs";
18
+ import { t as FederationBuilderImpl } from "./builder-CKQkP3a2.mjs";
19
+ import { t as buildCollectionSynchronizationHeader } from "./collection-BD6-SZ6O.mjs";
20
20
  import { t as acceptsJsonLd } from "./negotiation-BehA2uul.mjs";
21
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-BanFifxu.mjs";
21
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-C96jXvaM.mjs";
22
22
  import { t as createExponentialBackoffPolicy } from "./retry-B_E3V_Dx.mjs";
23
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-DJmW6Z-I.mjs";
23
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-DCg0WblG.mjs";
24
24
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
25
25
  import { lookupWebFinger } from "@fedify/webfinger";
26
26
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -2531,10 +2531,10 @@ var FederationImpl = class extends FederationBuilderImpl {
2531
2531
  onNotFound
2532
2532
  });
2533
2533
  case "collection": {
2534
- const name = route.name.replace(/^collection:/, "");
2534
+ const name = this.getCollectionName(route.name);
2535
2535
  const callbacks = this.collectionCallbacks[name];
2536
2536
  return await handleCustomCollection(request, {
2537
- name,
2537
+ name: String(name),
2538
2538
  context,
2539
2539
  values: route.values,
2540
2540
  collectionCallbacks: callbacks,
@@ -2544,10 +2544,10 @@ var FederationImpl = class extends FederationBuilderImpl {
2544
2544
  });
2545
2545
  }
2546
2546
  case "orderedCollection": {
2547
- const name = route.name.replace(/^orderedCollection:/, "");
2547
+ const name = this.getCollectionName(route.name);
2548
2548
  const callbacks = this.collectionCallbacks[name];
2549
2549
  return await handleOrderedCollection(request, {
2550
- name,
2550
+ name: String(name),
2551
2551
  context,
2552
2552
  values: route.values,
2553
2553
  collectionCallbacks: callbacks,
@@ -2730,8 +2730,10 @@ var ContextImpl = class ContextImpl {
2730
2730
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
2731
2731
  const match = route.name.match(collectionRegex);
2732
2732
  if (match !== null) {
2733
- const [, type, name] = match;
2733
+ const [, type] = match;
2734
+ const name = this.federation.getCollectionName(route.name);
2734
2735
  const cls = this.federation.collectionTypeIds[name];
2736
+ if (cls == null) return null;
2735
2737
  return {
2736
2738
  type,
2737
2739
  name,
@@ -3078,7 +3080,7 @@ var ContextImpl = class ContextImpl {
3078
3080
  "inbox"
3079
3081
  ]);
3080
3082
  const contextLoader = options.contextLoader ?? this.contextLoader;
3081
- const json = await activity.toJsonLd({ contextLoader });
3083
+ let json = await activity.toJsonLd({ contextLoader });
3082
3084
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
3083
3085
  if (await verifyObject(Activity, json, {
3084
3086
  contextLoader,
@@ -3134,6 +3136,7 @@ var ContextImpl = class ContextImpl {
3134
3136
  }
3135
3137
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
3136
3138
  activity = fetched;
3139
+ json = await fetched.toJsonLd({ contextLoader });
3137
3140
  } else logger.debug("Object Integrity Proofs are verified.", {
3138
3141
  recipient,
3139
3142
  activity: json
@@ -1,4 +1,4 @@
1
1
  const { Temporal } = require("@js-temporal/polyfill");
2
2
  const { URLPattern } = require("urlpattern-polyfill");
3
- const require_middleware = require("./middleware-XXuSt_6b.cjs");
3
+ const require_middleware = require("./middleware-Bla8jBXk.cjs");
4
4
  exports.FederationImpl = require_middleware.FederationImpl;
@@ -2,10 +2,10 @@ import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { t as __exportAll } from "./chunk-CRNNMoPX.js";
4
4
  import { r as getDefaultActivityTransformers } from "./transformers-BGMIq1cs.js";
5
- import { a as verifyRequestDetailed, d as importJwk, f as validateCryptoKey, i as verifyRequest, m as formatAcceptSignature, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, v as name, y as version } from "./http-CdJ6n4rA.js";
5
+ import { a as verifyRequestDetailed, d as importJwk, f as validateCryptoKey, i as verifyRequest, m as formatAcceptSignature, n as parseRfc9421SignatureInput, o as exportJwk, t as doubleKnock, v as name, y as version } from "./http-DQVY5EMT.js";
6
6
  import { a as MAX_BODY_SIZE, i as BodyTooLargeError, n as getNodeInfo, o as readBoundedText, t as nodeInfoToJson } from "./types-miAYfiGO.js";
7
- import { _ as signJsonLd, a as doesActorOwnKey, c as assertSafeJsonLd, f as detachSignature, g as isInvalidUrlTypeError, h as isClearlyMalformedContextReference, m as hasSignature, n as signObject, o as getKeyOwner, p as getNormalizationContextLoader, r as verifyObject, s as InvalidContextReferenceError, u as compactJsonLd, v as verifyCompactJsonLd, x as wrapContextLoaderForJsonLd } from "./proof-Dsa_ZC-M.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-Dx3QwNBI.js";
7
+ import { _ as signJsonLd, a as doesActorOwnKey, c as assertSafeJsonLd, f as detachSignature, g as isInvalidUrlTypeError, h as isClearlyMalformedContextReference, m as hasSignature, n as signObject, o as getKeyOwner, p as getNormalizationContextLoader, r as verifyObject, s as InvalidContextReferenceError, u as compactJsonLd, v as verifyCompactJsonLd, x as wrapContextLoaderForJsonLd } from "./proof-uEay4EIq.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-cTsPZ49Z.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
11
11
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -327,6 +327,7 @@ var FederationBuilderImpl = class {
327
327
  * Symbol registry for unique identification of unnamed symbols.
328
328
  */
329
329
  #symbolRegistry = /* @__PURE__ */ new Map();
330
+ #collectionNames = /* @__PURE__ */ new Map();
330
331
  constructor() {
331
332
  this.router = new Router$1();
332
333
  this.objectCallbacks = {};
@@ -348,6 +349,8 @@ var FederationBuilderImpl = class {
348
349
  f.objectTypeIds = { ...this.objectTypeIds };
349
350
  f.collectionCallbacks = { ...this.collectionCallbacks };
350
351
  f.collectionTypeIds = { ...this.collectionTypeIds };
352
+ f.#symbolRegistry = new Map(this.#symbolRegistry);
353
+ f.#collectionNames = new Map(this.#collectionNames);
351
354
  f.inboxPath = this.inboxPath;
352
355
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
353
356
  f.outboxCallbacks = this.outboxCallbacks == null ? void 0 : { ...this.outboxCallbacks };
@@ -760,6 +763,7 @@ var FederationBuilderImpl = class {
760
763
  if (this.router.has(routeName)) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
761
764
  if (this.collectionCallbacks[name] != null) throw new RouterError(`Collection dispatcher for ${strName} already set.`);
762
765
  if (this.router.add(path, routeName).size < 1) throw new RouterError("Path for collection dispatcher must have at least one variable.");
766
+ this.#collectionNames.set(routeName, name);
763
767
  const callbacks = { dispatcher };
764
768
  this.collectionCallbacks[name] = callbacks;
765
769
  this.collectionTypeIds[name] = itemType;
@@ -796,6 +800,10 @@ var FederationBuilderImpl = class {
796
800
  const routeName = this.#uniqueCollectionId(name);
797
801
  return this.router.build(`collection:${routeName}`, values) ?? this.router.build(`orderedCollection:${routeName}`, values);
798
802
  }
803
+ /** Resolves a custom collection route to its original name. */
804
+ getCollectionName(routeName) {
805
+ return this.#collectionNames.get(routeName) ?? routeName.replace(/^(collection|orderedCollection):/, "");
806
+ }
799
807
  setOutboxPermanentFailureHandler(handler) {
800
808
  this.outboxPermanentFailureHandler = handler;
801
809
  }
@@ -934,8 +942,15 @@ var KvKeyCache = class {
934
942
  })
935
943
  };
936
944
  else if ("errorName" in cached && typeof cached.errorName === "string" && "errorMessage" in cached && typeof cached.errorMessage === "string") {
937
- const error = new Error(cached.errorMessage);
945
+ let error;
946
+ if ("errorType" in cached && cached.errorType === "FetchError" && "errorUrl" in cached && typeof cached.errorUrl === "string" && URL.canParse(cached.errorUrl)) {
947
+ error = new FetchError(cached.errorUrl);
948
+ error.message = cached.errorMessage;
949
+ } else if ("errorType" in cached && cached.errorType === "UrlError" && "errorReason" in cached && (cached.errorReason === "dns" || cached.errorReason === "disallowed")) error = new UrlError(cached.errorMessage, { reason: cached.errorReason });
950
+ else error = new Error(cached.errorMessage);
938
951
  error.name = cached.errorName;
952
+ if ("errorCause" in cached && cached.errorCause != null && typeof cached.errorCause === "object" && "name" in cached.errorCause && typeof cached.errorCause.name === "string" && "message" in cached.errorCause && typeof cached.errorCause.message === "string") if ("isDomException" in cached.errorCause && cached.errorCause.isDomException === true) error.cause = new DOMException(cached.errorCause.message, cached.errorCause.name);
953
+ else error.cause = Object.assign(new Error(cached.errorCause.message), { name: cached.errorCause.name });
939
954
  return { error };
940
955
  }
941
956
  }
@@ -953,9 +968,22 @@ var KvKeyCache = class {
953
968
  }, { ttl: this.unavailableKeyTtl });
954
969
  return;
955
970
  }
971
+ const cause = error.error.cause;
956
972
  await this.kv.set(this.#getFetchErrorKey(keyId), {
957
973
  errorName: error.error.name,
958
- errorMessage: error.error.message
974
+ errorMessage: error.error.message,
975
+ ...error.error instanceof FetchError ? {
976
+ errorType: "FetchError",
977
+ errorUrl: error.error.url.href
978
+ } : error.error instanceof UrlError ? {
979
+ errorType: "UrlError",
980
+ errorReason: error.error.reason
981
+ } : {},
982
+ ...cause instanceof Error || cause instanceof DOMException ? { errorCause: {
983
+ name: cause.name,
984
+ message: cause.message,
985
+ isDomException: cause instanceof DOMException
986
+ } } : {}
959
987
  }, { ttl: this.unavailableKeyTtl });
960
988
  }
961
989
  };
@@ -3812,10 +3840,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3812
3840
  onNotFound
3813
3841
  });
3814
3842
  case "collection": {
3815
- const name = route.name.replace(/^collection:/, "");
3843
+ const name = this.getCollectionName(route.name);
3816
3844
  const callbacks = this.collectionCallbacks[name];
3817
3845
  return await handleCustomCollection(request, {
3818
- name,
3846
+ name: String(name),
3819
3847
  context,
3820
3848
  values: route.values,
3821
3849
  collectionCallbacks: callbacks,
@@ -3825,10 +3853,10 @@ var FederationImpl = class extends FederationBuilderImpl {
3825
3853
  });
3826
3854
  }
3827
3855
  case "orderedCollection": {
3828
- const name = route.name.replace(/^orderedCollection:/, "");
3856
+ const name = this.getCollectionName(route.name);
3829
3857
  const callbacks = this.collectionCallbacks[name];
3830
3858
  return await handleOrderedCollection(request, {
3831
- name,
3859
+ name: String(name),
3832
3860
  context,
3833
3861
  values: route.values,
3834
3862
  collectionCallbacks: callbacks,
@@ -4011,8 +4039,10 @@ var ContextImpl = class ContextImpl {
4011
4039
  const collectionRegex = new RegExp(`^(${["collection", "orderedCollection"].join("|")}):(.*)$`);
4012
4040
  const match = route.name.match(collectionRegex);
4013
4041
  if (match !== null) {
4014
- const [, type, name] = match;
4042
+ const [, type] = match;
4043
+ const name = this.federation.getCollectionName(route.name);
4015
4044
  const cls = this.federation.collectionTypeIds[name];
4045
+ if (cls == null) return null;
4016
4046
  return {
4017
4047
  type,
4018
4048
  name,
@@ -4359,7 +4389,7 @@ var ContextImpl = class ContextImpl {
4359
4389
  "inbox"
4360
4390
  ]);
4361
4391
  const contextLoader = options.contextLoader ?? this.contextLoader;
4362
- const json = await activity.toJsonLd({ contextLoader });
4392
+ let json = await activity.toJsonLd({ contextLoader });
4363
4393
  const keyCache = new KvKeyCache(this.federation.kv, this.federation.kvPrefixes.publicKey, this);
4364
4394
  if (await verifyObject(Activity, json, {
4365
4395
  contextLoader,
@@ -4415,6 +4445,7 @@ var ContextImpl = class ContextImpl {
4415
4445
  }
4416
4446
  logger.debug("Successfully fetched the remote activity object {activityId}; ignore the original activity and use the fetched one, which is trustworthy.");
4417
4447
  activity = fetched;
4448
+ json = await fetched.toJsonLd({ contextLoader });
4418
4449
  } else logger.debug("Object Integrity Proofs are verified.", {
4419
4450
  recipient,
4420
4451
  activity: json
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-D4s0Wk3N.cjs";
2
+ import { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-BNwv9Q1v.cjs";
3
3
  import { Span, Tracer } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/federation/webfinger.d.ts
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-BgU5UWTx.js";
2
+ import { Q as ActorHandleMapper, X as ActorAliasMapper, Z as ActorDispatcher, _t as WebFingerLinksDispatcher, s as RequestContext } from "./context-DLLaDau8.js";
3
3
  import { Span, Tracer } from "@opentelemetry/api";
4
4
 
5
5
  //#region src/federation/webfinger.d.ts
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-DqZhyEso.cjs";
3
- import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
3
+ import { n as KvStore, t as KvKey } from "./kv-CZKl1IUS.cjs";
4
4
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
5
5
  import { TracerProvider } from "@opentelemetry/api";
6
6
 
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-Dl00HXr4.js";
3
- import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
3
+ import { n as KvStore, t as KvKey } from "./kv-CxaI4eGo.js";
4
4
  import { TracerProvider } from "@opentelemetry/api";
5
5
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
6
6
 
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-BJEMpnnY.cjs");
8
- const require_middleware = require("./middleware-XXuSt_6b.cjs");
7
+ const require_http = require("./http-CsQRvInz.cjs");
8
+ const require_middleware = require("./middleware-Bla8jBXk.cjs");
9
9
  const require_types = require("./types-DRPjmHVV.cjs");
10
- const require_proof = require("./proof-DzFzyfIc.cjs");
11
- const require_kv_cache = require("./kv-cache-BDp2c_QE.cjs");
10
+ const require_proof = require("./proof-JfqNWc2E.cjs");
11
+ const require_kv_cache = require("./kv-cache-FfmHQljR.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,12 +2,12 @@
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-DqZhyEso.cjs";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-B3hNQCG8.cjs";
5
- import { $ as ActorKeyPairsDispatcher, A as createFederation, B as RouterRouteResult, C as InboxChallengePolicy, Ct as ActivityTransformer, D as FederationKvPrefixes, E as Rfc6570Expression, F as Message, G as InProcessMessageQueueOptions, H as respondWithObject, I as createFederationBuilder, J as MessageQueueListenOptions, K as MessageQueue, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as ActorHandleMapper, R as RouterError, S as IdempotencyStrategy, St as digest, T as ObjectCallbackSetters, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as InProcessMessageQueue, X as ActorAliasMapper, Y as ParallelMessageQueue, Z as ActorDispatcher, _ as FederationBuilder, _t as WebFingerLinksDispatcher, a as InboxContext, at as CustomCollectionCursor, b as FederationStartQueueOptions, bt as PageItems, c as RouteActivityOptions, ct as InboxListener, d as ActorCallbackSetters, dt as ObjectDispatcher, et as AuthorizePredicate, f as CollectionCallbackSetters, ft as OutboxErrorHandler, g as Federation, gt as UnverifiedActivityReason, h as Federatable, ht as UnverifiedActivityHandler, i as GetSignedKeyOptions, it as CustomCollectionCounter, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as NodeInfoDispatcher, m as CustomCollectionCallbackSetters, mt as SharedInboxKeyDispatcher, n as Context, nt as CollectionCursor, o as ParseUriResult, ot as CustomCollectionDispatcher, p as ConstructorWithTypeId, pt as OutboxPermanentFailureHandler, q as MessageQueueEnqueueOptions, r as ForwardActivityOptions, rt as CollectionDispatcher, s as RequestContext, st as InboxErrorHandler, t as ActorKeyPair, tt as CollectionCounter, u as SendActivityOptionsForCollection, ut as ObjectAuthorizePredicate, v as FederationFetchOptions, vt as SendActivityError, w as InboxListenerSetters, x as IdempotencyKeyCallback, xt as buildCollectionSynchronizationHeader, y as FederationOptions, yt as SenderKeyPair, z as RouterOptions } from "./context-D4s0Wk3N.cjs";
6
- import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
5
+ import { $ as ActorKeyPairsDispatcher, A as createFederation, B as RouterRouteResult, C as InboxChallengePolicy, Ct as ActivityTransformer, D as FederationKvPrefixes, E as Rfc6570Expression, F as Message, G as InProcessMessageQueueOptions, H as respondWithObject, I as createFederationBuilder, J as MessageQueueListenOptions, K as MessageQueue, L as Router, M as RetryContext, N as RetryPolicy, O as FederationOrigin, P as createExponentialBackoffPolicy, Q as ActorHandleMapper, R as RouterError, S as IdempotencyStrategy, St as digest, T as ObjectCallbackSetters, U as respondWithObjectIfAcceptable, V as RespondWithObjectOptions, W as InProcessMessageQueue, X as ActorAliasMapper, Y as ParallelMessageQueue, Z as ActorDispatcher, _ as FederationBuilder, _t as WebFingerLinksDispatcher, a as InboxContext, at as CustomCollectionCursor, b as FederationStartQueueOptions, bt as PageItems, c as RouteActivityOptions, ct as InboxListener, d as ActorCallbackSetters, dt as ObjectDispatcher, et as AuthorizePredicate, f as CollectionCallbackSetters, ft as OutboxErrorHandler, g as Federation, gt as UnverifiedActivityReason, h as Federatable, ht as UnverifiedActivityHandler, i as GetSignedKeyOptions, it as CustomCollectionCounter, j as CreateExponentialBackoffPolicyOptions, k as FederationQueueOptions, l as SendActivityOptions, lt as NodeInfoDispatcher, m as CustomCollectionCallbackSetters, mt as SharedInboxKeyDispatcher, n as Context, nt as CollectionCursor, o as ParseUriResult, ot as CustomCollectionDispatcher, p as ConstructorWithTypeId, pt as OutboxPermanentFailureHandler, q as MessageQueueEnqueueOptions, r as ForwardActivityOptions, rt as CollectionDispatcher, s as RequestContext, st as InboxErrorHandler, t as ActorKeyPair, tt as CollectionCounter, u as SendActivityOptionsForCollection, ut as ObjectAuthorizePredicate, v as FederationFetchOptions, vt as SendActivityError, w as InboxListenerSetters, x as IdempotencyKeyCallback, xt as buildCollectionSynchronizationHeader, y as FederationOptions, yt as SenderKeyPair, z as RouterOptions } from "./context-BNwv9Q1v.cjs";
6
+ import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-CZKl1IUS.cjs";
7
7
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-Bx80LUTA.cjs";
8
+ import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-BmlfRBmU.cjs";
9
9
  import { _ as verifyJsonLd, a as createProof, c as verifyProof, d as VerifyJsonLdOptions, f as VerifySignatureOptions, g as signJsonLd, h as detachSignature, i as VerifyProofOptions, l as CreateSignatureOptions, m as createSignature, n as SignObjectOptions, o as signObject, p as attachSignature, r as VerifyObjectOptions, s as verifyObject, t as CreateProofOptions, u as SignJsonLdOptions, v as verifySignature } from "./mod-DiuFTYUt.cjs";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DkE98l_7.cjs";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-Cn9GJ5ex.cjs";
11
11
  export * from "@fedify/vocab-runtime";
12
12
 
13
13
  //#region src/mod.d.ts