@fedify/fedify 2.0.0-dev.1690 → 2.0.0-dev.1736

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 (193) hide show
  1. package/dist/{actor-DuCeRiNh.js → actor-BLq4KEGR.js} +1 -1
  2. package/dist/{actor-Be0ThtXy.cjs → actor-C3oFUgfc.cjs} +921 -1451
  3. package/dist/{actor-T6RyhRgk.d.ts → actor-DqFajh9s.d.ts} +2 -2
  4. package/dist/{actor-ChbPLm6n.js → actor-btAA7QSA.js} +189 -677
  5. package/dist/{actor-D6K058Tb.d.cts → actor-f2NtjyCg.d.cts} +2 -2
  6. package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
  7. package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
  8. package/dist/{builder-CYOcDUkj.js → builder-C4gbKvM5.js} +7 -8
  9. package/dist/{client-CegPX0Rn.d.cts → client-94iWEfQa.d.cts} +1 -1
  10. package/dist/{client-bgSdkFa2.d.ts → client-BsGzbnV-.d.ts} +1 -1
  11. package/dist/{client-CnOdwLLN.js → client-pY7-3icS.js} +1 -1
  12. package/dist/compat/mod.d.cts +11 -12
  13. package/dist/compat/mod.d.ts +11 -12
  14. package/dist/compat/transformers.test.js +20 -20
  15. package/dist/{context-C5BsZkDr.d.cts → context-BvYz3eOb.d.cts} +130 -103
  16. package/dist/{context-ByZprN0S.d.ts → context-myrGWbL_.d.ts} +130 -103
  17. package/dist/{authdocloader-Brax1A32.js → docloader-DtYIz2Pb.js} +17 -8
  18. package/dist/{esm-DnIzfEj0.js → esm-CQ9nlHuI.js} +11 -11
  19. package/dist/federation/builder.test.js +8 -10
  20. package/dist/federation/collection.test.js +7 -9
  21. package/dist/federation/handler.test.js +25 -26
  22. package/dist/federation/idempotency.test.js +25 -26
  23. package/dist/federation/inbox.test.js +4 -6
  24. package/dist/federation/keycache.test.js +3 -4
  25. package/dist/federation/kv.test.js +6 -8
  26. package/dist/federation/middleware.test.js +32 -33
  27. package/dist/federation/mod.cjs +9 -11
  28. package/dist/federation/mod.d.cts +12 -13
  29. package/dist/federation/mod.d.ts +12 -13
  30. package/dist/federation/mod.js +9 -11
  31. package/dist/federation/mq.test.js +8 -10
  32. package/dist/federation/negotiation.test.js +7 -9
  33. package/dist/federation/retry.test.js +4 -5
  34. package/dist/federation/router.test.js +6 -8
  35. package/dist/federation/send.test.js +13 -15
  36. package/dist/{http-BNOYnVsU.js → http-B9npZ3Md.js} +2 -2
  37. package/dist/{http-D6Uj2x2y.d.ts → http-BbO0ejuk.d.ts} +2 -2
  38. package/dist/{http-BxbM8sEy.js → http-D7qwMpca.js} +256 -6
  39. package/dist/{http-D-e6AFwR.d.cts → http-M8k5mKc0.d.cts} +2 -2
  40. package/dist/{http-C7vbQwbz.cjs → http-ngJvMHez.cjs} +289 -9
  41. package/dist/{inbox-BRru9pX3.js → inbox-CY8fblhz.js} +1 -1
  42. package/dist/{key-1KXru8Ug.js → key-CgKiloJr.js} +3 -2
  43. package/dist/{keycache-CN61iGVj.js → keycache-B6O-bhMs.js} +1 -1
  44. package/dist/{keys-BPdFKgiy.js → keys-B3O7b5eB.js} +2 -1
  45. package/dist/kv-cache-BrjWZnGU.cjs +133 -0
  46. package/dist/kv-cache-DkW_lqUw.js +121 -0
  47. package/dist/kv-cache-z0lgwFi_.js +93 -0
  48. package/dist/{ld-Dv8DNNAT.js → ld-B7TO6JH2.js} +3 -2
  49. package/dist/lookup-Cc3ZAAis.cjs +273 -0
  50. package/dist/{type-C69ZBu7f.js → lookup-NXjB7xUj.js} +503 -5327
  51. package/dist/lookup-fEH6e7ZX.js +261 -0
  52. package/dist/{middleware-DY9B2lL8.js → middleware-BMPvaTpX.js} +44 -48
  53. package/dist/{middleware-BmoOlgc1.cjs → middleware-C8w5YYxK.cjs} +60 -66
  54. package/dist/middleware-D8ENcqxG.js +26 -0
  55. package/dist/{middleware-Bz_A2jeJ.js → middleware-D_VyRsDx.js} +40 -46
  56. package/dist/middleware-Yk-MuxWc.js +15 -0
  57. package/dist/middleware-glwCut0b.cjs +15 -0
  58. package/dist/{mod-BhUKmBJD.d.ts → mod-B2iOw50L.d.ts} +3 -3
  59. package/dist/mod-BYynOiJG.d.ts +109 -0
  60. package/dist/{mod-DlU8ISoa.d.ts → mod-BlVovdcy.d.ts} +2 -2
  61. package/dist/{mod-CxkWO3Mg.d.cts → mod-BxRCHTz-.d.cts} +2 -2
  62. package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
  63. package/dist/{mod-8DMWKtQE.d.cts → mod-DbFNTF7m.d.cts} +2 -2
  64. package/dist/{mod-Djzcw2ry.d.cts → mod-DgdBYYa0.d.cts} +3 -3
  65. package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
  66. package/dist/mod-VastcQsk.d.cts +107 -0
  67. package/dist/{mod-D6hQoxC5.d.ts → mod-k0Dk3fGk.d.ts} +2 -2
  68. package/dist/mod.cjs +19 -32
  69. package/dist/mod.d.cts +15 -16
  70. package/dist/mod.d.ts +16 -17
  71. package/dist/mod.js +14 -16
  72. package/dist/nodeinfo/client.test.js +8 -10
  73. package/dist/nodeinfo/handler.test.js +24 -25
  74. package/dist/nodeinfo/mod.cjs +2 -3
  75. package/dist/nodeinfo/mod.d.cts +2 -4
  76. package/dist/nodeinfo/mod.d.ts +2 -4
  77. package/dist/nodeinfo/mod.js +2 -3
  78. package/dist/nodeinfo/types.test.js +7 -9
  79. package/dist/{owner-BN_tO3cY.d.cts → owner-B4HbyP8s.d.cts} +3 -3
  80. package/dist/{owner-e3FYDhsk.js → owner-CSktF-2s.js} +3 -2
  81. package/dist/{owner-hd9lvQcP.d.ts → owner-kQRGVXG1.d.ts} +3 -3
  82. package/dist/{proof-DfgvA3al.js → proof-BT65yR1Q.js} +5 -4
  83. package/dist/{proof-6gFMwMNJ.js → proof-Cs5Mcy_U.js} +2 -2
  84. package/dist/{proof-B-eqv0Ug.cjs → proof-feEDocLH.cjs} +17 -16
  85. package/dist/{send-Tl9NOnmO.js → send-vPZ03xUr.js} +2 -2
  86. package/dist/sig/http.test.js +12 -13
  87. package/dist/sig/key.test.js +9 -11
  88. package/dist/sig/ld.test.js +8 -10
  89. package/dist/sig/mod.cjs +9 -11
  90. package/dist/sig/mod.d.cts +5 -7
  91. package/dist/sig/mod.d.ts +5 -7
  92. package/dist/sig/mod.js +5 -7
  93. package/dist/sig/owner.test.js +10 -12
  94. package/dist/sig/proof.test.js +13 -14
  95. package/dist/testing/docloader.test.js +6 -8
  96. package/dist/testing/mod.d.ts +120 -172
  97. package/dist/testing/mod.js +2 -3
  98. package/dist/{testing-BWNCAbL-.js → testing-u2cUPQLp.js} +1 -2
  99. package/dist/{types-DqxyTxOf.js → types-BtUjyi5y.js} +1 -1
  100. package/dist/{types-zqdWZh4O.cjs → types-CWgzGaqk.cjs} +3 -3
  101. package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
  102. package/dist/utils/kv-cache.test.js +209 -0
  103. package/dist/utils/mod.cjs +12 -0
  104. package/dist/utils/mod.d.cts +5 -0
  105. package/dist/utils/mod.d.ts +7 -0
  106. package/dist/utils/mod.js +11 -0
  107. package/dist/vocab/actor.test.js +8 -10
  108. package/dist/vocab/lookup.test.js +7 -9
  109. package/dist/vocab/mod.cjs +3 -4
  110. package/dist/vocab/mod.d.cts +3 -5
  111. package/dist/vocab/mod.d.ts +3 -5
  112. package/dist/vocab/mod.js +3 -4
  113. package/dist/vocab/type.test.js +2 -3
  114. package/dist/vocab/vocab.test.js +9 -10
  115. package/dist/{vocab-BI0Ak5lL.d.ts → vocab-BCWe1Ih5.d.ts} +2 -21
  116. package/dist/{vocab-Dw1-yVGg.d.cts → vocab-CeDBzu-f.d.cts} +2 -21
  117. package/dist/{vocab-B39-pFl9.cjs → vocab-NvDV-exu.cjs} +5 -5
  118. package/dist/{vocab-BWoeZsME.js → vocab-wADjlIH4.js} +3 -3
  119. package/dist/webfinger/handler.test.js +24 -25
  120. package/dist/webfinger/lookup.test.js +7 -9
  121. package/dist/webfinger/mod.cjs +2 -3
  122. package/dist/webfinger/mod.d.cts +1 -3
  123. package/dist/webfinger/mod.d.ts +1 -3
  124. package/dist/webfinger/mod.js +2 -3
  125. package/dist/x/cfworkers.d.cts +2 -2
  126. package/dist/x/cfworkers.d.ts +2 -2
  127. package/dist/x/cfworkers.test.js +6 -8
  128. package/dist/x/hono.d.cts +10 -11
  129. package/dist/x/hono.d.ts +10 -11
  130. package/dist/x/sveltekit.d.cts +10 -11
  131. package/dist/x/sveltekit.d.ts +10 -11
  132. package/package.json +15 -14
  133. package/dist/assert_throws-BOO88avQ.js +0 -39
  134. package/dist/authdocloader-CrxhFL8e.js +0 -52
  135. package/dist/authdocloader-OSn_teLV.cjs +0 -58
  136. package/dist/docloader-CCqXeagZ.cjs +0 -4861
  137. package/dist/docloader-CxWcuWqQ.d.ts +0 -221
  138. package/dist/docloader-D-MrRyHl.d.cts +0 -219
  139. package/dist/docloader-XK3y2jn5.js +0 -4795
  140. package/dist/key-B3uag-rz.js +0 -10
  141. package/dist/key-BiBmb1Yy.cjs +0 -10
  142. package/dist/key-DK_nfU4I.js +0 -10
  143. package/dist/key-Z6ceKnZC.cjs +0 -290
  144. package/dist/key-jyNTxCvK.js +0 -260
  145. package/dist/lookup-BPviO8ij.js +0 -131
  146. package/dist/lookup-hnMAAU5r.cjs +0 -137
  147. package/dist/lookup-pV0JOsuV.js +0 -331
  148. package/dist/middleware-CI0-zw4U.js +0 -26
  149. package/dist/middleware-QNK-W-jE.cjs +0 -17
  150. package/dist/middleware-_vjt6FWU.js +0 -17
  151. package/dist/mod-CerN_Sza.d.ts +0 -104
  152. package/dist/mod-Cj1tHXBR.d.cts +0 -102
  153. package/dist/runtime/docloader.test.js +0 -522
  154. package/dist/runtime/key.test.d.ts +0 -3
  155. package/dist/runtime/key.test.js +0 -103
  156. package/dist/runtime/langstr.test.d.ts +0 -3
  157. package/dist/runtime/langstr.test.js +0 -39
  158. package/dist/runtime/link.test.d.ts +0 -3
  159. package/dist/runtime/link.test.js +0 -61
  160. package/dist/runtime/mod.cjs +0 -25
  161. package/dist/runtime/mod.d.cts +0 -6
  162. package/dist/runtime/mod.d.ts +0 -8
  163. package/dist/runtime/mod.js +0 -13
  164. package/dist/runtime/multibase/multibase.test.d.ts +0 -3
  165. package/dist/runtime/multibase/multibase.test.js +0 -358
  166. package/dist/runtime/url.test.d.ts +0 -3
  167. package/dist/runtime/url.test.js +0 -45
  168. /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
  169. /package/dist/{collection-CcnIw1qY.js → collection-BzWsN9pB.js} +0 -0
  170. /package/dist/{denokv-Bv33Xxea.js → denokv-CCssOzMJ.js} +0 -0
  171. /package/dist/{federation-H2_En3j5.cjs → federation-CRpdnOMS.cjs} +0 -0
  172. /package/dist/{federation-D1U8YY9t.js → federation-jcR8-ZxP.js} +0 -0
  173. /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
  174. /package/dist/{kv-63Cil1MD.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
  175. /package/dist/{mod-FZd39qVq.d.cts → mod-B-hUPT2N.d.cts} +0 -0
  176. /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
  177. /package/dist/{mod-g0xFzAP9.d.ts → mod-xIj-IT58.d.ts} +0 -0
  178. /package/dist/{mq-CRGm1e_F.d.ts → mq-CUKlBw08.d.ts} +0 -0
  179. /package/dist/{mq-B7R1Q-M5.d.cts → mq-DcJPkXD5.d.cts} +0 -0
  180. /package/dist/{negotiation-5NPJL6zp.js → negotiation-C4nFufNk.js} +0 -0
  181. /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BnthBobC.js} +0 -0
  182. /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
  183. /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
  184. /package/dist/{runtime-DPYEDf-o.js → sig-C34-oHBl.js} +0 -0
  185. /package/dist/{runtime-C58AJWSv.cjs → sig-YYj5tCnr.cjs} +0 -0
  186. /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
  187. /package/dist/{types-BSuWJsOm.js → types-C2XVl6gj.js} +0 -0
  188. /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
  189. /package/dist/{runtime/authdocloader.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
  190. /package/dist/{sig-Cj3tk-ig.js → utils-D-Va7aXC.js} +0 -0
  191. /package/dist/{sig-ByHXzqUi.cjs → utils-DyRU1gdZ.cjs} +0 -0
  192. /package/dist/{webfinger-De_bU0iE.js → webfinger-C72Y8lrh.js} +0 -0
  193. /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-vAtLmxOF.cjs} +0 -0
@@ -4,21 +4,20 @@
4
4
 
5
5
  const require_chunk = require('./chunk-DqRYRqnO.cjs');
6
6
  const require_transformers = require('./transformers-CoBS-oFG.cjs');
7
- const require_docloader = require('./docloader-CCqXeagZ.cjs');
8
- const require_actor = require('./actor-Be0ThtXy.cjs');
9
- const require_lookup = require('./lookup-hnMAAU5r.cjs');
10
- const require_key = require('./key-Z6ceKnZC.cjs');
11
- const require_http = require('./http-C7vbQwbz.cjs');
12
- const require_proof = require('./proof-B-eqv0Ug.cjs');
13
- const require_types = require('./types-zqdWZh4O.cjs');
14
- const require_authdocloader = require('./authdocloader-OSn_teLV.cjs');
15
- const require_vocab = require('./vocab-B39-pFl9.cjs');
7
+ const require_lookup = require('./lookup-Cc3ZAAis.cjs');
8
+ const require_actor = require('./actor-C3oFUgfc.cjs');
9
+ const require_http = require('./http-ngJvMHez.cjs');
10
+ const require_proof = require('./proof-feEDocLH.cjs');
11
+ const require_types = require('./types-CWgzGaqk.cjs');
12
+ const require_kv_cache = require('./kv-cache-BrjWZnGU.cjs');
13
+ const require_vocab = require('./vocab-NvDV-exu.cjs');
16
14
  const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
17
15
  const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
18
- const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
16
+ const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
19
17
  const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
20
18
  const uri_template_router = require_chunk.__toESM(require("uri-template-router"));
21
19
  const url_template = require_chunk.__toESM(require("url-template"));
20
+ const byte_encodings_hex = require_chunk.__toESM(require("byte-encodings/hex"));
22
21
  const __opentelemetry_semantic_conventions = require_chunk.__toESM(require("@opentelemetry/semantic-conventions"));
23
22
  const node_url = require_chunk.__toESM(require("node:url"));
24
23
 
@@ -143,7 +142,7 @@ async function routeActivity({ context: ctx, json, activity, recipient, inboxLis
143
142
  return "enqueued";
144
143
  }
145
144
  tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
146
- const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
145
+ const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
147
146
  return await tracer.startActiveSpan("activitypub.dispatch_inbox_listener", { kind: __opentelemetry_api.SpanKind.INTERNAL }, async (span$1) => {
148
147
  const dispatched = inboxListeners?.dispatchWithClass(activity);
149
148
  if (dispatched == null) {
@@ -340,7 +339,7 @@ var FederationBuilderImpl = class {
340
339
  this.collectionTypeIds = {};
341
340
  }
342
341
  async build(options) {
343
- const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-QNK-W-jE.cjs"));
342
+ const { FederationImpl: FederationImpl$1 } = await Promise.resolve().then(() => require("./middleware-glwCut0b.cjs"));
344
343
  const f = new FederationImpl$1(options);
345
344
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
346
345
  f.router = this.router.clone();
@@ -366,7 +365,7 @@ var FederationBuilderImpl = class {
366
365
  return f;
367
366
  }
368
367
  _getTracer() {
369
- return __opentelemetry_api.trace.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
368
+ return __opentelemetry_api.trace.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
370
369
  }
371
370
  setActorDispatcher(path, dispatcher) {
372
371
  if (this.router.has("actor")) throw new RouterError("Actor dispatcher already set.");
@@ -793,11 +792,11 @@ var FederationBuilderImpl = class {
793
792
  };
794
793
  return setters;
795
794
  }
796
- setCollectionDispatcher(name, ...args) {
797
- return this.#setCustomCollectionDispatcher(name, "collection", ...args);
795
+ setCollectionDispatcher(name, itemType, path, dispatcher) {
796
+ return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
798
797
  }
799
- setOrderedCollectionDispatcher(name, ...args) {
800
- return this.#setCustomCollectionDispatcher(name, "orderedCollection", ...args);
798
+ setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
799
+ return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
801
800
  }
802
801
  #setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
803
802
  const strName = String(name);
@@ -1113,7 +1112,7 @@ async function handleObject(request, { values, context: context$2, objectDispatc
1113
1112
  async function handleCollection(request, { name, identifier, uriGetter, filter, filterPredicate, context: context$2, collectionCallbacks, tracerProvider, onUnauthorized, onNotFound }) {
1114
1113
  const spanName = name.trim().replace(/\s+/g, "_");
1115
1114
  tracerProvider = tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
1116
- const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
1115
+ const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
1117
1116
  const url = new URL(request.url);
1118
1117
  const cursor = url.searchParams.get("cursor");
1119
1118
  if (collectionCallbacks == null) return await onNotFound(request);
@@ -1290,7 +1289,7 @@ function filterCollectionItems(items, collectionName, filterPredicate) {
1290
1289
  */
1291
1290
  async function handleInbox(request, options) {
1292
1291
  const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
1293
- const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
1292
+ const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
1294
1293
  return await tracer.startActiveSpan("activitypub.inbox", {
1295
1294
  kind: options.queue == null ? __opentelemetry_api.SpanKind.SERVER : __opentelemetry_api.SpanKind.PRODUCER,
1296
1295
  attributes: { "activitypub.shared_inbox": options.recipient == null }
@@ -1551,7 +1550,7 @@ async function handleInboxInternal(request, parameters, span) {
1551
1550
  /**
1552
1551
  * Handles a custom collection request.
1553
1552
  * @template TItem The type of items in the collection.
1554
- * @template TParams The parameter names of the requested URL.
1553
+ * @template TParam The parameter names of the requested URL.
1555
1554
  * @template TContext The type of the context, extending {@link RequestContext}.
1556
1555
  * @template TContextData The context data to pass to the `TContext`.
1557
1556
  * @param request The HTTP request.
@@ -1569,7 +1568,7 @@ async function _handleCustomCollection(request, { name, values, context: context
1569
1568
  /**
1570
1569
  * Handles an ordered collection request.
1571
1570
  * @template TItem The type of items in the collection.
1572
- * @template TParams The parameter names of the requested URL.
1571
+ * @template TParam The parameter names of the requested URL.
1573
1572
  * @template TContext The type of the context, extending {@link RequestContext}.
1574
1573
  * @template TContextData The context data to pass to the `TContext`.
1575
1574
  * @param request The HTTP request.
@@ -1589,7 +1588,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
1589
1588
  * The main flow is on `getCollection`, `dispatch`.
1590
1589
  *
1591
1590
  * @template TItem The type of items in the collection.
1592
- * @template TParams The parameter names of the requested URL.
1591
+ * @template TParam The parameter names of the requested URL.
1593
1592
  * @template TContext The type of the context. {@link Context} or {@link RequestContext}.
1594
1593
  * @template TContextData The context data to pass to the `TContext`.
1595
1594
  * @template TCollection The type of the collection, extending {@link Collection}.
@@ -1623,14 +1622,14 @@ var CustomCollectionHandler = class {
1623
1622
  #collection = null;
1624
1623
  /**
1625
1624
  * Creates a new CustomCollection instance.
1626
- * @param {string} name The name of the collection.
1627
- * @param {TParams} values The parameter values for the collection.
1628
- * @param {TContext} context The request context.
1629
- * @param {CustomCollectionCallbacks} callbacks The collection callbacks.
1630
- * @param {TracerProvider} tracerProvider The tracer provider for telemetry.
1631
- * @param {ConstructorWithTypeId<TCollection>} Collection The Collection constructor.
1632
- * @param {ConstructorWithTypeId<TCollectionPage>} CollectionPage The CollectionPage constructor.
1633
- * @param {(item: TItem) => boolean} filterPredicate Optional filter predicate for items.
1625
+ * @param name The name of the collection.
1626
+ * @param values The parameter values for the collection.
1627
+ * @param context The request context.
1628
+ * @param callbacks The collection callbacks.
1629
+ * @param tracerProvider The tracer provider for telemetry.
1630
+ * @param Collection The Collection constructor.
1631
+ * @param CollectionPage The CollectionPage constructor.
1632
+ * @param filterPredicate Optional filter predicate for items.
1634
1633
  */
1635
1634
  constructor(name, values, context$2, callbacks, tracerProvider = __opentelemetry_api.trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
1636
1635
  this.name = name;
@@ -1642,7 +1641,7 @@ var CustomCollectionHandler = class {
1642
1641
  this.CollectionPage = CollectionPage$1;
1643
1642
  this.filterPredicate = filterPredicate;
1644
1643
  this.name = this.name.trim().replace(/\s+/g, "_");
1645
- this.#tracer = this.tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
1644
+ this.#tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
1646
1645
  this.#id = new URL(this.context.url);
1647
1646
  this.#dispatcher = callbacks.dispatcher.bind(callbacks);
1648
1647
  }
@@ -1755,7 +1754,7 @@ var CustomCollectionHandler = class {
1755
1754
  /**
1756
1755
  * Creates a function to wrap the dispatcher so tracing can be applied.
1757
1756
  * @param params Parameters including cursor and total items.
1758
- * @returns {(span: Span) => Promise<PageItems<TItem>>} A function that handles the span operation.
1757
+ * @returns A function that handles the span operation.
1759
1758
  */
1760
1759
  spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
1761
1760
  try {
@@ -1776,23 +1775,23 @@ var CustomCollectionHandler = class {
1776
1775
  };
1777
1776
  /**
1778
1777
  * Dispatches the collection request to get items.
1779
- * @param {string | null} cursor The cursor for pagination, or null for the first page.
1780
- * @returns {Promise<PageItems<TItem>>} A promise that resolves to the page items.
1778
+ * @param cursor The cursor for pagination, or null for the first page.
1779
+ * @returns A promise that resolves to the page items.
1781
1780
  */
1782
1781
  async dispatch(cursor = null) {
1783
1782
  return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
1784
1783
  }
1785
1784
  /**
1786
1785
  * Filters the items in the collection.
1787
- * @param {TItem[]} items The items to filter.
1788
- * @returns {(Object | Link | URL)[]} The filtered items.
1786
+ * @param items The items to filter.
1787
+ * @returns The filtered items.
1789
1788
  */
1790
1789
  filterItems(items) {
1791
1790
  return filterCollectionItems(items, this.name, this.filterPredicate);
1792
1791
  }
1793
1792
  /**
1794
1793
  * Appends a cursor to the URL if it exists.
1795
- * @param {string | null | undefined} cursor The cursor to append, or null/undefined.
1794
+ * @param cursor The cursor to append, or null/undefined.
1796
1795
  * @returns The URL with cursor appended, or null if cursor is null/undefined.
1797
1796
  */
1798
1797
  appendToUrl(cursor) {
@@ -1800,8 +1799,7 @@ var CustomCollectionHandler = class {
1800
1799
  }
1801
1800
  /**
1802
1801
  * Gets the stored collection or collection page.
1803
- * @returns {Promise<TCollection | TCollectionPage>} A promise that resolves to
1804
- the collection or collection page.
1802
+ * @returns A promise that resolves to the collection or collection page.
1805
1803
  */
1806
1804
  get collection() {
1807
1805
  if (this.#collection === null) this.#collection = this.getCollection();
@@ -1809,8 +1807,8 @@ var CustomCollectionHandler = class {
1809
1807
  }
1810
1808
  /**
1811
1809
  * Gets the total number of items in the collection.
1812
- * @returns {Promise<number | null>} A promise that
1813
- resolves to the total items count, or null if not available.
1810
+ * @returns A promise that resolves to the total items count,
1811
+ * or null if not available.
1814
1812
  */
1815
1813
  get totalItems() {
1816
1814
  if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
@@ -1826,8 +1824,8 @@ var CustomCollectionHandler = class {
1826
1824
  }
1827
1825
  /**
1828
1826
  * Gets the first cursor for pagination.
1829
- * @returns {Promise<string | null>} A promise that resolves to the first cursor,
1830
- or null if not available.
1827
+ * @returns A promise that resolves to the first cursor,
1828
+ * or null if not available.
1831
1829
  */
1832
1830
  get firstCursor() {
1833
1831
  const cursor = this.callbacks.firstCursor?.(this.context, this.values);
@@ -2234,7 +2232,7 @@ function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
2234
2232
  */
2235
2233
  function sendActivity(options) {
2236
2234
  const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
2237
- const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
2235
+ const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
2238
2236
  return tracer.startActiveSpan("activitypub.send_activity", {
2239
2237
  kind: __opentelemetry_api.SpanKind.CLIENT,
2240
2238
  attributes: { "activitypub.shared_inbox": options.sharedInbox ?? false }
@@ -2351,7 +2349,6 @@ var FederationImpl = class extends FederationBuilderImpl {
2351
2349
  firstKnock;
2352
2350
  constructor(options) {
2353
2351
  super();
2354
- const logger$1 = (0, __logtape_logtape.getLogger)(["fedify", "federation"]);
2355
2352
  this.kv = options.kv;
2356
2353
  this.kvPrefixes = {
2357
2354
  activityIdempotence: ["_fedify", "activityIdempotence"],
@@ -2399,14 +2396,15 @@ var FederationImpl = class extends FederationBuilderImpl {
2399
2396
  this.router.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
2400
2397
  this._initializeRouter();
2401
2398
  if (options.allowPrivateAddress || options.userAgent != null) {
2402
- if (options.contextLoader != null) throw new TypeError("Cannot set contextLoader with allowPrivateAddress or userAgent options.");
2403
- else if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
2399
+ if (options.documentLoaderFactory != null) throw new TypeError("Cannot set documentLoaderFactory with allowPrivateAddress or userAgent options.");
2400
+ if (options.contextLoaderFactory != null) throw new TypeError("Cannot set contextLoaderFactory with allowPrivateAddress or userAgent options.");
2401
+ if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
2404
2402
  }
2405
2403
  const { allowPrivateAddress, userAgent } = options;
2406
2404
  this.allowPrivateAddress = allowPrivateAddress ?? false;
2407
2405
  this.documentLoaderFactory = options.documentLoaderFactory ?? ((opts) => {
2408
- return require_docloader.kvCache({
2409
- loader: require_docloader.getDocumentLoader({
2406
+ return require_kv_cache.kvCache({
2407
+ loader: (0, __fedify_vocab_runtime.getDocumentLoader)({
2410
2408
  allowPrivateAddress: opts?.allowPrivateAddress ?? allowPrivateAddress,
2411
2409
  userAgent: opts?.userAgent ?? userAgent
2412
2410
  }),
@@ -2414,12 +2412,8 @@ var FederationImpl = class extends FederationBuilderImpl {
2414
2412
  prefix: this.kvPrefixes.remoteDocument
2415
2413
  });
2416
2414
  });
2417
- if (options.contextLoader != null) {
2418
- if (options.contextLoaderFactory != null) throw new TypeError("Cannot set both contextLoader and contextLoaderFactory options at a time; use contextLoaderFactory only.");
2419
- this.contextLoaderFactory = () => options.contextLoader;
2420
- logger$1.warn("The contextLoader option is deprecated; use contextLoaderFactory option instead.");
2421
- } else this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
2422
- this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => require_authdocloader.getAuthenticatedDocumentLoader(identity, {
2415
+ this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
2416
+ this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => require_kv_cache.getAuthenticatedDocumentLoader(identity, {
2423
2417
  allowPrivateAddress,
2424
2418
  userAgent,
2425
2419
  specDeterminer: new KvSpecDeterminer(this.kv, this.kvPrefixes.httpMessageSignaturesSpec, options.firstKnock),
@@ -2440,7 +2434,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2440
2434
  this.router.add("/.well-known/nodeinfo", "nodeInfoJrd");
2441
2435
  }
2442
2436
  _getTracer() {
2443
- return this.tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
2437
+ return this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
2444
2438
  }
2445
2439
  async _startQueueInternal(ctxData, signal, queue) {
2446
2440
  if (this.inboxQueue == null && this.outboxQueue == null) return;
@@ -2538,7 +2532,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2538
2532
  });
2539
2533
  const keys = await Promise.all(message.keys.map(async ({ keyId, privateKey }) => ({
2540
2534
  keyId: new URL(keyId),
2541
- privateKey: await require_key.importJwk(privateKey, "private")
2535
+ privateKey: await require_http.importJwk(privateKey, "private")
2542
2536
  })));
2543
2537
  const activity = await require_actor.Activity.fromJsonLd(message.activity, {
2544
2538
  contextLoader: this.contextLoaderFactory({
@@ -2579,7 +2573,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2579
2573
  for (const { keyId, privateKey } of message.keys) {
2580
2574
  const pair = {
2581
2575
  keyId: new URL(keyId),
2582
- privateKey: await require_key.importJwk(privateKey, "private")
2576
+ privateKey: await require_http.importJwk(privateKey, "private")
2583
2577
  };
2584
2578
  if (rsaKeyPair == null && pair.privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") rsaKeyPair = pair;
2585
2579
  keys.push(pair);
@@ -2814,7 +2808,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2814
2808
  let proofCreated = false;
2815
2809
  let rsaKey = null;
2816
2810
  for (const { keyId, privateKey } of keys) {
2817
- require_key.validateCryptoKey(privateKey, "private");
2811
+ require_http.validateCryptoKey(privateKey, "private");
2818
2812
  if (rsaKey == null && privateKey.algorithm.name === "RSASSA-PKCS1-v1_5") {
2819
2813
  rsaKey = {
2820
2814
  keyId,
@@ -2882,7 +2876,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2882
2876
  });
2883
2877
  const keyJwkPairs = [];
2884
2878
  for (const { keyId, privateKey } of keys) {
2885
- const privateKeyJwk = await require_key.exportJwk(privateKey);
2879
+ const privateKeyJwk = await require_http.exportJwk(privateKey);
2886
2880
  keyJwkPairs.push({
2887
2881
  keyId: keyId.href,
2888
2882
  privateKey: privateKeyJwk
@@ -3582,7 +3576,7 @@ var ContextImpl = class ContextImpl {
3582
3576
  });
3583
3577
  }
3584
3578
  sendActivity(sender, recipients, activity, options = {}) {
3585
- const tracer = this.tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
3579
+ const tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
3586
3580
  return tracer.startActiveSpan(this.federation.outboxQueue == null || options.immediate ? "activitypub.outbox" : "activitypub.fanout", {
3587
3581
  kind: this.federation.outboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
3588
3582
  attributes: {
@@ -3639,7 +3633,7 @@ var ContextImpl = class ContextImpl {
3639
3633
  keys = sender;
3640
3634
  } else keys = [sender];
3641
3635
  if (keys.length < 1) throw new TypeError("The sender's keys must not be empty.");
3642
- for (const { privateKey } of keys) require_key.validateCryptoKey(privateKey, "private");
3636
+ for (const { privateKey } of keys) require_http.validateCryptoKey(privateKey, "private");
3643
3637
  const opts = { context: this };
3644
3638
  let expandedRecipients;
3645
3639
  if (Array.isArray(recipients)) expandedRecipients = recipients;
@@ -3680,7 +3674,7 @@ var ContextImpl = class ContextImpl {
3680
3674
  }
3681
3675
  const keyJwkPairs = await Promise.all(keys.map(async ({ keyId, privateKey }) => ({
3682
3676
  keyId: keyId.href,
3683
- privateKey: await require_key.exportJwk(privateKey)
3677
+ privateKey: await require_http.exportJwk(privateKey)
3684
3678
  })));
3685
3679
  const carrier = {};
3686
3680
  __opentelemetry_api.propagation.inject(__opentelemetry_api.context.active(), carrier);
@@ -3728,7 +3722,7 @@ var ContextImpl = class ContextImpl {
3728
3722
  }
3729
3723
  routeActivity(recipient, activity, options = {}) {
3730
3724
  const tracerProvider = this.tracerProvider ?? this.tracerProvider;
3731
- const tracer = tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
3725
+ const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
3732
3726
  return tracer.startActiveSpan("activitypub.inbox", {
3733
3727
  kind: this.federation.inboxQueue == null || options.immediate ? __opentelemetry_api.SpanKind.INTERNAL : __opentelemetry_api.SpanKind.PRODUCER,
3734
3728
  attributes: { "activitypub.activity.type": require_actor.getTypeId(activity).href }
@@ -3946,7 +3940,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
3946
3940
  });
3947
3941
  }
3948
3942
  forwardActivity(forwarder, recipients, options) {
3949
- const tracer = this.tracerProvider.getTracer(require_docloader.deno_default.name, require_docloader.deno_default.version);
3943
+ const tracer = this.tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
3950
3944
  return tracer.startActiveSpan("activitypub.outbox", {
3951
3945
  kind: this.federation.outboxQueue == null || options?.immediate ? __opentelemetry_api.SpanKind.CLIENT : __opentelemetry_api.SpanKind.PRODUCER,
3952
3946
  attributes: { "activitypub.activity.type": this.activityType }
@@ -4047,7 +4041,7 @@ var InboxContextImpl = class InboxContextImpl extends ContextImpl {
4047
4041
  });
4048
4042
  const keyJwkPairs = [];
4049
4043
  for (const { keyId, privateKey } of keys) {
4050
- const privateKeyJwk = await require_key.exportJwk(privateKey);
4044
+ const privateKeyJwk = await require_http.exportJwk(privateKey);
4051
4045
  keyJwkPairs.push({
4052
4046
  keyId: keyId.href,
4053
4047
  privateKey: privateKeyJwk
@@ -0,0 +1,26 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ import "./lookup-NXjB7xUj.js";
7
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-BMPvaTpX.js";
8
+ import "./client-pY7-3icS.js";
9
+ import "./types-C2XVl6gj.js";
10
+ import "./actor-BLq4KEGR.js";
11
+ import "./key-CgKiloJr.js";
12
+ import "./http-B9npZ3Md.js";
13
+ import "./ld-B7TO6JH2.js";
14
+ import "./owner-CSktF-2s.js";
15
+ import "./proof-Cs5Mcy_U.js";
16
+ import "./docloader-DtYIz2Pb.js";
17
+ import "./kv-cache-z0lgwFi_.js";
18
+ import "./inbox-CY8fblhz.js";
19
+ import "./builder-C4gbKvM5.js";
20
+ import "./collection-BzWsN9pB.js";
21
+ import "./keycache-B6O-bhMs.js";
22
+ import "./negotiation-C4nFufNk.js";
23
+ import "./retry-CfF8Gn4d.js";
24
+ import "./send-vPZ03xUr.js";
25
+
26
+ export { FederationImpl };
@@ -3,21 +3,20 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
 
5
5
  import { getDefaultActivityTransformers } from "./transformers-BFT6d7J5.js";
6
- import { deno_default, getDocumentLoader, kvCache } from "./docloader-XK3y2jn5.js";
7
- import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-ChbPLm6n.js";
8
- import { lookupWebFinger } from "./lookup-BPviO8ij.js";
9
- import { exportJwk, importJwk, validateCryptoKey } from "./key-jyNTxCvK.js";
10
- import { doubleKnock, verifyRequest } from "./http-BxbM8sEy.js";
11
- import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-DfgvA3al.js";
12
- import { getNodeInfo, nodeInfoToJson } from "./types-DqxyTxOf.js";
13
- import { getAuthenticatedDocumentLoader } from "./authdocloader-CrxhFL8e.js";
14
- import { lookupObject, traverseCollection } from "./vocab-BWoeZsME.js";
6
+ import { deno_default, lookupWebFinger } from "./lookup-fEH6e7ZX.js";
7
+ import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-btAA7QSA.js";
8
+ import { doubleKnock, exportJwk, importJwk, validateCryptoKey, verifyRequest } from "./http-D7qwMpca.js";
9
+ import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-BT65yR1Q.js";
10
+ import { getNodeInfo, nodeInfoToJson } from "./types-BtUjyi5y.js";
11
+ import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-DkW_lqUw.js";
12
+ import { lookupObject, traverseCollection } from "./vocab-wADjlIH4.js";
15
13
  import { getLogger, withContext } from "@logtape/logtape";
16
14
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
17
- import { encodeHex } from "byte-encodings/hex";
15
+ import { getDocumentLoader } from "@fedify/vocab-runtime";
18
16
  import { cloneDeep } from "es-toolkit";
19
17
  import { Router } from "uri-template-router";
20
18
  import { parseTemplate } from "url-template";
19
+ import { encodeHex } from "byte-encodings/hex";
21
20
  import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
22
21
  import { domainToASCII } from "node:url";
23
22
 
@@ -339,7 +338,7 @@ var FederationBuilderImpl = class {
339
338
  this.collectionTypeIds = {};
340
339
  }
341
340
  async build(options) {
342
- const { FederationImpl: FederationImpl$1 } = await import("./middleware-_vjt6FWU.js");
341
+ const { FederationImpl: FederationImpl$1 } = await import("./middleware-Yk-MuxWc.js");
343
342
  const f = new FederationImpl$1(options);
344
343
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
345
344
  f.router = this.router.clone();
@@ -792,11 +791,11 @@ var FederationBuilderImpl = class {
792
791
  };
793
792
  return setters;
794
793
  }
795
- setCollectionDispatcher(name, ...args) {
796
- return this.#setCustomCollectionDispatcher(name, "collection", ...args);
794
+ setCollectionDispatcher(name, itemType, path, dispatcher) {
795
+ return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
797
796
  }
798
- setOrderedCollectionDispatcher(name, ...args) {
799
- return this.#setCustomCollectionDispatcher(name, "orderedCollection", ...args);
797
+ setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
798
+ return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
800
799
  }
801
800
  #setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
802
801
  const strName = String(name);
@@ -1550,7 +1549,7 @@ async function handleInboxInternal(request, parameters, span) {
1550
1549
  /**
1551
1550
  * Handles a custom collection request.
1552
1551
  * @template TItem The type of items in the collection.
1553
- * @template TParams The parameter names of the requested URL.
1552
+ * @template TParam The parameter names of the requested URL.
1554
1553
  * @template TContext The type of the context, extending {@link RequestContext}.
1555
1554
  * @template TContextData The context data to pass to the `TContext`.
1556
1555
  * @param request The HTTP request.
@@ -1568,7 +1567,7 @@ async function _handleCustomCollection(request, { name, values, context: context
1568
1567
  /**
1569
1568
  * Handles an ordered collection request.
1570
1569
  * @template TItem The type of items in the collection.
1571
- * @template TParams The parameter names of the requested URL.
1570
+ * @template TParam The parameter names of the requested URL.
1572
1571
  * @template TContext The type of the context, extending {@link RequestContext}.
1573
1572
  * @template TContextData The context data to pass to the `TContext`.
1574
1573
  * @param request The HTTP request.
@@ -1588,7 +1587,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
1588
1587
  * The main flow is on `getCollection`, `dispatch`.
1589
1588
  *
1590
1589
  * @template TItem The type of items in the collection.
1591
- * @template TParams The parameter names of the requested URL.
1590
+ * @template TParam The parameter names of the requested URL.
1592
1591
  * @template TContext The type of the context. {@link Context} or {@link RequestContext}.
1593
1592
  * @template TContextData The context data to pass to the `TContext`.
1594
1593
  * @template TCollection The type of the collection, extending {@link Collection}.
@@ -1622,14 +1621,14 @@ var CustomCollectionHandler = class {
1622
1621
  #collection = null;
1623
1622
  /**
1624
1623
  * Creates a new CustomCollection instance.
1625
- * @param {string} name The name of the collection.
1626
- * @param {TParams} values The parameter values for the collection.
1627
- * @param {TContext} context The request context.
1628
- * @param {CustomCollectionCallbacks} callbacks The collection callbacks.
1629
- * @param {TracerProvider} tracerProvider The tracer provider for telemetry.
1630
- * @param {ConstructorWithTypeId<TCollection>} Collection The Collection constructor.
1631
- * @param {ConstructorWithTypeId<TCollectionPage>} CollectionPage The CollectionPage constructor.
1632
- * @param {(item: TItem) => boolean} filterPredicate Optional filter predicate for items.
1624
+ * @param name The name of the collection.
1625
+ * @param values The parameter values for the collection.
1626
+ * @param context The request context.
1627
+ * @param callbacks The collection callbacks.
1628
+ * @param tracerProvider The tracer provider for telemetry.
1629
+ * @param Collection The Collection constructor.
1630
+ * @param CollectionPage The CollectionPage constructor.
1631
+ * @param filterPredicate Optional filter predicate for items.
1633
1632
  */
1634
1633
  constructor(name, values, context$1, callbacks, tracerProvider = trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
1635
1634
  this.name = name;
@@ -1754,7 +1753,7 @@ var CustomCollectionHandler = class {
1754
1753
  /**
1755
1754
  * Creates a function to wrap the dispatcher so tracing can be applied.
1756
1755
  * @param params Parameters including cursor and total items.
1757
- * @returns {(span: Span) => Promise<PageItems<TItem>>} A function that handles the span operation.
1756
+ * @returns A function that handles the span operation.
1758
1757
  */
1759
1758
  spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
1760
1759
  try {
@@ -1775,23 +1774,23 @@ var CustomCollectionHandler = class {
1775
1774
  };
1776
1775
  /**
1777
1776
  * Dispatches the collection request to get items.
1778
- * @param {string | null} cursor The cursor for pagination, or null for the first page.
1779
- * @returns {Promise<PageItems<TItem>>} A promise that resolves to the page items.
1777
+ * @param cursor The cursor for pagination, or null for the first page.
1778
+ * @returns A promise that resolves to the page items.
1780
1779
  */
1781
1780
  async dispatch(cursor = null) {
1782
1781
  return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
1783
1782
  }
1784
1783
  /**
1785
1784
  * Filters the items in the collection.
1786
- * @param {TItem[]} items The items to filter.
1787
- * @returns {(Object | Link | URL)[]} The filtered items.
1785
+ * @param items The items to filter.
1786
+ * @returns The filtered items.
1788
1787
  */
1789
1788
  filterItems(items) {
1790
1789
  return filterCollectionItems(items, this.name, this.filterPredicate);
1791
1790
  }
1792
1791
  /**
1793
1792
  * Appends a cursor to the URL if it exists.
1794
- * @param {string | null | undefined} cursor The cursor to append, or null/undefined.
1793
+ * @param cursor The cursor to append, or null/undefined.
1795
1794
  * @returns The URL with cursor appended, or null if cursor is null/undefined.
1796
1795
  */
1797
1796
  appendToUrl(cursor) {
@@ -1799,8 +1798,7 @@ var CustomCollectionHandler = class {
1799
1798
  }
1800
1799
  /**
1801
1800
  * Gets the stored collection or collection page.
1802
- * @returns {Promise<TCollection | TCollectionPage>} A promise that resolves to
1803
- the collection or collection page.
1801
+ * @returns A promise that resolves to the collection or collection page.
1804
1802
  */
1805
1803
  get collection() {
1806
1804
  if (this.#collection === null) this.#collection = this.getCollection();
@@ -1808,8 +1806,8 @@ var CustomCollectionHandler = class {
1808
1806
  }
1809
1807
  /**
1810
1808
  * Gets the total number of items in the collection.
1811
- * @returns {Promise<number | null>} A promise that
1812
- resolves to the total items count, or null if not available.
1809
+ * @returns A promise that resolves to the total items count,
1810
+ * or null if not available.
1813
1811
  */
1814
1812
  get totalItems() {
1815
1813
  if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
@@ -1825,8 +1823,8 @@ var CustomCollectionHandler = class {
1825
1823
  }
1826
1824
  /**
1827
1825
  * Gets the first cursor for pagination.
1828
- * @returns {Promise<string | null>} A promise that resolves to the first cursor,
1829
- or null if not available.
1826
+ * @returns A promise that resolves to the first cursor,
1827
+ * or null if not available.
1830
1828
  */
1831
1829
  get firstCursor() {
1832
1830
  const cursor = this.callbacks.firstCursor?.(this.context, this.values);
@@ -2350,7 +2348,6 @@ var FederationImpl = class extends FederationBuilderImpl {
2350
2348
  firstKnock;
2351
2349
  constructor(options) {
2352
2350
  super();
2353
- const logger$1 = getLogger(["fedify", "federation"]);
2354
2351
  this.kv = options.kv;
2355
2352
  this.kvPrefixes = {
2356
2353
  activityIdempotence: ["_fedify", "activityIdempotence"],
@@ -2398,8 +2395,9 @@ var FederationImpl = class extends FederationBuilderImpl {
2398
2395
  this.router.trailingSlashInsensitive = options.trailingSlashInsensitive ?? false;
2399
2396
  this._initializeRouter();
2400
2397
  if (options.allowPrivateAddress || options.userAgent != null) {
2401
- if (options.contextLoader != null) throw new TypeError("Cannot set contextLoader with allowPrivateAddress or userAgent options.");
2402
- else if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
2398
+ if (options.documentLoaderFactory != null) throw new TypeError("Cannot set documentLoaderFactory with allowPrivateAddress or userAgent options.");
2399
+ if (options.contextLoaderFactory != null) throw new TypeError("Cannot set contextLoaderFactory with allowPrivateAddress or userAgent options.");
2400
+ if (options.authenticatedDocumentLoaderFactory != null) throw new TypeError("Cannot set authenticatedDocumentLoaderFactory with allowPrivateAddress or userAgent options.");
2403
2401
  }
2404
2402
  const { allowPrivateAddress, userAgent } = options;
2405
2403
  this.allowPrivateAddress = allowPrivateAddress ?? false;
@@ -2413,11 +2411,7 @@ var FederationImpl = class extends FederationBuilderImpl {
2413
2411
  prefix: this.kvPrefixes.remoteDocument
2414
2412
  });
2415
2413
  });
2416
- if (options.contextLoader != null) {
2417
- if (options.contextLoaderFactory != null) throw new TypeError("Cannot set both contextLoader and contextLoaderFactory options at a time; use contextLoaderFactory only.");
2418
- this.contextLoaderFactory = () => options.contextLoader;
2419
- logger$1.warn("The contextLoader option is deprecated; use contextLoaderFactory option instead.");
2420
- } else this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
2414
+ this.contextLoaderFactory = options.contextLoaderFactory ?? this.documentLoaderFactory;
2421
2415
  this.authenticatedDocumentLoaderFactory = options.authenticatedDocumentLoaderFactory ?? ((identity) => getAuthenticatedDocumentLoader(identity, {
2422
2416
  allowPrivateAddress,
2423
2417
  userAgent,
@@ -0,0 +1,15 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import "./transformers-BFT6d7J5.js";
6
+ import "./lookup-fEH6e7ZX.js";
7
+ import "./actor-btAA7QSA.js";
8
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-D_VyRsDx.js";
9
+ import "./http-D7qwMpca.js";
10
+ import "./proof-BT65yR1Q.js";
11
+ import "./types-BtUjyi5y.js";
12
+ import "./kv-cache-DkW_lqUw.js";
13
+ import "./vocab-wADjlIH4.js";
14
+
15
+ export { FederationImpl };
@@ -0,0 +1,15 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ require('./transformers-CoBS-oFG.cjs');
6
+ require('./lookup-Cc3ZAAis.cjs');
7
+ require('./actor-C3oFUgfc.cjs');
8
+ const require_middleware = require('./middleware-C8w5YYxK.cjs');
9
+ require('./http-ngJvMHez.cjs');
10
+ require('./proof-feEDocLH.cjs');
11
+ require('./types-CWgzGaqk.cjs');
12
+ require('./kv-cache-BrjWZnGU.cjs');
13
+ require('./vocab-NvDV-exu.cjs');
14
+
15
+ exports.FederationImpl = require_middleware.FederationImpl;
@@ -1,9 +1,9 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { DocumentLoader } from "./docloader-CxWcuWqQ.js";
4
- import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-BI0Ak5lL.js";
5
- import { KeyCache } from "./http-D6Uj2x2y.js";
3
+ import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "./vocab-BCWe1Ih5.js";
4
+ import { KeyCache } from "./http-BbO0ejuk.js";
6
5
  import { TracerProvider } from "@opentelemetry/api";
6
+ import { DocumentLoader } from "@fedify/vocab-runtime";
7
7
 
8
8
  //#region src/sig/ld.d.ts
9
9
  /**