@fedify/fedify 2.4.0-dev.2065 → 2.4.0-dev.2073

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 (98) hide show
  1. package/dist/{builder-CMkrnYbY.mjs → builder-CVHpPAjK.mjs} +6 -2
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{compound-proof-Dj3DCsoj.mjs → compound-proof-B5Skp-vE.mjs} +1 -1
  6. package/dist/{context-D_gg4M0n.d.ts → context-BSywYspi.d.ts} +153 -2
  7. package/dist/{context-b36TpPoG.d.cts → context-CZjZYXFC.d.cts} +153 -2
  8. package/dist/{context-DG5QeQ8W.mjs → context-DlZhxdFT.mjs} +2 -1
  9. package/dist/{deno-BuRFI7wk.mjs → deno-LYTbBhYV.mjs} +1 -1
  10. package/dist/{docloader-_aSNLA90.mjs → docloader-C0SWQylk.mjs} +2 -2
  11. package/dist/federation/builder.test.mjs +1 -1
  12. package/dist/federation/compound-fanout.test.mjs +4 -4
  13. package/dist/federation/handler-compound-proof.test.mjs +4 -4
  14. package/dist/federation/handler.test.mjs +6 -6
  15. package/dist/federation/hashlink-media.test.mjs +2 -2
  16. package/dist/federation/idempotency.test.mjs +2 -2
  17. package/dist/federation/metrics.test.mjs +1 -1
  18. package/dist/federation/middleware.test.mjs +9 -9
  19. package/dist/federation/mod.cjs +1 -1
  20. package/dist/federation/mod.d.cts +3 -3
  21. package/dist/federation/mod.d.ts +3 -3
  22. package/dist/federation/mod.js +1 -1
  23. package/dist/federation/outgoing-proof.test.mjs +6 -6
  24. package/dist/federation/portable-gateway-keys.test.d.mts +2 -0
  25. package/dist/federation/portable-gateway-keys.test.mjs +363 -0
  26. package/dist/federation/portable-inbox.test.d.mts +2 -0
  27. package/dist/federation/portable-inbox.test.mjs +546 -0
  28. package/dist/federation/portable.test.mjs +3 -3
  29. package/dist/federation/send.test.mjs +3 -3
  30. package/dist/federation/tasks/enqueue.test.mjs +2 -2
  31. package/dist/federation/tasks/tasks.test.mjs +3 -3
  32. package/dist/federation/temporal.test.mjs +1 -1
  33. package/dist/federation/webfinger.test.mjs +2 -2
  34. package/dist/{federation-Coi_bg12.cjs → federation-B1aeTKKN.cjs} +631 -145
  35. package/dist/{http-f1qaBtOh.mjs → http-C7qHlv-b.mjs} +20 -5
  36. package/dist/{http-BGShIsd6.cjs → http-DGk8XI38.cjs} +2684 -48
  37. package/dist/{http-65PYi9jY.d.ts → http-n2v6DPxu.d.ts} +52 -2
  38. package/dist/http-vfTpzGEq.js +5087 -0
  39. package/dist/{http-CP-7OdSq.d.cts → http-xlG-jRdB.d.cts} +52 -2
  40. package/dist/{key-BxHsA1s9.mjs → key-BYXnTGro.mjs} +147 -7
  41. package/dist/{kv-cache-Cgj-kpQS.js → kv-cache-DCJuwdnB.js} +1 -1
  42. package/dist/{kv-cache-C9IY-FMN.mjs → kv-cache-DEH5jyND.mjs} +1 -1
  43. package/dist/{kv-cache-CY6pDNoS.cjs → kv-cache-DvqkKNIj.cjs} +1 -1
  44. package/dist/{ld-CqJq5erX.mjs → ld-DT3e2hOv.mjs} +3 -3
  45. package/dist/{metrics-DOqknlZd.mjs → metrics-DvlvYpq_.mjs} +1 -1
  46. package/dist/{middleware-VOCZN3SO.mjs → middleware-BJcez_E3.mjs} +1 -1
  47. package/dist/{middleware-1h_LgwXC.js → middleware-CCbyUF4c.js} +547 -62
  48. package/dist/{middleware-s-AZzx4r.mjs → middleware-CpyCNOW_.mjs} +549 -72
  49. package/dist/{mod-BhMvsgdF.d.ts → mod-B2h2KY0q.d.ts} +1 -1
  50. package/dist/{mod-Dhm7SqyE.d.ts → mod-C9WSpZWm.d.ts} +1 -1
  51. package/dist/{mod-C0BYc0OU.d.ts → mod-CVZrXSdm.d.ts} +1 -1
  52. package/dist/{mod-pLbeNwcC.d.cts → mod-HDSvS-ww.d.cts} +1 -1
  53. package/dist/{mod-Bfenkg_c.d.cts → mod-JzkaEXsi.d.cts} +1 -1
  54. package/dist/{mod-CyiSjRkk.d.cts → mod-xGFCHqq_.d.cts} +1 -1
  55. package/dist/mod.cjs +18 -18
  56. package/dist/mod.d.cts +7 -7
  57. package/dist/mod.d.ts +7 -7
  58. package/dist/mod.js +5 -5
  59. package/dist/nodeinfo/handler.test.mjs +2 -2
  60. package/dist/{owner-D_F22lfM.mjs → owner-CDsVeZI7.mjs} +45 -2
  61. package/dist/owner-DCIH7Iq0.cjs +225 -0
  62. package/dist/owner-DfGz0cXm.js +215 -0
  63. package/dist/portable-key-DCyKGCQd.mjs +194 -0
  64. package/dist/{proof-B03JXhrk.mjs → proof-CxsVG6vM.mjs} +5 -5
  65. package/dist/{send-NNkfKtVN.mjs → send-BZJ7NsVV.mjs} +8 -4
  66. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  67. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  68. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  69. package/dist/sig/compound-proof.test.mjs +3 -3
  70. package/dist/sig/http.test.mjs +2 -2
  71. package/dist/sig/key.test.mjs +1 -1
  72. package/dist/sig/ld.test.mjs +2 -2
  73. package/dist/sig/mod.cjs +16 -16
  74. package/dist/sig/mod.d.cts +2 -2
  75. package/dist/sig/mod.d.ts +2 -2
  76. package/dist/sig/mod.js +3 -3
  77. package/dist/sig/owner.test.mjs +1 -1
  78. package/dist/sig/portable-collection.test.mjs +3 -3
  79. package/dist/sig/portable-key.test.d.mts +2 -0
  80. package/dist/sig/portable-key.test.mjs +275 -0
  81. package/dist/sig/proof.test.mjs +4 -4
  82. package/dist/{sig-B1E2uyhQ.cjs → sig-C6TnADze.cjs} +4 -4
  83. package/dist/{sig-Bb20Pyrd.js → sig-Cs9_ecdh.js} +2 -2
  84. package/dist/{temporal-VVVSuruq.mjs → temporal-CLzSfIOV.mjs} +1 -1
  85. package/dist/testing/kv.test.mjs +1 -1
  86. package/dist/testing/mod.d.mts +151 -0
  87. package/dist/testing/mod.mjs +2 -2
  88. package/dist/{testing-By1YYsIK.mjs → testing-CO_cEvQc.mjs} +1 -1
  89. package/dist/utils/docloader.test.mjs +2 -2
  90. package/dist/utils/kv-cache.test.mjs +1 -1
  91. package/dist/utils/mod.cjs +1 -1
  92. package/dist/utils/mod.d.cts +1 -1
  93. package/dist/utils/mod.d.ts +1 -1
  94. package/dist/utils/mod.js +1 -1
  95. package/package.json +6 -6
  96. package/dist/http-z5n7chWw.js +0 -2647
  97. package/dist/owner-BLBWXCNt.js +0 -2276
  98. package/dist/owner-D8ZpRusc.cjs +0 -2446
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-BuRFI7wk.mjs";
4
+ import { n as version, t as name } from "./deno-LYTbBhYV.mjs";
5
5
  import { t as ActivityListenerSet } from "./activity-listener-C-BSbKI7.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
@@ -86,7 +86,7 @@ var FederationBuilderImpl = class {
86
86
  * specified.
87
87
  */
88
88
  async build(options) {
89
- const { FederationImpl } = await import("./middleware-VOCZN3SO.mjs");
89
+ const { FederationImpl } = await import("./middleware-BJcez_E3.mjs");
90
90
  const f = new FederationImpl(options);
91
91
  const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
92
92
  f.router = this.router.clone();
@@ -234,6 +234,10 @@ var FederationBuilderImpl = class {
234
234
  callbacks.aliasMapper = mapper;
235
235
  return setters;
236
236
  },
237
+ mapPortableActorId(mapper) {
238
+ callbacks.portableActorIdMapper = mapper;
239
+ return setters;
240
+ },
237
241
  mapActorAlias: (path, identifier) => {
238
242
  if (identifier === "") throw new RouterError("Identifier cannot be empty.");
239
243
  if (this.router.has(`actorAlias:${identifier}`)) throw new RouterError(`Actor alias for "${identifier}" already set.`);
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Jt as ActivityTransformer, n as Context } from "../context-b36TpPoG.cjs";
2
+ import { Xt as ActivityTransformer, n as Context } from "../context-CZjZYXFC.cjs";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Jt as ActivityTransformer, n as Context } from "../context-D_gg4M0n.js";
2
+ import { Xt as ActivityTransformer, n as Context } from "../context-BSywYspi.js";
3
3
  import { Activity } from "@fedify/vocab";
4
4
 
5
5
  //#region src/compat/transformers.d.ts
@@ -5,7 +5,7 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
5
5
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
7
7
  import { t as assert } from "../assert-D1Eafmd_.mjs";
8
- import { S as autoIdAssigner, n as FederationImpl, x as actorDehydrator } from "../middleware-s-AZzx4r.mjs";
8
+ import { C as actorDehydrator, n as FederationImpl, w as autoIdAssigner } from "../middleware-CpyCNOW_.mjs";
9
9
  import { Follow, Person } from "@fedify/vocab";
10
10
  import { test } from "@fedify/fixture";
11
11
  //#region src/compat/transformers.test.ts
@@ -1,7 +1,7 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "./proof-B03JXhrk.mjs";
4
+ import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "./proof-CxsVG6vM.mjs";
5
5
  //#region src/sig/compound-proof.ts
6
6
  const textEncoder = new TextEncoder();
7
7
  const PORTABLE_OBJECT_ID_PATTERN = /^ap(?:\+ef61)?:\/\//i;
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-D-XP_Ccb.js";
3
- import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-65PYi9jY.js";
3
+ import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-n2v6DPxu.js";
4
4
  import { n as GetKeyOwnerOptions } from "./owner-BSzr5-I8.js";
5
5
  import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.js";
6
6
  import { Router } from "@fedify/uri-template";
@@ -144,6 +144,25 @@ type ActorKeyPairsDispatcher<TContextData> = (context: Context<TContextData>, id
144
144
  */
145
145
  type ActorHandleMapper<TContextData> = (context: Context<TContextData>, username: string) => string | null | Promise<string | null>;
146
146
  /**
147
+ * A callback that maps an actor's internal identifier to the ID of the
148
+ * [FEP-ef61] portable actor it dispatches, or `null` if the actor is not
149
+ * portable.
150
+ *
151
+ * The returned ID is an `ap:` or `ap+ef61:` URI, e.g.,
152
+ * `ap+ef61://did:key:z6Mk.../actors/alice`, or its compatible identifier.
153
+ * It must be the same ID that the actor dispatcher puts in the actor's `id`,
154
+ * and must not have a fragment.
155
+ *
156
+ * [FEP-ef61]: https://w3id.org/fep/ef61
157
+ *
158
+ * @template TContextData The context data to pass to the {@link Context}.
159
+ * @param context The context.
160
+ * @param identifier The actor's internal identifier.
161
+ * @returns The portable actor's ID, or `null` if the actor is not portable.
162
+ * @since 2.4.0
163
+ */
164
+ type PortableActorIdMapper<TContextData> = (context: Context<TContextData>, identifier: string) => URL | null | Promise<URL | null>;
165
+ /**
147
166
  * A callback that maps a WebFinger query to the corresponding actor's
148
167
  * internal identifier or username, or `null` if the query is not found.
149
168
  * @template TContextData The context data to pass to the {@link Context}.
@@ -1405,6 +1424,16 @@ interface FederationKvPrefixes {
1405
1424
  * @since 2.4.0
1406
1425
  */
1407
1426
  readonly taskDeduplication: KvKey;
1427
+ /**
1428
+ * The key prefix used for remembering which activities received in
1429
+ * [FEP-ef61] portable inboxes have been forwarded to which gateways, so that
1430
+ * each activity is forwarded at most once.
1431
+ *
1432
+ * [FEP-ef61]: https://w3id.org/fep/ef61
1433
+ * @default `["_fedify", "portableInboxForwarding"]`
1434
+ * @since 2.4.0
1435
+ */
1436
+ readonly portableInboxForwarding: KvKey;
1408
1437
  }
1409
1438
  /**
1410
1439
  * Options for {@link FederationOptions.origin} when it is not a string.
@@ -2011,6 +2040,44 @@ interface FederationBuilder<TContextData> extends Federatable<TContextData> {
2011
2040
  build(options: FederationOptions<TContextData>): Promise<Federation<TContextData>>;
2012
2041
  }
2013
2042
  /**
2043
+ * Options for forwarding activities received in [FEP-ef61] portable inboxes to
2044
+ * the other gateways of their actors. See
2045
+ * {@link FederationOptions.portableInboxForwarding}.
2046
+ *
2047
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2048
+ * @since 2.4.0
2049
+ */
2050
+ interface PortableInboxForwardingOptions {
2051
+ /**
2052
+ * The maximum number of other gateways that a single delivery is forwarded
2053
+ * to. Gateways beyond it are skipped with a warning. `0` turns off
2054
+ * forwarding.
2055
+ * @default `10`
2056
+ */
2057
+ maxTargets?: number;
2058
+ /**
2059
+ * How long Fedify remembers that it has forwarded an activity from
2060
+ * a portable inbox to a gateway, under
2061
+ * {@link FederationKvPrefixes.portableInboxForwarding}. Within it, the same
2062
+ * activity is never forwarded to the same gateway again; once it expires,
2063
+ * a redelivery of the activity may be forwarded again. It cannot have
2064
+ * calendar units, i.e., weeks, months, or years.
2065
+ * @default `{ days: 30 }`
2066
+ */
2067
+ ttl?: Temporal.DurationLike;
2068
+ /**
2069
+ * How long a delivery waits for forwarding requests made immediately, i.e.,
2070
+ * when no outbox queue is configured, before Fedify responds to it.
2071
+ * Requests still running afterwards continue in the background. It does
2072
+ * not apply when forwarding is queued. It cannot have calendar units,
2073
+ * i.e., weeks, months, or years, and cannot be longer than
2074
+ * 2,147,483,647 milliseconds (about 24.8 days), the longest delay timers
2075
+ * support.
2076
+ * @default `{ seconds: 10 }`
2077
+ */
2078
+ deadline?: Temporal.DurationLike;
2079
+ }
2080
+ /**
2014
2081
  * Policy for emitting `Accept-Signature` challenges on inbox `401`
2015
2082
  * responses, as defined in
2016
2083
  * [RFC 9421 §5](https://www.rfc-editor.org/rfc/rfc9421#section-5).
@@ -2105,6 +2172,14 @@ interface FederationOptions<TContextData> {
2105
2172
  */
2106
2173
  httpMessageSignaturesSpecTtl?: Temporal.DurationLike;
2107
2174
  /**
2175
+ * Options for forwarding activities received in [FEP-ef61] portable inboxes
2176
+ * to the other gateways of their actors.
2177
+ *
2178
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2179
+ * @since 2.4.0
2180
+ */
2181
+ portableInboxForwarding?: PortableInboxForwardingOptions;
2182
+ /**
2108
2183
  * The message queue for sending and receiving activities. If not provided,
2109
2184
  * activities will not be queued and will be processed immediately.
2110
2185
  *
@@ -2399,6 +2474,30 @@ interface ActorCallbackSetters<TContextData> {
2399
2474
  */
2400
2475
  mapAlias(mapper: ActorAliasMapper<TContextData>): ActorCallbackSetters<TContextData>;
2401
2476
  /**
2477
+ * Sets the callback function that maps an actor's identifier to the ID of
2478
+ * the [FEP-ef61] portable actor it dispatches. If the callback returns
2479
+ * a portable ID for an identifier, the key pairs of that actor are treated
2480
+ * as this server's *gateway keys* for the portable actor:
2481
+ * {@link Context.getActorKeyPairs} derives their key IDs from the actor's
2482
+ * compatible identifier on this server, e.g.,
2483
+ * `https://example.com/.well-known/apgateway/did:key:z6Mk.../actors/alice#main-key`,
2484
+ * and makes the portable actor their owner, so that requests this server
2485
+ * makes on behalf of the actor, such as activity deliveries and signed
2486
+ * fetches, are signed with them. Gateway keys are only used for HTTP
2487
+ * Signatures; they never make Object Integrity Proofs or Linked Data
2488
+ * Signatures.
2489
+ *
2490
+ * If it's omitted, or it returns `null`, the actor's keys are derived from
2491
+ * {@link Context.getActorUri} as usual.
2492
+ *
2493
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2494
+ * @param mapper A callback that maps an actor's identifier to its portable
2495
+ * ID, or `null` if the actor is not portable.
2496
+ * @returns The setters object so that settings can be chained.
2497
+ * @since 2.4.0
2498
+ */
2499
+ mapPortableActorId(mapper: PortableActorIdMapper<TContextData>): ActorCallbackSetters<TContextData>;
2500
+ /**
2402
2501
  * Maps a fixed path to a sentinel identifier. It is useful for exposing
2403
2502
  * a single, instance-level actor at a fixed path, such as `/actor` for
2404
2503
  * a relay or `/bot` for a bot.
@@ -2864,6 +2963,35 @@ interface Context<TContextData> {
2864
2963
  */
2865
2964
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
2866
2965
  /**
2966
+ * Builds the [FEP-ef61] portable ID of an actor's inbox with the given
2967
+ * identifier under the given DID authority.
2968
+ *
2969
+ * The path is the same as the one {@link Context.getInboxUri} builds from
2970
+ * the inbox path, but the result is an `ap+ef61:` URI whose authority is
2971
+ * the DID, e.g., `ap+ef61://did:key:z6Mk.../users/alice/inbox`. If
2972
+ * a portable actor has it as its `inbox` and lists this server in its
2973
+ * `gateways`, this server accepts deliveries to the inbox through
2974
+ * the FEP-ef61 gateway endpoint, e.g.,
2975
+ * `POST /.well-known/apgateway/did:key:z6Mk.../users/alice/inbox`, and
2976
+ * dispatches them to the inbox listeners.
2977
+ *
2978
+ * The returned `URL` keeps the DID authority percent-encoded, because
2979
+ * the `URL` class cannot represent the canonical form. Use `formatIri()`
2980
+ * from `@fedify/vocab-runtime` to get the canonical string.
2981
+ *
2982
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2983
+ *
2984
+ * @param identifier The actor's identifier.
2985
+ * @param authority The DID that controls the actor, e.g.,
2986
+ * `did:key:z6Mk...`. It must be a bare DID, without
2987
+ * a path, query, or fragment.
2988
+ * @returns The inbox's portable ID.
2989
+ * @throws {RouterError} If no inbox path is registered.
2990
+ * @throws {TypeError} If the authority is not a DID.
2991
+ * @since 2.4.0
2992
+ */
2993
+ getPortableInboxUri(identifier: string, authority: string): URL;
2994
+ /**
2867
2995
  * Builds the URI of an actor's outbox with the given identifier.
2868
2996
  * @param identifier The actor's identifier.
2869
2997
  * @returns The actor's outbox URI.
@@ -3278,6 +3406,29 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3278
3406
  */
3279
3407
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
3280
3408
  /**
3409
+ * Builds the [FEP-ef61] portable ID of an actor's inbox with the given
3410
+ * identifier. It works the same as {@link Context.getPortableInboxUri},
3411
+ * except that the authority can be omitted while handling a portable object
3412
+ * request, i.e., when {@link RequestContext.portableRequest} is set. In
3413
+ * that case, its DID is used. Deliveries to portable inboxes do not set
3414
+ * {@link RequestContext.portableRequest}, so pass the authority explicitly
3415
+ * while handling them.
3416
+ *
3417
+ * [FEP-ef61]: https://w3id.org/fep/ef61
3418
+ *
3419
+ * @param identifier The actor's identifier.
3420
+ * @param authority The DID that controls the actor, e.g.,
3421
+ * `did:key:z6Mk...`. It must be a bare DID, without
3422
+ * a path, query, or fragment. Defaults to the DID of
3423
+ * the requested portable object, if any.
3424
+ * @returns The inbox's portable ID.
3425
+ * @throws {RouterError} If no inbox path is registered.
3426
+ * @throws {TypeError} If the authority is not a DID, or the authority is
3427
+ * omitted outside a portable gateway request.
3428
+ * @since 2.4.0
3429
+ */
3430
+ getPortableInboxUri(identifier: string, authority?: string): URL;
3431
+ /**
3281
3432
  * Creates a new context with the same properties as this one,
3282
3433
  * but with the given data.
3283
3434
  * @param data The new data to associate with the context.
@@ -3752,4 +3903,4 @@ interface ActorKeyPair extends CryptoKeyPair {
3752
3903
  readonly multikey: Multikey;
3753
3904
  }
3754
3905
  //#endregion
3755
- export { MessageQueue as $, ObjectCallbackSetters as A, InboxListener as At, TaskDefinitionOptions as B, UnverifiedActivityHandler as Bt, FederationOptions as C, CollectionDispatcher as Ct, InboxChallengePolicy as D, HashlinkMediaDispatcher as Dt, IdempotencyStrategy as E, CustomCollectionDispatcher as Et, FederationQueueOptions as F, OutboxErrorHandler as Ft, RetryContext as G, PageItems as Gt, TaskHandler as H, WebFingerLinksDispatcher as Ht, createFederation as I, OutboxListener as It, RespondWithObjectOptions as J, ActivityTransformer as Jt, RetryPolicy as K, buildCollectionSynchronizationHeader as Kt, Message as L, OutboxListenerErrorHandler as Lt, Rfc6570Expression as M, NodeInfoDispatcher as Mt, FederationKvPrefixes as N, ObjectAuthorizePredicate as Nt, InboxListenerSetters as O, HashlinkMediaRequest as Ot, FederationOrigin as P, ObjectDispatcher as Pt, InProcessMessageQueueOptions as Q, createFederationBuilder as R, OutboxPermanentFailureHandler as Rt, FederationFetchOptions as S, CollectionCursor as St, IdempotencyKeyCallback as T, CustomCollectionCursor as Tt, TaskRegistry as U, SendActivityError as Ut, TaskEnqueueOptions as V, UnverifiedActivityReason as Vt, CreateExponentialBackoffPolicyOptions as W, SenderKeyPair as Wt, respondWithObjectIfAcceptable as X, respondWithObject as Y, InProcessMessageQueue as Z, CustomCollectionCallbackSetters as _, ActorDispatcher as _t, GetSignedKeyOptions as a, CircuitBreakerActivityDrop as at, FederationBenchmarkOptions as b, AuthorizePredicate as bt, ParseUriResult as c, CircuitBreakerFailurePolicy as ct, RouteActivityOptions as d, CircuitBreakerState as dt, MessageQueueDepth as et, SendActivityOptions as f, CircuitBreakerStateChange as ft, ConstructorWithTypeId as g, ActorAliasMapper as gt, CollectionCallbackSetters as h, parseCircuitBreakerKvState as ht, GetActorOptions as i, CircuitBreaker as it, OutboxListenerSetters as j, MediaUploaderCallback as jt, MediaUploaderSetters as k, InboxErrorHandler as kt, PortableRequest as l, CircuitBreakerKvState as lt, ActorCallbackSetters as m, normalizeCircuitBreakerOptions as mt, Context as n, MessageQueueListenOptions as nt, InboxContext as o, CircuitBreakerBeforeSendDecision as ot, SendActivityOptionsForCollection as p, NormalizedCircuitBreakerOptions as pt, createExponentialBackoffPolicy as q, digest as qt, ForwardActivityOptions as r, ParallelMessageQueue as rt, OutboxContext as s, CircuitBreakerCreateOptions as st, ActorKeyPair as t, MessageQueueEnqueueOptions as tt, RequestContext as u, CircuitBreakerOptions as ut, Federatable as v, ActorHandleMapper as vt, FederationStartQueueOptions as w, CustomCollectionCounter as wt, FederationBuilder as x, CollectionCounter as xt, Federation as y, ActorKeyPairsDispatcher as yt, TaskDefinition as z, SharedInboxKeyDispatcher as zt };
3906
+ export { InProcessMessageQueueOptions as $, ObjectCallbackSetters as A, InboxErrorHandler as At, TaskDefinition as B, PortableActorIdMapper as Bt, FederationOptions as C, CollectionCursor as Ct, InboxChallengePolicy as D, CustomCollectionDispatcher as Dt, IdempotencyStrategy as E, CustomCollectionCursor as Et, FederationOrigin as F, ObjectDispatcher as Ft, CreateExponentialBackoffPolicyOptions as G, SendActivityError as Gt, TaskEnqueueOptions as H, UnverifiedActivityHandler as Ht, FederationQueueOptions as I, OutboxErrorHandler as It, createExponentialBackoffPolicy as J, buildCollectionSynchronizationHeader as Jt, RetryContext as K, SenderKeyPair as Kt, createFederation as L, OutboxListener as Lt, PortableInboxForwardingOptions as M, MediaUploaderCallback as Mt, Rfc6570Expression as N, NodeInfoDispatcher as Nt, InboxListenerSetters as O, HashlinkMediaDispatcher as Ot, FederationKvPrefixes as P, ObjectAuthorizePredicate as Pt, InProcessMessageQueue as Q, Message as R, OutboxListenerErrorHandler as Rt, FederationFetchOptions as S, CollectionCounter as St, IdempotencyKeyCallback as T, CustomCollectionCounter as Tt, TaskHandler as U, UnverifiedActivityReason as Ut, TaskDefinitionOptions as V, SharedInboxKeyDispatcher as Vt, TaskRegistry as W, WebFingerLinksDispatcher as Wt, respondWithObject as X, ActivityTransformer as Xt, RespondWithObjectOptions as Y, digest as Yt, respondWithObjectIfAcceptable as Z, CustomCollectionCallbackSetters as _, ActorAliasMapper as _t, GetSignedKeyOptions as a, CircuitBreaker as at, FederationBenchmarkOptions as b, ActorKeyPairsDispatcher as bt, ParseUriResult as c, CircuitBreakerCreateOptions as ct, RouteActivityOptions as d, CircuitBreakerOptions as dt, MessageQueue as et, SendActivityOptions as f, CircuitBreakerState as ft, ConstructorWithTypeId as g, parseCircuitBreakerKvState as gt, CollectionCallbackSetters as h, normalizeCircuitBreakerOptions as ht, GetActorOptions as i, ParallelMessageQueue as it, OutboxListenerSetters as j, InboxListener as jt, MediaUploaderSetters as k, HashlinkMediaRequest as kt, PortableRequest as l, CircuitBreakerFailurePolicy as lt, ActorCallbackSetters as m, NormalizedCircuitBreakerOptions as mt, Context as n, MessageQueueEnqueueOptions as nt, InboxContext as o, CircuitBreakerActivityDrop as ot, SendActivityOptionsForCollection as p, CircuitBreakerStateChange as pt, RetryPolicy as q, PageItems as qt, ForwardActivityOptions as r, MessageQueueListenOptions as rt, OutboxContext as s, CircuitBreakerBeforeSendDecision as st, ActorKeyPair as t, MessageQueueDepth as tt, RequestContext as u, CircuitBreakerKvState as ut, Federatable as v, ActorDispatcher as vt, FederationStartQueueOptions as w, CollectionDispatcher as wt, FederationBuilder as x, AuthorizePredicate as xt, Federation as y, ActorHandleMapper as yt, createFederationBuilder as z, OutboxPermanentFailureHandler as zt };
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { o as JsonValue, s as NodeInfo, t as GetNodeInfoOptions } from "./client-D-XP_Ccb.cjs";
3
- import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-CP-7OdSq.cjs";
3
+ import { o as VerifyRequestFailureReason, t as HttpMessageSignaturesSpec } from "./http-xlG-jRdB.cjs";
4
4
  import { n as GetKeyOwnerOptions } from "./owner-BF0L9cMt.cjs";
5
5
  import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.cjs";
6
6
  import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, Tombstone, TraverseCollectionOptions } from "@fedify/vocab";
@@ -142,6 +142,25 @@ type ActorKeyPairsDispatcher<TContextData> = (context: Context<TContextData>, id
142
142
  */
143
143
  type ActorHandleMapper<TContextData> = (context: Context<TContextData>, username: string) => string | null | Promise<string | null>;
144
144
  /**
145
+ * A callback that maps an actor's internal identifier to the ID of the
146
+ * [FEP-ef61] portable actor it dispatches, or `null` if the actor is not
147
+ * portable.
148
+ *
149
+ * The returned ID is an `ap:` or `ap+ef61:` URI, e.g.,
150
+ * `ap+ef61://did:key:z6Mk.../actors/alice`, or its compatible identifier.
151
+ * It must be the same ID that the actor dispatcher puts in the actor's `id`,
152
+ * and must not have a fragment.
153
+ *
154
+ * [FEP-ef61]: https://w3id.org/fep/ef61
155
+ *
156
+ * @template TContextData The context data to pass to the {@link Context}.
157
+ * @param context The context.
158
+ * @param identifier The actor's internal identifier.
159
+ * @returns The portable actor's ID, or `null` if the actor is not portable.
160
+ * @since 2.4.0
161
+ */
162
+ type PortableActorIdMapper<TContextData> = (context: Context<TContextData>, identifier: string) => URL | null | Promise<URL | null>;
163
+ /**
145
164
  * A callback that maps a WebFinger query to the corresponding actor's
146
165
  * internal identifier or username, or `null` if the query is not found.
147
166
  * @template TContextData The context data to pass to the {@link Context}.
@@ -1403,6 +1422,16 @@ interface FederationKvPrefixes {
1403
1422
  * @since 2.4.0
1404
1423
  */
1405
1424
  readonly taskDeduplication: KvKey;
1425
+ /**
1426
+ * The key prefix used for remembering which activities received in
1427
+ * [FEP-ef61] portable inboxes have been forwarded to which gateways, so that
1428
+ * each activity is forwarded at most once.
1429
+ *
1430
+ * [FEP-ef61]: https://w3id.org/fep/ef61
1431
+ * @default `["_fedify", "portableInboxForwarding"]`
1432
+ * @since 2.4.0
1433
+ */
1434
+ readonly portableInboxForwarding: KvKey;
1406
1435
  }
1407
1436
  /**
1408
1437
  * Options for {@link FederationOptions.origin} when it is not a string.
@@ -2009,6 +2038,44 @@ interface FederationBuilder<TContextData> extends Federatable<TContextData> {
2009
2038
  build(options: FederationOptions<TContextData>): Promise<Federation<TContextData>>;
2010
2039
  }
2011
2040
  /**
2041
+ * Options for forwarding activities received in [FEP-ef61] portable inboxes to
2042
+ * the other gateways of their actors. See
2043
+ * {@link FederationOptions.portableInboxForwarding}.
2044
+ *
2045
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2046
+ * @since 2.4.0
2047
+ */
2048
+ interface PortableInboxForwardingOptions {
2049
+ /**
2050
+ * The maximum number of other gateways that a single delivery is forwarded
2051
+ * to. Gateways beyond it are skipped with a warning. `0` turns off
2052
+ * forwarding.
2053
+ * @default `10`
2054
+ */
2055
+ maxTargets?: number;
2056
+ /**
2057
+ * How long Fedify remembers that it has forwarded an activity from
2058
+ * a portable inbox to a gateway, under
2059
+ * {@link FederationKvPrefixes.portableInboxForwarding}. Within it, the same
2060
+ * activity is never forwarded to the same gateway again; once it expires,
2061
+ * a redelivery of the activity may be forwarded again. It cannot have
2062
+ * calendar units, i.e., weeks, months, or years.
2063
+ * @default `{ days: 30 }`
2064
+ */
2065
+ ttl?: Temporal.DurationLike;
2066
+ /**
2067
+ * How long a delivery waits for forwarding requests made immediately, i.e.,
2068
+ * when no outbox queue is configured, before Fedify responds to it.
2069
+ * Requests still running afterwards continue in the background. It does
2070
+ * not apply when forwarding is queued. It cannot have calendar units,
2071
+ * i.e., weeks, months, or years, and cannot be longer than
2072
+ * 2,147,483,647 milliseconds (about 24.8 days), the longest delay timers
2073
+ * support.
2074
+ * @default `{ seconds: 10 }`
2075
+ */
2076
+ deadline?: Temporal.DurationLike;
2077
+ }
2078
+ /**
2012
2079
  * Policy for emitting `Accept-Signature` challenges on inbox `401`
2013
2080
  * responses, as defined in
2014
2081
  * [RFC 9421 §5](https://www.rfc-editor.org/rfc/rfc9421#section-5).
@@ -2103,6 +2170,14 @@ interface FederationOptions<TContextData> {
2103
2170
  */
2104
2171
  httpMessageSignaturesSpecTtl?: Temporal.DurationLike;
2105
2172
  /**
2173
+ * Options for forwarding activities received in [FEP-ef61] portable inboxes
2174
+ * to the other gateways of their actors.
2175
+ *
2176
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2177
+ * @since 2.4.0
2178
+ */
2179
+ portableInboxForwarding?: PortableInboxForwardingOptions;
2180
+ /**
2106
2181
  * The message queue for sending and receiving activities. If not provided,
2107
2182
  * activities will not be queued and will be processed immediately.
2108
2183
  *
@@ -2397,6 +2472,30 @@ interface ActorCallbackSetters<TContextData> {
2397
2472
  */
2398
2473
  mapAlias(mapper: ActorAliasMapper<TContextData>): ActorCallbackSetters<TContextData>;
2399
2474
  /**
2475
+ * Sets the callback function that maps an actor's identifier to the ID of
2476
+ * the [FEP-ef61] portable actor it dispatches. If the callback returns
2477
+ * a portable ID for an identifier, the key pairs of that actor are treated
2478
+ * as this server's *gateway keys* for the portable actor:
2479
+ * {@link Context.getActorKeyPairs} derives their key IDs from the actor's
2480
+ * compatible identifier on this server, e.g.,
2481
+ * `https://example.com/.well-known/apgateway/did:key:z6Mk.../actors/alice#main-key`,
2482
+ * and makes the portable actor their owner, so that requests this server
2483
+ * makes on behalf of the actor, such as activity deliveries and signed
2484
+ * fetches, are signed with them. Gateway keys are only used for HTTP
2485
+ * Signatures; they never make Object Integrity Proofs or Linked Data
2486
+ * Signatures.
2487
+ *
2488
+ * If it's omitted, or it returns `null`, the actor's keys are derived from
2489
+ * {@link Context.getActorUri} as usual.
2490
+ *
2491
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2492
+ * @param mapper A callback that maps an actor's identifier to its portable
2493
+ * ID, or `null` if the actor is not portable.
2494
+ * @returns The setters object so that settings can be chained.
2495
+ * @since 2.4.0
2496
+ */
2497
+ mapPortableActorId(mapper: PortableActorIdMapper<TContextData>): ActorCallbackSetters<TContextData>;
2498
+ /**
2400
2499
  * Maps a fixed path to a sentinel identifier. It is useful for exposing
2401
2500
  * a single, instance-level actor at a fixed path, such as `/actor` for
2402
2501
  * a relay or `/bot` for a bot.
@@ -2862,6 +2961,35 @@ interface Context<TContextData> {
2862
2961
  */
2863
2962
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority: string): URL;
2864
2963
  /**
2964
+ * Builds the [FEP-ef61] portable ID of an actor's inbox with the given
2965
+ * identifier under the given DID authority.
2966
+ *
2967
+ * The path is the same as the one {@link Context.getInboxUri} builds from
2968
+ * the inbox path, but the result is an `ap+ef61:` URI whose authority is
2969
+ * the DID, e.g., `ap+ef61://did:key:z6Mk.../users/alice/inbox`. If
2970
+ * a portable actor has it as its `inbox` and lists this server in its
2971
+ * `gateways`, this server accepts deliveries to the inbox through
2972
+ * the FEP-ef61 gateway endpoint, e.g.,
2973
+ * `POST /.well-known/apgateway/did:key:z6Mk.../users/alice/inbox`, and
2974
+ * dispatches them to the inbox listeners.
2975
+ *
2976
+ * The returned `URL` keeps the DID authority percent-encoded, because
2977
+ * the `URL` class cannot represent the canonical form. Use `formatIri()`
2978
+ * from `@fedify/vocab-runtime` to get the canonical string.
2979
+ *
2980
+ * [FEP-ef61]: https://w3id.org/fep/ef61
2981
+ *
2982
+ * @param identifier The actor's identifier.
2983
+ * @param authority The DID that controls the actor, e.g.,
2984
+ * `did:key:z6Mk...`. It must be a bare DID, without
2985
+ * a path, query, or fragment.
2986
+ * @returns The inbox's portable ID.
2987
+ * @throws {RouterError} If no inbox path is registered.
2988
+ * @throws {TypeError} If the authority is not a DID.
2989
+ * @since 2.4.0
2990
+ */
2991
+ getPortableInboxUri(identifier: string, authority: string): URL;
2992
+ /**
2865
2993
  * Builds the URI of an actor's outbox with the given identifier.
2866
2994
  * @param identifier The actor's identifier.
2867
2995
  * @returns The actor's outbox URI.
@@ -3276,6 +3404,29 @@ interface RequestContext<TContextData> extends Context<TContextData> {
3276
3404
  */
3277
3405
  getPortableObjectUri<TObject extends Object$1>(cls: ConstructorWithTypeId<TObject>, values: Record<string, string>, authority?: string): URL;
3278
3406
  /**
3407
+ * Builds the [FEP-ef61] portable ID of an actor's inbox with the given
3408
+ * identifier. It works the same as {@link Context.getPortableInboxUri},
3409
+ * except that the authority can be omitted while handling a portable object
3410
+ * request, i.e., when {@link RequestContext.portableRequest} is set. In
3411
+ * that case, its DID is used. Deliveries to portable inboxes do not set
3412
+ * {@link RequestContext.portableRequest}, so pass the authority explicitly
3413
+ * while handling them.
3414
+ *
3415
+ * [FEP-ef61]: https://w3id.org/fep/ef61
3416
+ *
3417
+ * @param identifier The actor's identifier.
3418
+ * @param authority The DID that controls the actor, e.g.,
3419
+ * `did:key:z6Mk...`. It must be a bare DID, without
3420
+ * a path, query, or fragment. Defaults to the DID of
3421
+ * the requested portable object, if any.
3422
+ * @returns The inbox's portable ID.
3423
+ * @throws {RouterError} If no inbox path is registered.
3424
+ * @throws {TypeError} If the authority is not a DID, or the authority is
3425
+ * omitted outside a portable gateway request.
3426
+ * @since 2.4.0
3427
+ */
3428
+ getPortableInboxUri(identifier: string, authority?: string): URL;
3429
+ /**
3279
3430
  * Creates a new context with the same properties as this one,
3280
3431
  * but with the given data.
3281
3432
  * @param data The new data to associate with the context.
@@ -3750,4 +3901,4 @@ interface ActorKeyPair extends CryptoKeyPair {
3750
3901
  readonly multikey: Multikey;
3751
3902
  }
3752
3903
  //#endregion
3753
- export { MessageQueue as $, ObjectCallbackSetters as A, InboxListener as At, TaskDefinitionOptions as B, UnverifiedActivityHandler as Bt, FederationOptions as C, CollectionDispatcher as Ct, InboxChallengePolicy as D, HashlinkMediaDispatcher as Dt, IdempotencyStrategy as E, CustomCollectionDispatcher as Et, FederationQueueOptions as F, OutboxErrorHandler as Ft, RetryContext as G, PageItems as Gt, TaskHandler as H, WebFingerLinksDispatcher as Ht, createFederation as I, OutboxListener as It, RespondWithObjectOptions as J, ActivityTransformer as Jt, RetryPolicy as K, buildCollectionSynchronizationHeader as Kt, Message as L, OutboxListenerErrorHandler as Lt, Rfc6570Expression as M, NodeInfoDispatcher as Mt, FederationKvPrefixes as N, ObjectAuthorizePredicate as Nt, InboxListenerSetters as O, HashlinkMediaRequest as Ot, FederationOrigin as P, ObjectDispatcher as Pt, InProcessMessageQueueOptions as Q, createFederationBuilder as R, OutboxPermanentFailureHandler as Rt, FederationFetchOptions as S, CollectionCursor as St, IdempotencyKeyCallback as T, CustomCollectionCursor as Tt, TaskRegistry as U, SendActivityError as Ut, TaskEnqueueOptions as V, UnverifiedActivityReason as Vt, CreateExponentialBackoffPolicyOptions as W, SenderKeyPair as Wt, respondWithObjectIfAcceptable as X, respondWithObject as Y, InProcessMessageQueue as Z, CustomCollectionCallbackSetters as _, ActorDispatcher as _t, GetSignedKeyOptions as a, CircuitBreakerActivityDrop as at, FederationBenchmarkOptions as b, AuthorizePredicate as bt, ParseUriResult as c, CircuitBreakerFailurePolicy as ct, RouteActivityOptions as d, CircuitBreakerState as dt, MessageQueueDepth as et, SendActivityOptions as f, CircuitBreakerStateChange as ft, ConstructorWithTypeId as g, ActorAliasMapper as gt, CollectionCallbackSetters as h, parseCircuitBreakerKvState as ht, GetActorOptions as i, CircuitBreaker as it, OutboxListenerSetters as j, MediaUploaderCallback as jt, MediaUploaderSetters as k, InboxErrorHandler as kt, PortableRequest as l, CircuitBreakerKvState as lt, ActorCallbackSetters as m, normalizeCircuitBreakerOptions as mt, Context as n, MessageQueueListenOptions as nt, InboxContext as o, CircuitBreakerBeforeSendDecision as ot, SendActivityOptionsForCollection as p, NormalizedCircuitBreakerOptions as pt, createExponentialBackoffPolicy as q, digest as qt, ForwardActivityOptions as r, ParallelMessageQueue as rt, OutboxContext as s, CircuitBreakerCreateOptions as st, ActorKeyPair as t, MessageQueueEnqueueOptions as tt, RequestContext as u, CircuitBreakerOptions as ut, Federatable as v, ActorHandleMapper as vt, FederationStartQueueOptions as w, CustomCollectionCounter as wt, FederationBuilder as x, CollectionCounter as xt, Federation as y, ActorKeyPairsDispatcher as yt, TaskDefinition as z, SharedInboxKeyDispatcher as zt };
3904
+ export { InProcessMessageQueueOptions as $, ObjectCallbackSetters as A, InboxErrorHandler as At, TaskDefinition as B, PortableActorIdMapper as Bt, FederationOptions as C, CollectionCursor as Ct, InboxChallengePolicy as D, CustomCollectionDispatcher as Dt, IdempotencyStrategy as E, CustomCollectionCursor as Et, FederationOrigin as F, ObjectDispatcher as Ft, CreateExponentialBackoffPolicyOptions as G, SendActivityError as Gt, TaskEnqueueOptions as H, UnverifiedActivityHandler as Ht, FederationQueueOptions as I, OutboxErrorHandler as It, createExponentialBackoffPolicy as J, buildCollectionSynchronizationHeader as Jt, RetryContext as K, SenderKeyPair as Kt, createFederation as L, OutboxListener as Lt, PortableInboxForwardingOptions as M, MediaUploaderCallback as Mt, Rfc6570Expression as N, NodeInfoDispatcher as Nt, InboxListenerSetters as O, HashlinkMediaDispatcher as Ot, FederationKvPrefixes as P, ObjectAuthorizePredicate as Pt, InProcessMessageQueue as Q, Message as R, OutboxListenerErrorHandler as Rt, FederationFetchOptions as S, CollectionCounter as St, IdempotencyKeyCallback as T, CustomCollectionCounter as Tt, TaskHandler as U, UnverifiedActivityReason as Ut, TaskDefinitionOptions as V, SharedInboxKeyDispatcher as Vt, TaskRegistry as W, WebFingerLinksDispatcher as Wt, respondWithObject as X, ActivityTransformer as Xt, RespondWithObjectOptions as Y, digest as Yt, respondWithObjectIfAcceptable as Z, CustomCollectionCallbackSetters as _, ActorAliasMapper as _t, GetSignedKeyOptions as a, CircuitBreaker as at, FederationBenchmarkOptions as b, ActorKeyPairsDispatcher as bt, ParseUriResult as c, CircuitBreakerCreateOptions as ct, RouteActivityOptions as d, CircuitBreakerOptions as dt, MessageQueue as et, SendActivityOptions as f, CircuitBreakerState as ft, ConstructorWithTypeId as g, parseCircuitBreakerKvState as gt, CollectionCallbackSetters as h, normalizeCircuitBreakerOptions as ht, GetActorOptions as i, ParallelMessageQueue as it, OutboxListenerSetters as j, InboxListener as jt, MediaUploaderSetters as k, HashlinkMediaRequest as kt, PortableRequest as l, CircuitBreakerFailurePolicy as lt, ActorCallbackSetters as m, NormalizedCircuitBreakerOptions as mt, Context as n, MessageQueueEnqueueOptions as nt, InboxContext as o, CircuitBreakerActivityDrop as ot, SendActivityOptionsForCollection as p, CircuitBreakerStateChange as pt, RetryPolicy as q, PageItems as qt, ForwardActivityOptions as r, MessageQueueListenOptions as rt, OutboxContext as s, CircuitBreakerBeforeSendDecision as st, ActorKeyPair as t, MessageQueueDepth as tt, RequestContext as u, CircuitBreakerKvState as ut, Federatable as v, ActorDispatcher as vt, FederationStartQueueOptions as w, CollectionDispatcher as wt, FederationBuilder as x, AuthorizePredicate as xt, Federation as y, ActorHandleMapper as yt, createFederationBuilder as z, OutboxPermanentFailureHandler as zt };
@@ -8,7 +8,7 @@ import { lookupWebFinger } from "@fedify/webfinger";
8
8
  import { metrics, trace } from "@opentelemetry/api";
9
9
  //#region src/testing/context.ts
10
10
  function createContext(values) {
11
- const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getPortableObjectUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
11
+ const { federation, url = new URL("http://example.com/"), canonicalOrigin, data, documentLoader, contextLoader, meterProvider, tracerProvider, clone, getNodeInfoUri, getActorUri, getObjectUri, getPortableObjectUri, getPortableInboxUri, getCollectionUri, getOutboxUri, getMediaUploaderUri, getInboxUri, getFollowingUri, getFollowersUri, getLikedUri, getFeaturedUri, getFeaturedTagsUri, parseUri, getActorKeyPairs, getDocumentLoader, lookupObject: lookupObject$1, traverseCollection: traverseCollection$1, lookupNodeInfo, lookupWebFinger: lookupWebFinger$1, sendActivity, routeActivity, enqueueTask, enqueueTaskMany } = values;
12
12
  function throwRouterError() {
13
13
  throw new RouterError("Not implemented");
14
14
  }
@@ -31,6 +31,7 @@ function createContext(values) {
31
31
  getActorUri: getActorUri ?? throwRouterError,
32
32
  getObjectUri: getObjectUri ?? throwRouterError,
33
33
  getPortableObjectUri: getPortableObjectUri ?? throwRouterError,
34
+ getPortableInboxUri: getPortableInboxUri ?? throwRouterError,
34
35
  getCollectionUri: getCollectionUri ?? throwRouterError,
35
36
  getOutboxUri: getOutboxUri ?? throwRouterError,
36
37
  getMediaUploaderUri: getMediaUploaderUri ?? throwRouterError,
@@ -3,6 +3,6 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  //#region deno.json
5
5
  var name = "@fedify/fedify";
6
- var version = "2.4.0-dev.2065+b09fdd33";
6
+ var version = "2.4.0-dev.2073+2152dfc6";
7
7
  //#endregion
8
8
  export { version as n, name as t };
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { s as validateCryptoKey } from "./key-BxHsA1s9.mjs";
5
- import { n as doubleKnock } from "./http-f1qaBtOh.mjs";
4
+ import { s as validateCryptoKey } from "./key-BYXnTGro.mjs";
5
+ import { n as doubleKnock } from "./http-C7qHlv-b.mjs";
6
6
  import { getLogger } from "@logtape/logtape";
7
7
  import { curry } from "es-toolkit";
8
8
  import { UrlError, createActivityPubRequest, getRemoteDocument, logRequest, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -6,7 +6,7 @@ import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
6
6
  import { t as assertExists } from "../assert_exists-cffSpJ7X.mjs";
7
7
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
8
8
  import "../std__assert-DvMDRPes.mjs";
9
- import { r as createFederationBuilder } from "../builder-CMkrnYbY.mjs";
9
+ import { r as createFederationBuilder } from "../builder-CVHpPAjK.mjs";
10
10
  import { DisallowedOperatorError, DisallowedVarSpecModifierError, DuplicateRouteVariableError, RouteTemplateOptionsNotMatchedError, RouterError } from "@fedify/uri-template";
11
11
  import { Activity, Note, Person } from "@fedify/vocab";
12
12
  import { test } from "@fedify/fixture";
@@ -6,11 +6,11 @@ import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
7
7
  import "../std__assert-DvMDRPes.mjs";
8
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
- import { t as exportJwk } from "../key-BxHsA1s9.mjs";
10
- import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
9
+ import { t as exportJwk } from "../key-BYXnTGro.mjs";
11
10
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
12
- import { n as FederationImpl } from "../middleware-s-AZzx4r.mjs";
13
- import { l as verifyProof, r as signObject } from "../proof-B03JXhrk.mjs";
11
+ import { l as verifyProof, r as signObject } from "../proof-CxsVG6vM.mjs";
12
+ import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
13
+ import { n as FederationImpl } from "../middleware-CpyCNOW_.mjs";
14
14
  import { Create, DataIntegrityProof, Note } from "@fedify/vocab";
15
15
  import { mockDocumentLoader, test } from "@fedify/fixture";
16
16
  import { exportDidKey, parseIri } from "@fedify/vocab-runtime";
@@ -1,14 +1,14 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { r as createRequestContext, t as createInboxContext } from "../context-DG5QeQ8W.mjs";
4
+ import { r as createRequestContext, t as createInboxContext } from "../context-DlZhxdFT.mjs";
5
5
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
7
7
  import "../std__assert-DvMDRPes.mjs";
8
- import { s as signRequest } from "../http-f1qaBtOh.mjs";
8
+ import { p as signJsonLd } from "../ld-DT3e2hOv.mjs";
9
+ import { s as signRequest } from "../http-C7qHlv-b.mjs";
9
10
  import { a as rsaPrivateKey3, c as rsaPublicKey3 } from "../keys-DIJNHW-Y.mjs";
10
- import { d as handleInbox, o as createFederation } from "../middleware-s-AZzx4r.mjs";
11
- import { p as signJsonLd } from "../ld-CqJq5erX.mjs";
11
+ import { o as createFederation, p as handleInbox } from "../middleware-CpyCNOW_.mjs";
12
12
  import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
13
13
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
14
14
  import { Create } from "@fedify/vocab";
@@ -1,7 +1,7 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DG5QeQ8W.mjs";
4
+ import { n as createOutboxContext, r as createRequestContext, t as createInboxContext } from "../context-DlZhxdFT.mjs";
5
5
  import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
7
7
  import { t as assertGreaterOrEqual } from "../assert_greater_or_equal-BlafOF4-.mjs";
@@ -10,12 +10,12 @@ import "../std__assert-DvMDRPes.mjs";
10
10
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
11
11
  import { t as assert } from "../assert-D1Eafmd_.mjs";
12
12
  import { r as parseAcceptSignature } from "../accept-CPVqki78.mjs";
13
- import { a as generateCryptoKeyPair } from "../key-BxHsA1s9.mjs";
14
- import { s as signRequest } from "../http-f1qaBtOh.mjs";
13
+ import { a as generateCryptoKeyPair } from "../key-BYXnTGro.mjs";
14
+ import { a as compactJsonLd, p as signJsonLd } from "../ld-DT3e2hOv.mjs";
15
+ import { r as signObject } from "../proof-CxsVG6vM.mjs";
16
+ import { s as signRequest } from "../http-C7qHlv-b.mjs";
15
17
  import { a as rsaPrivateKey3, c as rsaPublicKey3, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
16
- import { c as handleActor, d as handleInbox, f as handleObject, h as respondWithObjectIfAcceptable, l as handleCollection, m as respondWithObject, o as createFederation, p as handleOutbox, u as handleCustomCollection } from "../middleware-s-AZzx4r.mjs";
17
- import { a as compactJsonLd, p as signJsonLd } from "../ld-CqJq5erX.mjs";
18
- import { r as signObject } from "../proof-B03JXhrk.mjs";
18
+ import { _ as respondWithObjectIfAcceptable, d as handleCollection, f as handleCustomCollection, g as respondWithObject, h as handleOutbox, m as handleObject, o as createFederation, p as handleInbox, u as handleActor } from "../middleware-CpyCNOW_.mjs";
19
19
  import { t as ActivityListenerSet } from "../activity-listener-C-BSbKI7.mjs";
20
20
  import { Activity, Create, CryptographicKey, Multikey, Note, Person, Tombstone } from "@fedify/vocab";
21
21
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -10,8 +10,8 @@ import "../std__assert-DvMDRPes.mjs";
10
10
  import { t as assertStrictEquals } from "../assert_strict_equals-CYvBmkpC.mjs";
11
11
  import { t as assert } from "../assert-D1Eafmd_.mjs";
12
12
  import { r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
13
- import { _ as parseHashlinkGatewayRequest, o as createFederation } from "../middleware-s-AZzx4r.mjs";
14
- import { r as createFederationBuilder } from "../builder-CMkrnYbY.mjs";
13
+ import { o as createFederation, y as parseHashlinkGatewayRequest } from "../middleware-CpyCNOW_.mjs";
14
+ import { r as createFederationBuilder } from "../builder-CVHpPAjK.mjs";
15
15
  import { n as RouterError } from "../router-u5O5KCQr.mjs";
16
16
  import { Note } from "@fedify/vocab";
17
17
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";