@fedify/fedify 1.9.0-pr.407.1544 → 1.9.0-pr.421.1746

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 (176) hide show
  1. package/dist/actor-B2pAR8hn.cjs +42606 -0
  2. package/dist/{actor-BY--uubW.js → actor-BGkVHk1D.js} +6951 -2127
  3. package/dist/{actor-Ch5yFYFG.d.ts → actor-C1Euqngb.d.ts} +1 -1
  4. package/dist/{actor-CeBu8hLy.js → actor-CRMvoMgB.js} +1 -1
  5. package/dist/actor-Ydzhc8dj.d.cts +128 -0
  6. package/dist/{authdocloader-C89pKQKE.js → authdocloader-1wvQznSP.js} +6 -6
  7. package/dist/authdocloader-B6vfY0DQ.cjs +58 -0
  8. package/dist/{authdocloader-jHzDqZo2.js → authdocloader-BaK01biC.js} +3 -3
  9. package/dist/{builder-ClMKBUks.js → builder-BYjzwwU1.js} +14 -8
  10. package/dist/chunk-DqRYRqnO.cjs +34 -0
  11. package/dist/{client-DB3mC1oJ.js → client-CchEe2DS.js} +1 -1
  12. package/dist/client-DjT_tegg.d.cts +294 -0
  13. package/dist/compat/mod.cjs +10 -0
  14. package/dist/compat/mod.d.cts +13 -0
  15. package/dist/compat/mod.d.ts +7 -7
  16. package/dist/compat/mod.js +5 -5
  17. package/dist/compat/transformers.test.js +16 -16
  18. package/dist/compat-DmDDELst.cjs +4 -0
  19. package/dist/compat-nxUqe4Z-.js +4 -0
  20. package/dist/{context-DFruNLny.d.ts → context-CXUibY4L.d.ts} +179 -116
  21. package/dist/context-CwUAkopp.d.cts +2324 -0
  22. package/dist/docloader-BeO6Nvv8.cjs +4862 -0
  23. package/dist/{docloader-BJTPo7_i.js → docloader-Bf4PXDNP.js} +188 -8
  24. package/dist/docloader-D-MrRyHl.d.cts +219 -0
  25. package/dist/{esm-BjUpSZdQ.js → esm-DKBIHBc7.js} +1 -1
  26. package/dist/federation/builder.test.js +5 -5
  27. package/dist/federation/collection.test.js +3 -3
  28. package/dist/federation/handler.test.js +17 -17
  29. package/dist/federation/idempotency.test.d.ts +3 -0
  30. package/dist/federation/idempotency.test.js +202 -0
  31. package/dist/federation/inbox.test.js +4 -4
  32. package/dist/federation/keycache.test.js +4 -4
  33. package/dist/federation/kv.test.js +4 -3
  34. package/dist/federation/middleware.test.js +18 -18
  35. package/dist/federation/mod.cjs +29 -0
  36. package/dist/federation/mod.d.cts +13 -0
  37. package/dist/federation/mod.d.ts +7 -7
  38. package/dist/federation/mod.js +15 -15
  39. package/dist/federation/mq.test.js +3 -3
  40. package/dist/federation/retry.test.js +3 -3
  41. package/dist/federation/router.test.js +3 -3
  42. package/dist/federation/send.test.js +10 -10
  43. package/dist/{federation-CMX7WzeL.js → federation-D1U8YY9t.js} +3 -3
  44. package/dist/federation-H2_En3j5.cjs +244 -0
  45. package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
  46. package/dist/http-B1_DzfAU.d.cts +253 -0
  47. package/dist/{http-sU0Wj-tv.js → http-BciknU_m.js} +7 -7
  48. package/dist/http-BkgY_K-o.cjs +826 -0
  49. package/dist/{http-3pAI0mqb.js → http-CvT-8K7A.js} +3 -3
  50. package/dist/{http-D8Q4xH0d.d.ts → http-wsGR6KkT.d.ts} +1 -1
  51. package/dist/{inbox-Dg825gXU.js → inbox-DmOmHCt8.js} +29 -7
  52. package/dist/key-BNpAX-yy.cjs +290 -0
  53. package/dist/{key-BWgRsIwz.js → key-Bf8wecsW.js} +3 -3
  54. package/dist/{key-l5QMtRss.js → key-Btn1rSKF.js} +5 -5
  55. package/dist/key-C-s397Qs.cjs +10 -0
  56. package/dist/{key-RzI0hV7H.js → key-CZzHTxwc.js} +2 -2
  57. package/dist/key-DlGLd9iL.js +10 -0
  58. package/dist/{keycache-BGlP5YTm.js → keycache-BRLbFuE4.js} +1 -1
  59. package/dist/{keys-BRbwmdDJ.js → keys-DgqkndRb.js} +1 -1
  60. package/dist/kv-63Cil1MD.d.cts +81 -0
  61. package/dist/{ld-C9E9DPBz.js → ld-v-iyFVSd.js} +4 -4
  62. package/dist/lookup-6OyofAxv.cjs +137 -0
  63. package/dist/{lookup-oZxe6kZr.js → lookup-8ZcpBTR8.js} +21 -12
  64. package/dist/{lookup-CN62_yPh.js → lookup-DxJ0NLYS.js} +4 -4
  65. package/dist/middleware-C7PiPtdo.cjs +4271 -0
  66. package/dist/middleware-CnRFgcDM.cjs +17 -0
  67. package/dist/middleware-CvThFfEG.js +26 -0
  68. package/dist/middleware-DG81e5gf.js +17 -0
  69. package/dist/{middleware-extU7qDB.js → middleware-DRE7WmH1.js} +96 -65
  70. package/dist/{middleware-jQ1GPh2U.js → middleware-LZN4mAnb.js} +57 -54
  71. package/dist/mod-BUbqxBev.d.cts +307 -0
  72. package/dist/{mod-CiXjux2r.d.ts → mod-BcObK1Lz.d.ts} +2 -2
  73. package/dist/mod-C2tOeRkN.d.cts +1 -0
  74. package/dist/{mod-Cy6pkZSn.d.ts → mod-CDObsV1d.d.ts} +19 -1
  75. package/dist/{mod-BAuhKa9d.d.ts → mod-CIbqfZW0.d.ts} +1 -1
  76. package/dist/{mod-B7Pc0I7F.d.ts → mod-DgcYoyZK.d.ts} +2 -2
  77. package/dist/mod-Dt-G9ZOS.d.cts +102 -0
  78. package/dist/mod-FZd39qVq.d.cts +1 -0
  79. package/dist/mod-fjqfsrty.d.cts +266 -0
  80. package/dist/mod-jQ4OODsl.d.cts +113 -0
  81. package/dist/mod-mXx9V0q5.d.cts +80 -0
  82. package/dist/mod.cjs +152 -0
  83. package/dist/mod.d.cts +17 -0
  84. package/dist/mod.d.ts +10 -10
  85. package/dist/mod.js +20 -20
  86. package/dist/mq-B7R1Q-M5.d.cts +140 -0
  87. package/dist/nodeinfo/client.test.js +5 -5
  88. package/dist/nodeinfo/handler.test.js +16 -16
  89. package/dist/nodeinfo/mod.cjs +13 -0
  90. package/dist/nodeinfo/mod.d.cts +5 -0
  91. package/dist/nodeinfo/mod.js +6 -6
  92. package/dist/nodeinfo/semver.test.js +3 -3
  93. package/dist/nodeinfo/types.test.js +3 -3
  94. package/dist/nodeinfo-Co9lJrWl.cjs +4 -0
  95. package/dist/nodeinfo-DfycQ8Wf.js +4 -0
  96. package/dist/owner-6KSEp9eV.d.cts +67 -0
  97. package/dist/{owner-D38zBIMc.d.ts → owner-BbeUDvOu.d.ts} +2 -2
  98. package/dist/{owner-B836JKuZ.js → owner-DiaqwZNX.js} +2 -2
  99. package/dist/{proof-DLwnfKak.js → proof-BJmMlvgv.js} +9 -9
  100. package/dist/{proof-D63mA1Rv.js → proof-BLrU2QqY.js} +3 -3
  101. package/dist/proof-uoL7KsPK.cjs +673 -0
  102. package/dist/runtime/authdocloader.test.js +9 -9
  103. package/dist/runtime/docloader.test.js +4 -4
  104. package/dist/runtime/key.test.js +5 -5
  105. package/dist/runtime/langstr.test.js +3 -3
  106. package/dist/runtime/link.test.d.ts +3 -0
  107. package/dist/runtime/link.test.js +61 -0
  108. package/dist/runtime/mod.cjs +25 -0
  109. package/dist/runtime/mod.d.cts +6 -0
  110. package/dist/runtime/mod.d.ts +3 -3
  111. package/dist/runtime/mod.js +10 -10
  112. package/dist/runtime/multibase/multibase.test.js +3 -3
  113. package/dist/runtime/url.test.js +3 -3
  114. package/dist/runtime-C58AJWSv.cjs +4 -0
  115. package/dist/runtime-DPYEDf-o.js +4 -0
  116. package/dist/{send-CE9GFSCd.js → send-Bh9H1ZtH.js} +2 -2
  117. package/dist/sig/http.test.js +9 -9
  118. package/dist/sig/key.test.js +6 -6
  119. package/dist/sig/ld.test.js +7 -7
  120. package/dist/sig/mod.cjs +30 -0
  121. package/dist/sig/mod.d.cts +8 -0
  122. package/dist/sig/mod.d.ts +5 -5
  123. package/dist/sig/mod.js +10 -10
  124. package/dist/sig/owner.test.js +7 -7
  125. package/dist/sig/proof.test.js +7 -7
  126. package/dist/sig-ByHXzqUi.cjs +4 -0
  127. package/dist/sig-Cj3tk-ig.js +4 -0
  128. package/dist/testing/docloader.test.js +3 -3
  129. package/dist/testing/mod.d.ts +385 -110
  130. package/dist/testing/mod.js +3 -3
  131. package/dist/{testing-B2tgn0a4.js → testing-wv9xgBFV.js} +2 -2
  132. package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
  133. package/dist/transformers-CoBS-oFG.cjs +116 -0
  134. package/dist/{type-OboVsUha.js → type-JHkkALfe.js} +7261 -2257
  135. package/dist/{types-BLr6AjjI.js → types-D-8qHCG5.js} +4 -4
  136. package/dist/types-SEdRdlKp.cjs +488 -0
  137. package/dist/vocab/actor.test.js +5 -5
  138. package/dist/vocab/lookup.test.js +255 -5
  139. package/dist/vocab/mod.cjs +87 -0
  140. package/dist/vocab/mod.d.cts +6 -0
  141. package/dist/vocab/mod.d.ts +3 -3
  142. package/dist/vocab/mod.js +7 -7
  143. package/dist/vocab/type.test.js +3 -3
  144. package/dist/vocab/vocab.test.js +433 -9
  145. package/dist/vocab-BZ2XJ4IH.cjs +291 -0
  146. package/dist/{vocab-BEEm2I6u.d.ts → vocab-CDHNj5zp.d.ts} +290 -0
  147. package/dist/{vocab-Z7alheNv.js → vocab-Cb3CeS7_.js} +26 -17
  148. package/dist/vocab-Cfs0937i.d.cts +14919 -0
  149. package/dist/webfinger/handler.test.js +16 -16
  150. package/dist/webfinger/lookup.test.js +4 -4
  151. package/dist/webfinger/mod.cjs +9 -0
  152. package/dist/webfinger/mod.d.cts +4 -0
  153. package/dist/webfinger/mod.js +6 -6
  154. package/dist/webfinger-BjOEdFPs.cjs +4 -0
  155. package/dist/webfinger-De_bU0iE.js +4 -0
  156. package/dist/x/cfworkers.cjs +100 -0
  157. package/dist/x/cfworkers.d.cts +59 -0
  158. package/dist/x/cfworkers.js +3 -3
  159. package/dist/x/cfworkers.test.js +3 -3
  160. package/dist/x/hono.cjs +61 -0
  161. package/dist/x/hono.d.cts +54 -0
  162. package/dist/x/hono.d.ts +6 -6
  163. package/dist/x/hono.js +3 -3
  164. package/dist/x/sveltekit.cjs +69 -0
  165. package/dist/x/sveltekit.d.cts +46 -0
  166. package/dist/x/sveltekit.d.ts +6 -6
  167. package/dist/x/sveltekit.js +3 -3
  168. package/package.json +68 -13
  169. package/dist/compat-Bb5myD13.js +0 -4
  170. package/dist/key-_XZAOE9D.js +0 -10
  171. package/dist/middleware-Ccahu3ql.js +0 -26
  172. package/dist/middleware-fO804EqJ.js +0 -17
  173. package/dist/nodeinfo-CyEbLjHs.js +0 -4
  174. package/dist/runtime-BSkOVUWM.js +0 -4
  175. package/dist/sig-BXJO--F9.js +0 -4
  176. package/dist/webfinger-C3GIyXIg.js +0 -4
@@ -0,0 +1,17 @@
1
+
2
+ const { Temporal } = require("@js-temporal/polyfill");
3
+ const { URLPattern } = require("urlpattern-polyfill");
4
+
5
+ require('./transformers-CoBS-oFG.cjs');
6
+ require('./docloader-BeO6Nvv8.cjs');
7
+ require('./actor-B2pAR8hn.cjs');
8
+ const require_middleware = require('./middleware-C7PiPtdo.cjs');
9
+ require('./lookup-6OyofAxv.cjs');
10
+ require('./key-BNpAX-yy.cjs');
11
+ require('./http-BkgY_K-o.cjs');
12
+ require('./proof-uoL7KsPK.cjs');
13
+ require('./types-SEdRdlKp.cjs');
14
+ require('./authdocloader-B6vfY0DQ.cjs');
15
+ require('./vocab-BZ2XJ4IH.cjs');
16
+
17
+ exports.FederationImpl = require_middleware.FederationImpl;
@@ -0,0 +1,26 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+ globalThis.addEventListener = () => {};
5
+
6
+ import "./type-JHkkALfe.js";
7
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-LZN4mAnb.js";
8
+ import "./semver-dArNLkR9.js";
9
+ import "./client-CchEe2DS.js";
10
+ import "./lookup-8ZcpBTR8.js";
11
+ import "./types-BIgY6c-l.js";
12
+ import "./actor-CRMvoMgB.js";
13
+ import "./key-CZzHTxwc.js";
14
+ import "./http-CvT-8K7A.js";
15
+ import "./authdocloader-BaK01biC.js";
16
+ import "./ld-v-iyFVSd.js";
17
+ import "./owner-DiaqwZNX.js";
18
+ import "./proof-BLrU2QqY.js";
19
+ import "./inbox-DmOmHCt8.js";
20
+ import "./builder-BYjzwwU1.js";
21
+ import "./collection-CSzG2j1P.js";
22
+ import "./keycache-BRLbFuE4.js";
23
+ import "./retry-D4GJ670a.js";
24
+ import "./send-Bh9H1ZtH.js";
25
+
26
+ export { FederationImpl };
@@ -0,0 +1,17 @@
1
+
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import "./transformers-BFT6d7J5.js";
6
+ import "./docloader-Bf4PXDNP.js";
7
+ import "./actor-BGkVHk1D.js";
8
+ import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "./middleware-DRE7WmH1.js";
9
+ import "./lookup-DxJ0NLYS.js";
10
+ import "./key-Btn1rSKF.js";
11
+ import "./http-BciknU_m.js";
12
+ import "./proof-BJmMlvgv.js";
13
+ import "./types-D-8qHCG5.js";
14
+ import "./authdocloader-1wvQznSP.js";
15
+ import "./vocab-Cb3CeS7_.js";
16
+
17
+ export { FederationImpl };
@@ -1,17 +1,17 @@
1
1
 
2
- import { Temporal } from "@js-temporal/polyfill";
3
- import { URLPattern } from "urlpattern-polyfill";
4
-
5
- import { getDefaultActivityTransformers } from "./transformers-Dna8Fg7k.js";
6
- import { deno_default, getDocumentLoader, kvCache } from "./docloader-BJTPo7_i.js";
7
- import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-BY--uubW.js";
8
- import { lookupWebFinger } from "./lookup-CN62_yPh.js";
9
- import { exportJwk, importJwk, validateCryptoKey } from "./key-l5QMtRss.js";
10
- import { doubleKnock, verifyRequest } from "./http-sU0Wj-tv.js";
11
- import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-DLwnfKak.js";
12
- import { getNodeInfo, nodeInfoToJson } from "./types-BLr6AjjI.js";
13
- import { getAuthenticatedDocumentLoader } from "./authdocloader-C89pKQKE.js";
14
- import { lookupObject, traverseCollection } from "./vocab-Z7alheNv.js";
2
+ import { Temporal } from "@js-temporal/polyfill";
3
+ import { URLPattern } from "urlpattern-polyfill";
4
+
5
+ import { getDefaultActivityTransformers } from "./transformers-BFT6d7J5.js";
6
+ import { deno_default, getDocumentLoader, kvCache } from "./docloader-Bf4PXDNP.js";
7
+ import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, getTypeId } from "./actor-BGkVHk1D.js";
8
+ import { lookupWebFinger } from "./lookup-DxJ0NLYS.js";
9
+ import { exportJwk, importJwk, validateCryptoKey } from "./key-Btn1rSKF.js";
10
+ import { doubleKnock, verifyRequest } from "./http-BciknU_m.js";
11
+ import { detachSignature, doesActorOwnKey, getKeyOwner, hasSignature, signJsonLd, signObject, verifyJsonLd, verifyObject } from "./proof-BJmMlvgv.js";
12
+ import { getNodeInfo, nodeInfoToJson } from "./types-D-8qHCG5.js";
13
+ import { getAuthenticatedDocumentLoader } from "./authdocloader-1wvQznSP.js";
14
+ import { lookupObject, traverseCollection } from "./vocab-Cb3CeS7_.js";
15
15
  import { getLogger, withContext } from "@logtape/logtape";
16
16
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
17
17
  import { encodeHex } from "byte-encodings/hex";
@@ -55,17 +55,39 @@ var InboxListenerSet = class InboxListenerSet {
55
55
  return this.dispatchWithClass(activity)?.listener ?? null;
56
56
  }
57
57
  };
58
- async function routeActivity({ context: ctx, json, activity, recipient, inboxListeners, inboxContextFactory, inboxErrorHandler, kv, kvPrefixes, queue, span, tracerProvider }) {
58
+ let warnedAboutDefaultIdempotency = false;
59
+ async function routeActivity({ context: ctx, json, activity, recipient, inboxListeners, inboxContextFactory, inboxErrorHandler, kv, kvPrefixes, queue, span, tracerProvider, idempotencyStrategy }) {
59
60
  const logger$1 = getLogger([
60
61
  "fedify",
61
62
  "federation",
62
63
  "inbox"
63
64
  ]);
64
- const cacheKey = activity.id == null ? null : [
65
- ...kvPrefixes.activityIdempotence,
66
- ctx.origin,
67
- activity.id.href
68
- ];
65
+ let cacheKey = null;
66
+ if (activity.id != null) {
67
+ const inboxContext = inboxContextFactory(recipient, json, activity.id?.href, getTypeId(activity).href);
68
+ const strategy = idempotencyStrategy ?? "per-origin";
69
+ if (idempotencyStrategy === void 0 && !warnedAboutDefaultIdempotency) {
70
+ logger$1.warn("Using default idempotency strategy 'per-origin'. This default will change to 'per-inbox' in Fedify 2.0. Please explicitly set the idempotency strategy using .withIdempotency().");
71
+ warnedAboutDefaultIdempotency = true;
72
+ }
73
+ let keyString;
74
+ if (typeof strategy === "function") {
75
+ const result = await strategy(inboxContext, activity);
76
+ keyString = result;
77
+ } else switch (strategy) {
78
+ case "global":
79
+ keyString = activity.id.href;
80
+ break;
81
+ case "per-origin":
82
+ keyString = `${ctx.origin}\n${activity.id.href}`;
83
+ break;
84
+ case "per-inbox":
85
+ keyString = `${ctx.origin}\n${activity.id.href}\n${recipient == null ? "sharedInbox" : `inbox\n${recipient}`}`;
86
+ break;
87
+ default: keyString = `${ctx.origin}\n${activity.id.href}`;
88
+ }
89
+ if (keyString != null) cacheKey = [...kvPrefixes.activityIdempotence, keyString];
90
+ }
69
91
  if (cacheKey != null) {
70
92
  const cached = await kv.get(cacheKey);
71
93
  if (cached === true) {
@@ -307,6 +329,7 @@ var FederationBuilderImpl = class {
307
329
  inboxListeners;
308
330
  inboxErrorHandler;
309
331
  sharedInboxKeyDispatcher;
332
+ idempotencyStrategy;
310
333
  collectionTypeIds;
311
334
  collectionCallbacks;
312
335
  /**
@@ -321,7 +344,7 @@ var FederationBuilderImpl = class {
321
344
  this.collectionTypeIds = {};
322
345
  }
323
346
  async build(options) {
324
- const { FederationImpl: FederationImpl$1 } = await import("./middleware-fO804EqJ.js");
347
+ const { FederationImpl: FederationImpl$1 } = await import("./middleware-DG81e5gf.js");
325
348
  const f = new FederationImpl$1(options);
326
349
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
327
350
  f.router = this.router.clone();
@@ -343,6 +366,7 @@ var FederationBuilderImpl = class {
343
366
  f.inboxListeners = this.inboxListeners?.clone();
344
367
  f.inboxErrorHandler = this.inboxErrorHandler;
345
368
  f.sharedInboxKeyDispatcher = this.sharedInboxKeyDispatcher;
369
+ f.idempotencyStrategy = this.idempotencyStrategy;
346
370
  return f;
347
371
  }
348
372
  _getTracer() {
@@ -765,15 +789,19 @@ var FederationBuilderImpl = class {
765
789
  setSharedKeyDispatcher: (dispatcher) => {
766
790
  this.sharedInboxKeyDispatcher = dispatcher;
767
791
  return setters;
792
+ },
793
+ withIdempotency: (strategy) => {
794
+ this.idempotencyStrategy = strategy;
795
+ return setters;
768
796
  }
769
797
  };
770
798
  return setters;
771
799
  }
772
- setCollectionDispatcher(name, ...args) {
773
- return this.#setCustomCollectionDispatcher(name, "collection", ...args);
800
+ setCollectionDispatcher(name, itemType, path, dispatcher) {
801
+ return this.#setCustomCollectionDispatcher(name, "collection", itemType, path, dispatcher);
774
802
  }
775
- setOrderedCollectionDispatcher(name, ...args) {
776
- return this.#setCustomCollectionDispatcher(name, "orderedCollection", ...args);
803
+ setOrderedCollectionDispatcher(name, itemType, path, dispatcher) {
804
+ return this.#setCustomCollectionDispatcher(name, "orderedCollection", itemType, path, dispatcher);
777
805
  }
778
806
  #setCustomCollectionDispatcher(name, collectionType, itemType, path, dispatcher) {
779
807
  const strName = String(name);
@@ -1296,7 +1324,8 @@ async function handleInbox(request, options) {
1296
1324
  * @param span The OpenTelemetry span for tracing.
1297
1325
  * @returns A promise that resolves to an HTTP response.
1298
1326
  */
1299
- async function handleInboxInternal(request, { recipient, context: ctx, inboxContextFactory, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, skipSignatureVerification, tracerProvider }, span) {
1327
+ async function handleInboxInternal(request, parameters, span) {
1328
+ const { recipient, context: ctx, inboxContextFactory, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, skipSignatureVerification, tracerProvider } = parameters;
1300
1329
  const logger$1 = getLogger([
1301
1330
  "fedify",
1302
1331
  "federation",
@@ -1498,7 +1527,8 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
1498
1527
  kvPrefixes,
1499
1528
  queue,
1500
1529
  span,
1501
- tracerProvider
1530
+ tracerProvider,
1531
+ idempotencyStrategy: parameters.idempotencyStrategy
1502
1532
  });
1503
1533
  if (routeResult === "alreadyProcessed") return new Response(`Activity <${activity.id}> has already been processed.`, {
1504
1534
  status: 202,
@@ -1528,7 +1558,7 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
1528
1558
  /**
1529
1559
  * Handles a custom collection request.
1530
1560
  * @template TItem The type of items in the collection.
1531
- * @template TParams The parameter names of the requested URL.
1561
+ * @template TParam The parameter names of the requested URL.
1532
1562
  * @template TContext The type of the context, extending {@link RequestContext}.
1533
1563
  * @template TContextData The context data to pass to the `TContext`.
1534
1564
  * @param request The HTTP request.
@@ -1547,7 +1577,7 @@ async function _handleCustomCollection(request, { name, values, context: context
1547
1577
  /**
1548
1578
  * Handles an ordered collection request.
1549
1579
  * @template TItem The type of items in the collection.
1550
- * @template TParams The parameter names of the requested URL.
1580
+ * @template TParam The parameter names of the requested URL.
1551
1581
  * @template TContext The type of the context, extending {@link RequestContext}.
1552
1582
  * @template TContextData The context data to pass to the `TContext`.
1553
1583
  * @param request The HTTP request.
@@ -1568,7 +1598,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
1568
1598
  * The main flow is on `getCollection`, `dispatch`.
1569
1599
  *
1570
1600
  * @template TItem The type of items in the collection.
1571
- * @template TParams The parameter names of the requested URL.
1601
+ * @template TParam The parameter names of the requested URL.
1572
1602
  * @template TContext The type of the context. {@link Context} or {@link RequestContext}.
1573
1603
  * @template TContextData The context data to pass to the `TContext`.
1574
1604
  * @template TCollection The type of the collection, extending {@link Collection}.
@@ -1602,14 +1632,14 @@ var CustomCollectionHandler = class {
1602
1632
  #collection = null;
1603
1633
  /**
1604
1634
  * Creates a new CustomCollection instance.
1605
- * @param {string} name The name of the collection.
1606
- * @param {TParams} values The parameter values for the collection.
1607
- * @param {TContext} context The request context.
1608
- * @param {CustomCollectionCallbacks} callbacks The collection callbacks.
1609
- * @param {TracerProvider} tracerProvider The tracer provider for telemetry.
1610
- * @param {ConstructorWithTypeId<TCollection>} Collection The Collection constructor.
1611
- * @param {ConstructorWithTypeId<TCollectionPage>} CollectionPage The CollectionPage constructor.
1612
- * @param {(item: TItem) => boolean} filterPredicate Optional filter predicate for items.
1635
+ * @param name The name of the collection.
1636
+ * @param values The parameter values for the collection.
1637
+ * @param context The request context.
1638
+ * @param callbacks The collection callbacks.
1639
+ * @param tracerProvider The tracer provider for telemetry.
1640
+ * @param Collection The Collection constructor.
1641
+ * @param CollectionPage The CollectionPage constructor.
1642
+ * @param filterPredicate Optional filter predicate for items.
1613
1643
  */
1614
1644
  constructor(name, values, context$1, callbacks, tracerProvider = trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
1615
1645
  this.name = name;
@@ -1734,7 +1764,7 @@ var CustomCollectionHandler = class {
1734
1764
  /**
1735
1765
  * Creates a function to wrap the dispatcher so tracing can be applied.
1736
1766
  * @param params Parameters including cursor and total items.
1737
- * @returns {(span: Span) => Promise<PageItems<TItem>>} A function that handles the span operation.
1767
+ * @returns A function that handles the span operation.
1738
1768
  */
1739
1769
  spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
1740
1770
  try {
@@ -1755,23 +1785,23 @@ var CustomCollectionHandler = class {
1755
1785
  };
1756
1786
  /**
1757
1787
  * Dispatches the collection request to get items.
1758
- * @param {string | null} cursor The cursor for pagination, or null for the first page.
1759
- * @returns {Promise<PageItems<TItem>>} A promise that resolves to the page items.
1788
+ * @param cursor The cursor for pagination, or null for the first page.
1789
+ * @returns A promise that resolves to the page items.
1760
1790
  */
1761
1791
  async dispatch(cursor = null) {
1762
1792
  return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
1763
1793
  }
1764
1794
  /**
1765
1795
  * Filters the items in the collection.
1766
- * @param {TItem[]} items The items to filter.
1767
- * @returns {(Object | Link | URL)[]} The filtered items.
1796
+ * @param items The items to filter.
1797
+ * @returns The filtered items.
1768
1798
  */
1769
1799
  filterItems(items) {
1770
1800
  return filterCollectionItems(items, this.name, this.filterPredicate);
1771
1801
  }
1772
1802
  /**
1773
1803
  * Appends a cursor to the URL if it exists.
1774
- * @param {string | null | undefined} cursor The cursor to append, or null/undefined.
1804
+ * @param cursor The cursor to append, or null/undefined.
1775
1805
  * @returns The URL with cursor appended, or null if cursor is null/undefined.
1776
1806
  */
1777
1807
  appendToUrl(cursor) {
@@ -1779,8 +1809,7 @@ var CustomCollectionHandler = class {
1779
1809
  }
1780
1810
  /**
1781
1811
  * Gets the stored collection or collection page.
1782
- * @returns {Promise<TCollection | TCollectionPage>} A promise that resolves to
1783
- the collection or collection page.
1812
+ * @returns A promise that resolves to the collection or collection page.
1784
1813
  */
1785
1814
  get collection() {
1786
1815
  if (this.#collection === null) this.#collection = this.getCollection();
@@ -1788,8 +1817,8 @@ var CustomCollectionHandler = class {
1788
1817
  }
1789
1818
  /**
1790
1819
  * Gets the total number of items in the collection.
1791
- * @returns {Promise<number | null>} A promise that
1792
- resolves to the total items count, or null if not available.
1820
+ * @returns A promise that resolves to the total items count,
1821
+ * or null if not available.
1793
1822
  */
1794
1823
  get totalItems() {
1795
1824
  if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
@@ -1805,8 +1834,8 @@ var CustomCollectionHandler = class {
1805
1834
  }
1806
1835
  /**
1807
1836
  * Gets the first cursor for pagination.
1808
- * @returns {Promise<string | null>} A promise that resolves to the first cursor,
1809
- or null if not available.
1837
+ * @returns A promise that resolves to the first cursor,
1838
+ * or null if not available.
1810
1839
  */
1811
1840
  get firstCursor() {
1812
1841
  const cursor = this.callbacks.firstCursor?.(this.context, this.values);
@@ -3095,7 +3124,8 @@ var FederationImpl = class extends FederationBuilderImpl {
3095
3124
  onNotFound,
3096
3125
  signatureTimeWindow: this.signatureTimeWindow,
3097
3126
  skipSignatureVerification: this.skipSignatureVerification,
3098
- tracerProvider: this.tracerProvider
3127
+ tracerProvider: this.tracerProvider,
3128
+ idempotencyStrategy: this.idempotencyStrategy
3099
3129
  });
3100
3130
  case "following": return await handleCollection(request, {
3101
3131
  name: "following",
@@ -3486,15 +3516,16 @@ var ContextImpl = class ContextImpl {
3486
3516
  "actor"
3487
3517
  ]);
3488
3518
  if (this.federation.actorCallbacks?.keyPairsDispatcher == null) throw new Error("No actor key pairs dispatcher registered.");
3489
- const path = this.federation.router.build("actor", {
3490
- identifier,
3491
- handle: identifier
3492
- });
3493
- if (path == null) {
3494
- logger$1.warn("No actor dispatcher registered.");
3495
- return [];
3519
+ let actorUri;
3520
+ try {
3521
+ actorUri = this.getActorUri(identifier);
3522
+ } catch (error) {
3523
+ if (error instanceof RouterError) {
3524
+ logger$1.warn(error.message);
3525
+ return [];
3526
+ }
3527
+ throw error;
3496
3528
  }
3497
- const actorUri = new URL(path, this.canonicalOrigin);
3498
3529
  const keyPairs = await this.federation.actorCallbacks?.keyPairsDispatcher(new ContextImpl({
3499
3530
  ...this,
3500
3531
  invokedFromActorKeyPairsDispatcher: { identifier }
@@ -3655,12 +3686,11 @@ var ContextImpl = class ContextImpl {
3655
3686
  if (identifier == null) throw new Error("If recipients is \"followers\", sender must be an actor identifier or username.");
3656
3687
  expandedRecipients = [];
3657
3688
  for await (const recipient of this.getFollowers(identifier)) expandedRecipients.push(recipient);
3658
- if (options.syncCollection) {
3659
- const collectionId = this.federation.router.build("followers", {
3660
- identifier,
3661
- handle: identifier
3662
- });
3663
- opts.collectionSync = collectionId == null ? void 0 : new URL(collectionId, this.canonicalOrigin).href;
3689
+ if (options.syncCollection) try {
3690
+ opts.collectionSync = this.getFollowersUri(identifier).href;
3691
+ } catch (error) {
3692
+ if (error instanceof RouterError) opts.collectionSync = void 0;
3693
+ else throw error;
3664
3694
  }
3665
3695
  } else expandedRecipients = [recipients];
3666
3696
  span.setAttribute("activitypub.inboxes", expandedRecipients.length);
@@ -3845,7 +3875,8 @@ var ContextImpl = class ContextImpl {
3845
3875
  kvPrefixes: this.federation.kvPrefixes,
3846
3876
  queue: this.federation.inboxQueue,
3847
3877
  span,
3848
- tracerProvider: options.tracerProvider ?? this.tracerProvider
3878
+ tracerProvider: options.tracerProvider ?? this.tracerProvider,
3879
+ idempotencyStrategy: this.federation.idempotencyStrategy
3849
3880
  });
3850
3881
  return routeResult === "alreadyProcessed" || routeResult === "enqueued" || routeResult === "unsupportedActivity" || routeResult === "success";
3851
3882
  }
@@ -3,22 +3,22 @@
3
3
  import { URLPattern } from "urlpattern-polyfill";
4
4
  globalThis.addEventListener = () => {};
5
5
 
6
- import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, deno_default, getDocumentLoader, getTypeId, kvCache, lookupWebFinger } from "./type-OboVsUha.js";
7
- import { getNodeInfo } from "./client-DB3mC1oJ.js";
8
- import { RouterError, lookupObject, traverseCollection } from "./lookup-oZxe6kZr.js";
6
+ import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, deno_default, getDocumentLoader, getTypeId, kvCache, lookupWebFinger } from "./type-JHkkALfe.js";
7
+ import { getNodeInfo } from "./client-CchEe2DS.js";
8
+ import { RouterError, lookupObject, traverseCollection } from "./lookup-8ZcpBTR8.js";
9
9
  import { nodeInfoToJson } from "./types-BIgY6c-l.js";
10
- import { exportJwk, importJwk, validateCryptoKey } from "./key-RzI0hV7H.js";
11
- import { verifyRequest } from "./http-3pAI0mqb.js";
12
- import { getAuthenticatedDocumentLoader } from "./authdocloader-jHzDqZo2.js";
13
- import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-C9E9DPBz.js";
14
- import { doesActorOwnKey, getKeyOwner } from "./owner-B836JKuZ.js";
15
- import { signObject, verifyObject } from "./proof-D63mA1Rv.js";
16
- import { routeActivity } from "./inbox-Dg825gXU.js";
17
- import { FederationBuilderImpl } from "./builder-ClMKBUks.js";
10
+ import { exportJwk, importJwk, validateCryptoKey } from "./key-CZzHTxwc.js";
11
+ import { verifyRequest } from "./http-CvT-8K7A.js";
12
+ import { getAuthenticatedDocumentLoader } from "./authdocloader-BaK01biC.js";
13
+ import { detachSignature, hasSignature, signJsonLd, verifyJsonLd } from "./ld-v-iyFVSd.js";
14
+ import { doesActorOwnKey, getKeyOwner } from "./owner-DiaqwZNX.js";
15
+ import { signObject, verifyObject } from "./proof-BLrU2QqY.js";
16
+ import { routeActivity } from "./inbox-DmOmHCt8.js";
17
+ import { FederationBuilderImpl } from "./builder-BYjzwwU1.js";
18
18
  import { buildCollectionSynchronizationHeader } from "./collection-CSzG2j1P.js";
19
- import { KvKeyCache } from "./keycache-BGlP5YTm.js";
19
+ import { KvKeyCache } from "./keycache-BRLbFuE4.js";
20
20
  import { createExponentialBackoffPolicy } from "./retry-D4GJ670a.js";
21
- import { extractInboxes, sendActivity } from "./send-CE9GFSCd.js";
21
+ import { extractInboxes, sendActivity } from "./send-Bh9H1ZtH.js";
22
22
  import { getLogger, withContext } from "@logtape/logtape";
23
23
  import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
24
24
  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";
@@ -671,7 +671,8 @@ async function handleInbox(request, options) {
671
671
  * @param span The OpenTelemetry span for tracing.
672
672
  * @returns A promise that resolves to an HTTP response.
673
673
  */
674
- async function handleInboxInternal(request, { recipient, context: ctx, inboxContextFactory, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, skipSignatureVerification, tracerProvider }, span) {
674
+ async function handleInboxInternal(request, parameters, span) {
675
+ const { recipient, context: ctx, inboxContextFactory, kv, kvPrefixes, queue, actorDispatcher, inboxListeners, inboxErrorHandler, onNotFound, signatureTimeWindow, skipSignatureVerification, tracerProvider } = parameters;
675
676
  const logger$2 = getLogger([
676
677
  "fedify",
677
678
  "federation",
@@ -873,7 +874,8 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
873
874
  kvPrefixes,
874
875
  queue,
875
876
  span,
876
- tracerProvider
877
+ tracerProvider,
878
+ idempotencyStrategy: parameters.idempotencyStrategy
877
879
  });
878
880
  if (routeResult === "alreadyProcessed") return new Response(`Activity <${activity.id}> has already been processed.`, {
879
881
  status: 202,
@@ -903,7 +905,7 @@ async function handleInboxInternal(request, { recipient, context: ctx, inboxCont
903
905
  /**
904
906
  * Handles a custom collection request.
905
907
  * @template TItem The type of items in the collection.
906
- * @template TParams The parameter names of the requested URL.
908
+ * @template TParam The parameter names of the requested URL.
907
909
  * @template TContext The type of the context, extending {@link RequestContext}.
908
910
  * @template TContextData The context data to pass to the `TContext`.
909
911
  * @param request The HTTP request.
@@ -922,7 +924,7 @@ async function _handleCustomCollection(request, { name, values, context: context
922
924
  /**
923
925
  * Handles an ordered collection request.
924
926
  * @template TItem The type of items in the collection.
925
- * @template TParams The parameter names of the requested URL.
927
+ * @template TParam The parameter names of the requested URL.
926
928
  * @template TContext The type of the context, extending {@link RequestContext}.
927
929
  * @template TContextData The context data to pass to the `TContext`.
928
930
  * @param request The HTTP request.
@@ -943,7 +945,7 @@ async function _handleOrderedCollection(request, { name, values, context: contex
943
945
  * The main flow is on `getCollection`, `dispatch`.
944
946
  *
945
947
  * @template TItem The type of items in the collection.
946
- * @template TParams The parameter names of the requested URL.
948
+ * @template TParam The parameter names of the requested URL.
947
949
  * @template TContext The type of the context. {@link Context} or {@link RequestContext}.
948
950
  * @template TContextData The context data to pass to the `TContext`.
949
951
  * @template TCollection The type of the collection, extending {@link Collection}.
@@ -977,14 +979,14 @@ var CustomCollectionHandler = class {
977
979
  #collection = null;
978
980
  /**
979
981
  * Creates a new CustomCollection instance.
980
- * @param {string} name The name of the collection.
981
- * @param {TParams} values The parameter values for the collection.
982
- * @param {TContext} context The request context.
983
- * @param {CustomCollectionCallbacks} callbacks The collection callbacks.
984
- * @param {TracerProvider} tracerProvider The tracer provider for telemetry.
985
- * @param {ConstructorWithTypeId<TCollection>} Collection The Collection constructor.
986
- * @param {ConstructorWithTypeId<TCollectionPage>} CollectionPage The CollectionPage constructor.
987
- * @param {(item: TItem) => boolean} filterPredicate Optional filter predicate for items.
982
+ * @param name The name of the collection.
983
+ * @param values The parameter values for the collection.
984
+ * @param context The request context.
985
+ * @param callbacks The collection callbacks.
986
+ * @param tracerProvider The tracer provider for telemetry.
987
+ * @param Collection The Collection constructor.
988
+ * @param CollectionPage The CollectionPage constructor.
989
+ * @param filterPredicate Optional filter predicate for items.
988
990
  */
989
991
  constructor(name, values, context$1, callbacks, tracerProvider = trace.getTracerProvider(), Collection$1, CollectionPage$1, filterPredicate) {
990
992
  this.name = name;
@@ -1109,7 +1111,7 @@ var CustomCollectionHandler = class {
1109
1111
  /**
1110
1112
  * Creates a function to wrap the dispatcher so tracing can be applied.
1111
1113
  * @param params Parameters including cursor and total items.
1112
- * @returns {(span: Span) => Promise<PageItems<TItem>>} A function that handles the span operation.
1114
+ * @returns A function that handles the span operation.
1113
1115
  */
1114
1116
  spanPages = ({ totalItems = null, cursor = null }) => async (span) => {
1115
1117
  try {
@@ -1130,23 +1132,23 @@ var CustomCollectionHandler = class {
1130
1132
  };
1131
1133
  /**
1132
1134
  * Dispatches the collection request to get items.
1133
- * @param {string | null} cursor The cursor for pagination, or null for the first page.
1134
- * @returns {Promise<PageItems<TItem>>} A promise that resolves to the page items.
1135
+ * @param cursor The cursor for pagination, or null for the first page.
1136
+ * @returns A promise that resolves to the page items.
1135
1137
  */
1136
1138
  async dispatch(cursor = null) {
1137
1139
  return await this.#dispatcher(this.context, this.values, cursor) ?? new ItemsNotFoundError().throw();
1138
1140
  }
1139
1141
  /**
1140
1142
  * Filters the items in the collection.
1141
- * @param {TItem[]} items The items to filter.
1142
- * @returns {(Object | Link | URL)[]} The filtered items.
1143
+ * @param items The items to filter.
1144
+ * @returns The filtered items.
1143
1145
  */
1144
1146
  filterItems(items) {
1145
1147
  return filterCollectionItems(items, this.name, this.filterPredicate);
1146
1148
  }
1147
1149
  /**
1148
1150
  * Appends a cursor to the URL if it exists.
1149
- * @param {string | null | undefined} cursor The cursor to append, or null/undefined.
1151
+ * @param cursor The cursor to append, or null/undefined.
1150
1152
  * @returns The URL with cursor appended, or null if cursor is null/undefined.
1151
1153
  */
1152
1154
  appendToUrl(cursor) {
@@ -1154,8 +1156,7 @@ var CustomCollectionHandler = class {
1154
1156
  }
1155
1157
  /**
1156
1158
  * Gets the stored collection or collection page.
1157
- * @returns {Promise<TCollection | TCollectionPage>} A promise that resolves to
1158
- the collection or collection page.
1159
+ * @returns A promise that resolves to the collection or collection page.
1159
1160
  */
1160
1161
  get collection() {
1161
1162
  if (this.#collection === null) this.#collection = this.getCollection();
@@ -1163,8 +1164,8 @@ var CustomCollectionHandler = class {
1163
1164
  }
1164
1165
  /**
1165
1166
  * Gets the total number of items in the collection.
1166
- * @returns {Promise<number | null>} A promise that
1167
- resolves to the total items count, or null if not available.
1167
+ * @returns A promise that resolves to the total items count,
1168
+ * or null if not available.
1168
1169
  */
1169
1170
  get totalItems() {
1170
1171
  if (this.#totalItems === void 0) this.totalItems = this.callbacks.counter?.(this.context, this.values);
@@ -1180,8 +1181,8 @@ var CustomCollectionHandler = class {
1180
1181
  }
1181
1182
  /**
1182
1183
  * Gets the first cursor for pagination.
1183
- * @returns {Promise<string | null>} A promise that resolves to the first cursor,
1184
- or null if not available.
1184
+ * @returns A promise that resolves to the first cursor,
1185
+ * or null if not available.
1185
1186
  */
1186
1187
  get firstCursor() {
1187
1188
  const cursor = this.callbacks.firstCursor?.(this.context, this.values);
@@ -2151,7 +2152,8 @@ var FederationImpl = class extends FederationBuilderImpl {
2151
2152
  onNotFound,
2152
2153
  signatureTimeWindow: this.signatureTimeWindow,
2153
2154
  skipSignatureVerification: this.skipSignatureVerification,
2154
- tracerProvider: this.tracerProvider
2155
+ tracerProvider: this.tracerProvider,
2156
+ idempotencyStrategy: this.idempotencyStrategy
2155
2157
  });
2156
2158
  case "following": return await handleCollection(request, {
2157
2159
  name: "following",
@@ -2542,15 +2544,16 @@ var ContextImpl = class ContextImpl {
2542
2544
  "actor"
2543
2545
  ]);
2544
2546
  if (this.federation.actorCallbacks?.keyPairsDispatcher == null) throw new Error("No actor key pairs dispatcher registered.");
2545
- const path = this.federation.router.build("actor", {
2546
- identifier,
2547
- handle: identifier
2548
- });
2549
- if (path == null) {
2550
- logger$2.warn("No actor dispatcher registered.");
2551
- return [];
2547
+ let actorUri;
2548
+ try {
2549
+ actorUri = this.getActorUri(identifier);
2550
+ } catch (error) {
2551
+ if (error instanceof RouterError) {
2552
+ logger$2.warn(error.message);
2553
+ return [];
2554
+ }
2555
+ throw error;
2552
2556
  }
2553
- const actorUri = new URL(path, this.canonicalOrigin);
2554
2557
  const keyPairs = await this.federation.actorCallbacks?.keyPairsDispatcher(new ContextImpl({
2555
2558
  ...this,
2556
2559
  invokedFromActorKeyPairsDispatcher: { identifier }
@@ -2711,12 +2714,11 @@ var ContextImpl = class ContextImpl {
2711
2714
  if (identifier == null) throw new Error("If recipients is \"followers\", sender must be an actor identifier or username.");
2712
2715
  expandedRecipients = [];
2713
2716
  for await (const recipient of this.getFollowers(identifier)) expandedRecipients.push(recipient);
2714
- if (options.syncCollection) {
2715
- const collectionId = this.federation.router.build("followers", {
2716
- identifier,
2717
- handle: identifier
2718
- });
2719
- opts.collectionSync = collectionId == null ? void 0 : new URL(collectionId, this.canonicalOrigin).href;
2717
+ if (options.syncCollection) try {
2718
+ opts.collectionSync = this.getFollowersUri(identifier).href;
2719
+ } catch (error) {
2720
+ if (error instanceof RouterError) opts.collectionSync = void 0;
2721
+ else throw error;
2720
2722
  }
2721
2723
  } else expandedRecipients = [recipients];
2722
2724
  span.setAttribute("activitypub.inboxes", expandedRecipients.length);
@@ -2901,7 +2903,8 @@ var ContextImpl = class ContextImpl {
2901
2903
  kvPrefixes: this.federation.kvPrefixes,
2902
2904
  queue: this.federation.inboxQueue,
2903
2905
  span,
2904
- tracerProvider: options.tracerProvider ?? this.tracerProvider
2906
+ tracerProvider: options.tracerProvider ?? this.tracerProvider,
2907
+ idempotencyStrategy: this.federation.idempotencyStrategy
2905
2908
  });
2906
2909
  return routeResult === "alreadyProcessed" || routeResult === "enqueued" || routeResult === "unsupportedActivity" || routeResult === "success";
2907
2910
  }