@fedify/fedify 2.3.0-dev.1119 → 2.3.0-dev.1137

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 (116) hide show
  1. package/README.md +3 -0
  2. package/dist/{assert-DikXweDx.mjs → assert-OguE97r2.mjs} +1 -1
  3. package/dist/{assert_instance_of-C4Ri6VuN.mjs → assert_instance_of-DBC5X09g.mjs} +1 -1
  4. package/dist/{assert_not_equals--wG9hV7u.mjs → assert_not_equals-DkVK8oqV.mjs} +1 -1
  5. package/dist/{assert_rejects-DQP-q39h.mjs → assert_rejects-DN60FHPX.mjs} +2 -2
  6. package/dist/{assert_strict_equals-Dmjbg-bA.mjs → assert_strict_equals-XEgZAlrj.mjs} +1 -1
  7. package/dist/{assert_throws-4NwKEy2q.mjs → assert_throws-BOkhLGYc.mjs} +1 -1
  8. package/dist/{builder-Ond_h57y.mjs → builder-BCkBXxky.mjs} +60 -41
  9. package/dist/compat/mod.d.cts +1 -1
  10. package/dist/compat/mod.d.ts +1 -1
  11. package/dist/compat/outgoing-jsonld.test.mjs +3 -3
  12. package/dist/compat/public-audience.test.mjs +3 -3
  13. package/dist/compat/transformers.test.mjs +5 -5
  14. package/dist/{context-cSUMk2da.d.ts → context-DCtsSHDv.d.ts} +4 -293
  15. package/dist/{context-Ch-ZLyTQ.d.cts → context-DI2gRbyN.d.cts} +3 -294
  16. package/dist/{context-BAE7AKLA.mjs → context-DVoTs_wM.mjs} +1 -1
  17. package/dist/{deno-DVsHS7rA.mjs → deno-B_9yJW3w.mjs} +1 -1
  18. package/dist/{docloader-WsWfKaE5.mjs → docloader-BT89tyFr.mjs} +3 -3
  19. package/dist/federation/builder.test.mjs +138 -10
  20. package/dist/federation/collection.test.mjs +3 -3
  21. package/dist/federation/handler.test.mjs +12 -12
  22. package/dist/federation/idempotency.test.mjs +6 -6
  23. package/dist/federation/inbox.test.mjs +3 -3
  24. package/dist/federation/keycache.test.mjs +5 -5
  25. package/dist/federation/kv.test.mjs +3 -3
  26. package/dist/federation/metrics.test.mjs +231 -3
  27. package/dist/federation/middleware.test.mjs +88 -18
  28. package/dist/federation/mod.cjs +155 -3
  29. package/dist/federation/mod.d.cts +3 -2
  30. package/dist/federation/mod.d.ts +3 -2
  31. package/dist/federation/mod.js +153 -1
  32. package/dist/federation/mq.test.mjs +5 -5
  33. package/dist/federation/negotiation.test.mjs +4 -4
  34. package/dist/federation/retry.test.mjs +3 -3
  35. package/dist/federation/router.test.mjs +190 -9
  36. package/dist/federation/send.test.mjs +16 -16
  37. package/dist/federation/webfinger.test.mjs +5 -5
  38. package/dist/{getMachineId-bsd-BY01PL1n.mjs → getMachineId-bsd-etIyxDet.mjs} +1 -1
  39. package/dist/{getMachineId-darwin-Dr1gkBkp.mjs → getMachineId-darwin-D23zTf4g.mjs} +1 -1
  40. package/dist/{getMachineId-win-QEYwcJiy.mjs → getMachineId-win-Dpap6v5i.mjs} +1 -1
  41. package/dist/{http-CouJSFVK.js → http-CToqG5ap.js} +252 -20
  42. package/dist/{http-CubOB9wq.cjs → http-CWoeyogl.cjs} +263 -19
  43. package/dist/{http-DUV8ysti.mjs → http-Cyx5SNuu.mjs} +8 -6
  44. package/dist/{http-D6LP89UO.d.ts → http-VyDTd4G3.d.cts} +8 -1
  45. package/dist/{http-D6aw3j2U.d.cts → http-lf8Hsd91.d.ts} +8 -1
  46. package/dist/{key-BoWaYRHm.mjs → key-CkkMJBjF.mjs} +42 -17
  47. package/dist/{kv-cache-DBNpsneh.js → kv-cache-CuCn2xvM.js} +19 -2
  48. package/dist/{kv-cache-Dz31ATUT.cjs → kv-cache-DuEwFYcN.cjs} +19 -2
  49. package/dist/{kv-cache-DihufyAQ.mjs → kv-cache-VHFP42vY.mjs} +19 -1
  50. package/dist/{ld-B5K1mSuG.mjs → ld-k8yqD2a-.mjs} +3 -3
  51. package/dist/{metrics-C4attqv0.mjs → metrics-iRBg8jTk.mjs} +209 -2
  52. package/dist/{middleware-CmsDtIHI.cjs → middleware-BWLUrbS9.cjs} +137 -210
  53. package/dist/{middleware-BDKFRjue.mjs → middleware-CztxpARM.mjs} +1 -1
  54. package/dist/{middleware-Dtjz-hSk.js → middleware-D7FrhN9q.js} +101 -162
  55. package/dist/{middleware-t0jC8I99.mjs → middleware-DQEgdr83.mjs} +64 -36
  56. package/dist/{mod-BDhgfjP7.d.cts → mod-B0hW12_O.d.cts} +1 -1
  57. package/dist/mod-C504qevA.d.cts +173 -0
  58. package/dist/{mod-B-Lin9Sy.d.ts → mod-COIAjwRS.d.ts} +1 -1
  59. package/dist/{mod-DLrRb0dx.d.ts → mod-DFvNJcNb.d.ts} +54 -3
  60. package/dist/mod-wYfuXeDE.d.ts +173 -0
  61. package/dist/{mod-BR_BB0bh.d.cts → mod-yvIXFAEi.d.cts} +54 -3
  62. package/dist/mod.cjs +6 -6
  63. package/dist/mod.d.cts +6 -5
  64. package/dist/mod.d.ts +6 -5
  65. package/dist/mod.js +5 -5
  66. package/dist/mq-D-nlpY04.d.ts +208 -0
  67. package/dist/mq-D8uSFzxe.d.cts +208 -0
  68. package/dist/nodeinfo/client.test.mjs +4 -4
  69. package/dist/nodeinfo/handler.test.mjs +5 -5
  70. package/dist/nodeinfo/types.test.mjs +4 -4
  71. package/dist/otel/exporter.test.mjs +3 -3
  72. package/dist/{outgoing-jsonld-BNL8AC14.mjs → outgoing-jsonld-BgFLCJQ_.mjs} +1 -1
  73. package/dist/{owner-hDxI0ufu.mjs → owner-nmXdvXpc.mjs} +2 -2
  74. package/dist/{proof-BUWfVr6Q.cjs → proof-CcsIJLTn.cjs} +1 -1
  75. package/dist/{proof-DhVuz4bc.mjs → proof-DpwO1T4S.mjs} +5 -5
  76. package/dist/{proof-n60t8o9P.js → proof-NRmtrTDu.js} +1 -1
  77. package/dist/{send-BPhyR5Oo.mjs → send-DvX2tYyZ.mjs} +3 -3
  78. package/dist/sig/accept.test.mjs +1 -1
  79. package/dist/sig/http.test.mjs +13 -9
  80. package/dist/sig/key.test.mjs +104 -7
  81. package/dist/sig/ld.test.mjs +7 -7
  82. package/dist/sig/mod.cjs +2 -2
  83. package/dist/sig/mod.d.cts +2 -2
  84. package/dist/sig/mod.d.ts +2 -2
  85. package/dist/sig/mod.js +2 -2
  86. package/dist/sig/owner.test.mjs +6 -6
  87. package/dist/sig/proof.test.mjs +8 -8
  88. package/dist/{std__assert-BTEgfoJo.mjs → std__assert-BBjXFNOb.mjs} +4 -4
  89. package/dist/testing/mod.d.mts +1 -0
  90. package/dist/testing/mod.mjs +1 -1
  91. package/dist/utils/docloader.test.mjs +7 -7
  92. package/dist/utils/kv-cache.test.mjs +67 -2
  93. package/dist/utils/mod.cjs +1 -1
  94. package/dist/utils/mod.d.cts +1 -1
  95. package/dist/utils/mod.d.ts +1 -1
  96. package/dist/utils/mod.js +1 -1
  97. package/package.json +6 -7
  98. package/dist/mod-C6E8rkcz.d.ts +0 -63
  99. package/dist/mod-P9tE2WmM.d.cts +0 -63
  100. package/dist/router-BT_F5748.mjs +0 -114
  101. /package/dist/{accept-CgDcxvjV.mjs → accept-CceiKpCy.mjs} +0 -0
  102. /package/dist/{activity-listener-BeTGV3wc.mjs → activity-listener-tztVvlNb.mjs} +0 -0
  103. /package/dist/{assert_equals-Ew3jOFa3.mjs → assert_equals-C-ZRDbaf.mjs} +0 -0
  104. /package/dist/{client-Bneh_DYR.mjs → client-B_A6mfn3.mjs} +0 -0
  105. /package/dist/{collection-Cc3DVAhE.mjs → collection-CA3V5zyK.mjs} +0 -0
  106. /package/dist/{esm-sdtqOUPu.mjs → esm-BQRw925N.mjs} +0 -0
  107. /package/dist/{execAsync-Dxb7rNf3.mjs → execAsync-DCBrgFiV.mjs} +0 -0
  108. /package/dist/{getMachineId-linux-Bbhofx-s.mjs → getMachineId-linux-ObI47Hql.mjs} +0 -0
  109. /package/dist/{getMachineId-unsupported-dIOte2Ct.mjs → getMachineId-unsupported-Ddu-PFeh.mjs} +0 -0
  110. /package/dist/{keycache-BeU0LCII.mjs → keycache-BYMd8q7F.mjs} +0 -0
  111. /package/dist/{keys-CSYsOMFG.mjs → keys-C3kae-6B.mjs} +0 -0
  112. /package/dist/{kv-QHE0oeM3.mjs → kv-x2IvBUyq.mjs} +0 -0
  113. /package/dist/{negotiation-DDstyBvc.mjs → negotiation-CDW-_gUU.mjs} +0 -0
  114. /package/dist/{public-audience-c9zmYKgA.mjs → public-audience-N3pyOx2p.mjs} +0 -0
  115. /package/dist/{retry-_VvV0h9f.mjs → retry-v_sGLH1d.mjs} +0 -0
  116. /package/dist/{types-D09GN0uZ.mjs → types-BFowWFTT.mjs} +0 -0
@@ -0,0 +1,173 @@
1
+ /// <reference lib="esnext.temporal" />
2
+ import { G as ActorHandleMapper, U as ActorAliasMapper, W as ActorDispatcher, ft as WebFingerLinksDispatcher, l as RequestContext } from "./context-DI2gRbyN.cjs";
3
+ import { Span, Tracer } from "@opentelemetry/api";
4
+ import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
5
+
6
+ //#region src/federation/router.d.ts
7
+ /**
8
+ * Options for the {@link Router}.
9
+ * @since 0.12.0
10
+ * @deprecated Import `RouterOptions` from `@fedify/uri-template` instead.
11
+ */
12
+ interface RouterOptions$1 extends RouterOptions {}
13
+ /**
14
+ * The result of {@link Router.route} method.
15
+ * @since 1.3.0
16
+ * @deprecated Import `RouterRouteResult` from `@fedify/uri-template` instead.
17
+ */
18
+ interface RouterRouteResult$1 extends RouterRouteResult<Record<never, never>> {}
19
+ /**
20
+ * URL router and constructor based on URI Template
21
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
22
+ *
23
+ * @deprecated Import `Router` from `@fedify/uri-template` instead. This class
24
+ * remains only for compatibility with older Fedify code. The
25
+ * `@fedify/uri-template` router is the replacement implementation
26
+ * and should be used directly in new code.
27
+ */
28
+ declare class Router {
29
+ #private;
30
+ /**
31
+ * Create a new {@link Router}.
32
+ * @param options Options for the router.
33
+ * @deprecated Use `new Router(options)` from `@fedify/uri-template`
34
+ * instead.
35
+ */
36
+ constructor(options?: RouterOptions);
37
+ /**
38
+ * Whether to ignore trailing slashes when matching paths.
39
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. This
40
+ * accessor forwards to the underlying `@fedify/uri-template`
41
+ * router so that post-construction mutation keeps working as
42
+ * in older Fedify code.
43
+ */
44
+ get trailingSlashInsensitive(): boolean;
45
+ set trailingSlashInsensitive(value: boolean);
46
+ /**
47
+ * Clones this router.
48
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
49
+ */
50
+ clone(): Router;
51
+ /**
52
+ * Checks if a path name exists in the router.
53
+ * @param name The name of the path.
54
+ * @returns `true` if the path name exists, otherwise `false`.
55
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
56
+ */
57
+ has(name: string): boolean;
58
+ /**
59
+ * Adds a new path rule to the router.
60
+ * @param template The path pattern.
61
+ * @param name The name of the path.
62
+ * @returns The names of the variables in the path pattern.
63
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. In this
64
+ * compatibility class, `add()` both registers the route and
65
+ * returns the variables in the path pattern. In
66
+ * `@fedify/uri-template`, these two responsibilities are split:
67
+ * `router.add(template, name)` registers the route and returns
68
+ * `void`, while the pure static method
69
+ * `Router.variables(template)` returns the variable names. To
70
+ * migrate, call `Router.variables(template)` when variables are
71
+ * needed, then call `router.add(template, name)` to register the
72
+ * route.
73
+ */
74
+ add(template: string, name: string): Set<string>;
75
+ /**
76
+ * Resolves a path name and values from a URL, if any match.
77
+ * @param url The URL to resolve.
78
+ * @returns The name of the path and its values, if any match. Otherwise,
79
+ * `null`.
80
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. Unlike the
81
+ * stricter `@fedify/uri-template` router, this compatibility
82
+ * method keeps the old Fedify 2.x contract of returning `null`
83
+ * (rather than throwing) for inputs that are not router paths.
84
+ */
85
+ route(url: string): RouterRouteResult$1 | null;
86
+ /**
87
+ * Constructs a URL/path from a path name and values.
88
+ * @param name The name of the path.
89
+ * @param values The values to expand the path with.
90
+ * @returns The URL/path, if the name exists. Otherwise, `null`.
91
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
92
+ */
93
+ build(name: string, values: Record<string, string>): string | null;
94
+ }
95
+ /**
96
+ * An error thrown by the {@link Router}.
97
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
98
+ */
99
+ declare class RouterError$1 extends RouterError {
100
+ /**
101
+ * Treats every `RouterError` from `@fedify/uri-template` as an instance of
102
+ * this deprecated class.
103
+ *
104
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
105
+ */
106
+ static override [Symbol.hasInstance](instance: unknown): boolean;
107
+ /**
108
+ * Create a new {@link RouterError}.
109
+ * @param message The error message.
110
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
111
+ */
112
+ constructor(message: string);
113
+ }
114
+ //#endregion
115
+ //#region src/federation/webfinger.d.ts
116
+ /**
117
+ * Parameters for {@link handleWebFinger}.
118
+ */
119
+ interface WebFingerHandlerParameters<TContextData> {
120
+ /**
121
+ * The request context.
122
+ */
123
+ context: RequestContext<TContextData>;
124
+ /**
125
+ * The canonical hostname of the server, if it's explicitly configured.
126
+ * @since 1.5.0
127
+ */
128
+ host?: string;
129
+ /**
130
+ * The callback for dispatching the actor.
131
+ */
132
+ actorDispatcher?: ActorDispatcher<TContextData>;
133
+ /**
134
+ * The callback for mapping a WebFinger username to the corresponding actor's
135
+ * internal identifier, or `null` if the username is not found.
136
+ * @since 0.15.0
137
+ */
138
+ actorHandleMapper?: ActorHandleMapper<TContextData>;
139
+ /**
140
+ * The callback for mapping a WebFinger query to the corresponding actor's
141
+ * internal identifier or username, or `null` if the query is not found.
142
+ * @since 1.4.0
143
+ */
144
+ actorAliasMapper?: ActorAliasMapper<TContextData>;
145
+ /**
146
+ * The callback for dispatching the Links of webFinger.
147
+ */
148
+ webFingerLinksDispatcher?: WebFingerLinksDispatcher<TContextData>;
149
+ /**
150
+ * The function to call when the actor is not found.
151
+ */
152
+ onNotFound(request: Request): Response | Promise<Response>;
153
+ /**
154
+ * The OpenTelemetry tracer.
155
+ * @since 1.3.0
156
+ */
157
+ tracer?: Tracer;
158
+ /**
159
+ * The span for the request.
160
+ * @since 1.3.0
161
+ */
162
+ span?: Span;
163
+ }
164
+ /**
165
+ * Handles a WebFinger request. You would not typically call this function
166
+ * directly, but instead use {@link Federation.fetch} method.
167
+ * @param request The WebFinger request to handle.
168
+ * @param parameters The parameters for handling the request.
169
+ * @returns The response to the request.
170
+ */
171
+ declare function handleWebFinger<TContextData>(request: Request, options: WebFingerHandlerParameters<TContextData>): Promise<Response>;
172
+ //#endregion
173
+ export { RouterOptions$1 as a, RouterError$1 as i, handleWebFinger as n, RouterRouteResult$1 as o, Router as r, WebFingerHandlerParameters as t };
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { S as KeyCache } from "./http-D6LP89UO.js";
2
+ import { S as KeyCache } from "./http-lf8Hsd91.js";
3
3
  import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
4
4
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
5
5
  import { DocumentLoader } from "@fedify/vocab-runtime";
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as HttpMessageSignaturesSpecDeterminer } from "./http-D6LP89UO.js";
2
+ import { n as HttpMessageSignaturesSpecDeterminer } from "./http-lf8Hsd91.js";
3
3
  import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
4
- import { TracerProvider } from "@opentelemetry/api";
4
+ import { MeterProvider, TracerProvider } from "@opentelemetry/api";
5
5
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
6
6
 
7
7
  //#region src/utils/docloader.d.ts
@@ -48,6 +48,37 @@ declare function getAuthenticatedDocumentLoader(identity: {
48
48
  tracerProvider
49
49
  }?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
50
50
  //#endregion
51
+ //#region src/federation/metrics.d.ts
52
+ /**
53
+ * The kind of remote ActivityPub lookup, recorded as
54
+ * `activitypub.lookup.kind` on the public-key lookup and remote document
55
+ * fetch metric families.
56
+ *
57
+ * - `public_key`: a public key lookup performed by `fetchKey` /
58
+ * `fetchKeyDetailed` (always recorded on `activitypub.key.lookup*`).
59
+ * - `actor`: a document fetch whose resolved value is an Actor. The
60
+ * bucket exists in the taxonomy for future actor-aware call sites;
61
+ * today, actor documents fetched through Fedify's generic document
62
+ * loader are still classified as `object` because the kind is decided
63
+ * at the loader boundary, before the response is parsed.
64
+ * - `object`: a generic ActivityPub object fetch through Fedify's
65
+ * document loader. This is the default classification for
66
+ * `documentLoader` invocations that do not match a more specific
67
+ * bucket.
68
+ * - `context`: a JSON-LD `@context` document fetch through Fedify's
69
+ * context loader.
70
+ * - `other`: a fetch that does not fit any of the above classifications.
71
+ * @since 2.3.0
72
+ */
73
+ type LookupKind = "public_key" | "actor" | "object" | "context" | "other";
74
+ /**
75
+ * The {@link LookupKind} values that can appear on remote document fetch
76
+ * metrics. `public_key` lookups are reported on the
77
+ * `activitypub.key.lookup` metric family instead, so it is excluded here.
78
+ * @since 2.3.0
79
+ */
80
+ type DocumentFetchKind = Exclude<LookupKind, "public_key">;
81
+ //#endregion
51
82
  //#region src/utils/kv-cache.d.ts
52
83
  /**
53
84
  * The parameters for {@link kvCache} function.
@@ -75,6 +106,24 @@ interface KvCacheParameters {
75
106
  * By default, 5 minutes for all URLs.
76
107
  */
77
108
  readonly rules?: readonly [string | URL | URLPattern, Temporal.Duration | Temporal.DurationLike][];
109
+ /**
110
+ * The OpenTelemetry meter provider used to record
111
+ * `activitypub.document.cache` measurements. When omitted, the wrapper
112
+ * does not emit any metric measurements, preserving the previous
113
+ * unobserved-cache behavior.
114
+ * @since 2.3.0
115
+ */
116
+ readonly meterProvider?: MeterProvider;
117
+ /**
118
+ * The lookup kind to record on the `activitypub.lookup.kind` attribute of
119
+ * `activitypub.document.cache` measurements. Defaults to `"object"` so
120
+ * the generic document loader case does not require an explicit option.
121
+ * Set to `"context"` for context-loader wrappers; the
122
+ * authenticated-loader path does not use `kvCache()` and is therefore
123
+ * out of scope.
124
+ * @since 2.3.0
125
+ */
126
+ readonly kind?: DocumentFetchKind;
78
127
  }
79
128
  /**
80
129
  * Decorates a {@link DocumentLoader} with a cache backed by a {@link KvStore}.
@@ -85,7 +134,9 @@ declare function kvCache({
85
134
  loader,
86
135
  kv,
87
136
  prefix,
88
- rules
137
+ rules,
138
+ meterProvider,
139
+ kind
89
140
  }: KvCacheParameters): DocumentLoader;
90
141
  //#endregion
91
142
  export { getAuthenticatedDocumentLoader as n, kvCache as t };
@@ -0,0 +1,173 @@
1
+ /// <reference lib="esnext.temporal" />
2
+ import { G as ActorHandleMapper, U as ActorAliasMapper, W as ActorDispatcher, ft as WebFingerLinksDispatcher, l as RequestContext } from "./context-DCtsSHDv.js";
3
+ import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
4
+ import { Span, Tracer } from "@opentelemetry/api";
5
+
6
+ //#region src/federation/router.d.ts
7
+ /**
8
+ * Options for the {@link Router}.
9
+ * @since 0.12.0
10
+ * @deprecated Import `RouterOptions` from `@fedify/uri-template` instead.
11
+ */
12
+ interface RouterOptions$1 extends RouterOptions {}
13
+ /**
14
+ * The result of {@link Router.route} method.
15
+ * @since 1.3.0
16
+ * @deprecated Import `RouterRouteResult` from `@fedify/uri-template` instead.
17
+ */
18
+ interface RouterRouteResult$1 extends RouterRouteResult<Record<never, never>> {}
19
+ /**
20
+ * URL router and constructor based on URI Template
21
+ * ([RFC 6570](https://tools.ietf.org/html/rfc6570)).
22
+ *
23
+ * @deprecated Import `Router` from `@fedify/uri-template` instead. This class
24
+ * remains only for compatibility with older Fedify code. The
25
+ * `@fedify/uri-template` router is the replacement implementation
26
+ * and should be used directly in new code.
27
+ */
28
+ declare class Router$1 {
29
+ #private;
30
+ /**
31
+ * Create a new {@link Router}.
32
+ * @param options Options for the router.
33
+ * @deprecated Use `new Router(options)` from `@fedify/uri-template`
34
+ * instead.
35
+ */
36
+ constructor(options?: RouterOptions);
37
+ /**
38
+ * Whether to ignore trailing slashes when matching paths.
39
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. This
40
+ * accessor forwards to the underlying `@fedify/uri-template`
41
+ * router so that post-construction mutation keeps working as
42
+ * in older Fedify code.
43
+ */
44
+ get trailingSlashInsensitive(): boolean;
45
+ set trailingSlashInsensitive(value: boolean);
46
+ /**
47
+ * Clones this router.
48
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
49
+ */
50
+ clone(): Router$1;
51
+ /**
52
+ * Checks if a path name exists in the router.
53
+ * @param name The name of the path.
54
+ * @returns `true` if the path name exists, otherwise `false`.
55
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
56
+ */
57
+ has(name: string): boolean;
58
+ /**
59
+ * Adds a new path rule to the router.
60
+ * @param template The path pattern.
61
+ * @param name The name of the path.
62
+ * @returns The names of the variables in the path pattern.
63
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. In this
64
+ * compatibility class, `add()` both registers the route and
65
+ * returns the variables in the path pattern. In
66
+ * `@fedify/uri-template`, these two responsibilities are split:
67
+ * `router.add(template, name)` registers the route and returns
68
+ * `void`, while the pure static method
69
+ * `Router.variables(template)` returns the variable names. To
70
+ * migrate, call `Router.variables(template)` when variables are
71
+ * needed, then call `router.add(template, name)` to register the
72
+ * route.
73
+ */
74
+ add(template: string, name: string): Set<string>;
75
+ /**
76
+ * Resolves a path name and values from a URL, if any match.
77
+ * @param url The URL to resolve.
78
+ * @returns The name of the path and its values, if any match. Otherwise,
79
+ * `null`.
80
+ * @deprecated Use `Router` from `@fedify/uri-template` instead. Unlike the
81
+ * stricter `@fedify/uri-template` router, this compatibility
82
+ * method keeps the old Fedify 2.x contract of returning `null`
83
+ * (rather than throwing) for inputs that are not router paths.
84
+ */
85
+ route(url: string): RouterRouteResult$1 | null;
86
+ /**
87
+ * Constructs a URL/path from a path name and values.
88
+ * @param name The name of the path.
89
+ * @param values The values to expand the path with.
90
+ * @returns The URL/path, if the name exists. Otherwise, `null`.
91
+ * @deprecated Use `Router` from `@fedify/uri-template` instead.
92
+ */
93
+ build(name: string, values: Record<string, string>): string | null;
94
+ }
95
+ /**
96
+ * An error thrown by the {@link Router}.
97
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
98
+ */
99
+ declare class RouterError$1 extends RouterError {
100
+ /**
101
+ * Treats every `RouterError` from `@fedify/uri-template` as an instance of
102
+ * this deprecated class.
103
+ *
104
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
105
+ */
106
+ static override [Symbol.hasInstance](instance: unknown): boolean;
107
+ /**
108
+ * Create a new {@link RouterError}.
109
+ * @param message The error message.
110
+ * @deprecated Import `RouterError` from `@fedify/uri-template` instead.
111
+ */
112
+ constructor(message: string);
113
+ }
114
+ //#endregion
115
+ //#region src/federation/webfinger.d.ts
116
+ /**
117
+ * Parameters for {@link handleWebFinger}.
118
+ */
119
+ interface WebFingerHandlerParameters<TContextData> {
120
+ /**
121
+ * The request context.
122
+ */
123
+ context: RequestContext<TContextData>;
124
+ /**
125
+ * The canonical hostname of the server, if it's explicitly configured.
126
+ * @since 1.5.0
127
+ */
128
+ host?: string;
129
+ /**
130
+ * The callback for dispatching the actor.
131
+ */
132
+ actorDispatcher?: ActorDispatcher<TContextData>;
133
+ /**
134
+ * The callback for mapping a WebFinger username to the corresponding actor's
135
+ * internal identifier, or `null` if the username is not found.
136
+ * @since 0.15.0
137
+ */
138
+ actorHandleMapper?: ActorHandleMapper<TContextData>;
139
+ /**
140
+ * The callback for mapping a WebFinger query to the corresponding actor's
141
+ * internal identifier or username, or `null` if the query is not found.
142
+ * @since 1.4.0
143
+ */
144
+ actorAliasMapper?: ActorAliasMapper<TContextData>;
145
+ /**
146
+ * The callback for dispatching the Links of webFinger.
147
+ */
148
+ webFingerLinksDispatcher?: WebFingerLinksDispatcher<TContextData>;
149
+ /**
150
+ * The function to call when the actor is not found.
151
+ */
152
+ onNotFound(request: Request): Response | Promise<Response>;
153
+ /**
154
+ * The OpenTelemetry tracer.
155
+ * @since 1.3.0
156
+ */
157
+ tracer?: Tracer;
158
+ /**
159
+ * The span for the request.
160
+ * @since 1.3.0
161
+ */
162
+ span?: Span;
163
+ }
164
+ /**
165
+ * Handles a WebFinger request. You would not typically call this function
166
+ * directly, but instead use {@link Federation.fetch} method.
167
+ * @param request The WebFinger request to handle.
168
+ * @param parameters The parameters for handling the request.
169
+ * @returns The response to the request.
170
+ */
171
+ declare function handleWebFinger<TContextData>(request: Request, options: WebFingerHandlerParameters<TContextData>): Promise<Response>;
172
+ //#endregion
173
+ export { RouterOptions$1 as a, RouterError$1 as i, handleWebFinger as n, RouterRouteResult$1 as o, Router$1 as r, WebFingerHandlerParameters as t };
@@ -1,8 +1,8 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as HttpMessageSignaturesSpecDeterminer } from "./http-D6aw3j2U.cjs";
2
+ import { n as HttpMessageSignaturesSpecDeterminer } from "./http-VyDTd4G3.cjs";
3
3
  import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
4
4
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
5
- import { TracerProvider } from "@opentelemetry/api";
5
+ import { MeterProvider, TracerProvider } from "@opentelemetry/api";
6
6
 
7
7
  //#region src/utils/docloader.d.ts
8
8
  /**
@@ -48,6 +48,37 @@ declare function getAuthenticatedDocumentLoader(identity: {
48
48
  tracerProvider
49
49
  }?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
50
50
  //#endregion
51
+ //#region src/federation/metrics.d.ts
52
+ /**
53
+ * The kind of remote ActivityPub lookup, recorded as
54
+ * `activitypub.lookup.kind` on the public-key lookup and remote document
55
+ * fetch metric families.
56
+ *
57
+ * - `public_key`: a public key lookup performed by `fetchKey` /
58
+ * `fetchKeyDetailed` (always recorded on `activitypub.key.lookup*`).
59
+ * - `actor`: a document fetch whose resolved value is an Actor. The
60
+ * bucket exists in the taxonomy for future actor-aware call sites;
61
+ * today, actor documents fetched through Fedify's generic document
62
+ * loader are still classified as `object` because the kind is decided
63
+ * at the loader boundary, before the response is parsed.
64
+ * - `object`: a generic ActivityPub object fetch through Fedify's
65
+ * document loader. This is the default classification for
66
+ * `documentLoader` invocations that do not match a more specific
67
+ * bucket.
68
+ * - `context`: a JSON-LD `@context` document fetch through Fedify's
69
+ * context loader.
70
+ * - `other`: a fetch that does not fit any of the above classifications.
71
+ * @since 2.3.0
72
+ */
73
+ type LookupKind = "public_key" | "actor" | "object" | "context" | "other";
74
+ /**
75
+ * The {@link LookupKind} values that can appear on remote document fetch
76
+ * metrics. `public_key` lookups are reported on the
77
+ * `activitypub.key.lookup` metric family instead, so it is excluded here.
78
+ * @since 2.3.0
79
+ */
80
+ type DocumentFetchKind = Exclude<LookupKind, "public_key">;
81
+ //#endregion
51
82
  //#region src/utils/kv-cache.d.ts
52
83
  /**
53
84
  * The parameters for {@link kvCache} function.
@@ -75,6 +106,24 @@ interface KvCacheParameters {
75
106
  * By default, 5 minutes for all URLs.
76
107
  */
77
108
  readonly rules?: readonly [string | URL | URLPattern, Temporal.Duration | Temporal.DurationLike][];
109
+ /**
110
+ * The OpenTelemetry meter provider used to record
111
+ * `activitypub.document.cache` measurements. When omitted, the wrapper
112
+ * does not emit any metric measurements, preserving the previous
113
+ * unobserved-cache behavior.
114
+ * @since 2.3.0
115
+ */
116
+ readonly meterProvider?: MeterProvider;
117
+ /**
118
+ * The lookup kind to record on the `activitypub.lookup.kind` attribute of
119
+ * `activitypub.document.cache` measurements. Defaults to `"object"` so
120
+ * the generic document loader case does not require an explicit option.
121
+ * Set to `"context"` for context-loader wrappers; the
122
+ * authenticated-loader path does not use `kvCache()` and is therefore
123
+ * out of scope.
124
+ * @since 2.3.0
125
+ */
126
+ readonly kind?: DocumentFetchKind;
78
127
  }
79
128
  /**
80
129
  * Decorates a {@link DocumentLoader} with a cache backed by a {@link KvStore}.
@@ -85,7 +134,9 @@ declare function kvCache({
85
134
  loader,
86
135
  kv,
87
136
  prefix,
88
- rules
137
+ rules,
138
+ meterProvider,
139
+ kind
89
140
  }: KvCacheParameters): DocumentLoader;
90
141
  //#endregion
91
142
  export { getAuthenticatedDocumentLoader as n, kvCache as t };
package/dist/mod.cjs CHANGED
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  require("./chunk-DDcVe30Y.cjs");
5
5
  const require_transformers = require("./transformers-NeAONrAq.cjs");
6
6
  require("./compat/mod.cjs");
7
- const require_http = require("./http-CubOB9wq.cjs");
8
- const require_middleware = require("./middleware-CmsDtIHI.cjs");
9
- const require_proof = require("./proof-BUWfVr6Q.cjs");
7
+ const require_http = require("./http-CWoeyogl.cjs");
8
+ const require_middleware = require("./middleware-BWLUrbS9.cjs");
9
+ const require_proof = require("./proof-CcsIJLTn.cjs");
10
10
  const require_types = require("./types-KC4QAoxe.cjs");
11
- const require_kv_cache = require("./kv-cache-Dz31ATUT.cjs");
11
+ const require_kv_cache = require("./kv-cache-DuEwFYcN.cjs");
12
12
  const require_federation_mod = require("./federation/mod.cjs");
13
13
  require("./nodeinfo/mod.cjs");
14
14
  require("./runtime/mod.cjs");
@@ -18,8 +18,8 @@ require("./utils/mod.cjs");
18
18
  exports.InProcessMessageQueue = require_federation_mod.InProcessMessageQueue;
19
19
  exports.MemoryKvStore = require_federation_mod.MemoryKvStore;
20
20
  exports.ParallelMessageQueue = require_federation_mod.ParallelMessageQueue;
21
- exports.Router = require_middleware.Router;
22
- exports.RouterError = require_middleware.RouterError;
21
+ exports.Router = require_federation_mod.Router;
22
+ exports.RouterError = require_federation_mod.RouterError;
23
23
  exports.SendActivityError = require_middleware.SendActivityError;
24
24
  exports.actorDehydrator = require_transformers.actorDehydrator;
25
25
  exports.attachSignature = require_proof.attachSignature;
package/dist/mod.d.cts CHANGED
@@ -1,13 +1,14 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CAM_bQXx.cjs";
3
- import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-D6aw3j2U.cjs";
3
+ import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-VyDTd4G3.cjs";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
5
- import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-Ch-ZLyTQ.cjs";
5
+ import { $ as CustomCollectionDispatcher, A as FederationKvPrefixes, B as RespondWithObjectOptions, C as IdempotencyKeyCallback, D as ObjectCallbackSetters, E as InboxListenerSetters, F as RetryContext, G as ActorHandleMapper, H as respondWithObjectIfAcceptable, I as RetryPolicy, J as CollectionCounter, K as ActorKeyPairsDispatcher, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as CustomCollectionCursor, R as Message, S as FederationStartQueueOptions, T as InboxChallengePolicy, U as ActorAliasMapper, V as respondWithObject, W as ActorDispatcher, X as CollectionDispatcher, Y as CollectionCursor, Z as CustomCollectionCounter, _ as Federatable, _t as digest, a as GetSignedKeyOptions, at as OutboxErrorHandler, b as FederationFetchOptions, c as ParseUriResult, ct as OutboxPermanentFailureHandler, d as SendActivityOptions, dt as UnverifiedActivityReason, et as InboxErrorHandler, f as SendActivityOptionsForCollection, ft as WebFingerLinksDispatcher, g as CustomCollectionCallbackSetters, gt as buildCollectionSynchronizationHeader, h as ConstructorWithTypeId, ht as PageItems, i as GetActorOptions, it as ObjectDispatcher, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as SharedInboxKeyDispatcher, m as CollectionCallbackSetters, mt as SenderKeyPair, n as Context, nt as NodeInfoDispatcher, o as InboxContext, ot as OutboxListener, p as ActorCallbackSetters, pt as SendActivityError, q as AuthorizePredicate, r as ForwardActivityOptions, rt as ObjectAuthorizePredicate, s as OutboxContext, st as OutboxListenerErrorHandler, t as ActorKeyPair, tt as InboxListener, u as RouteActivityOptions, ut as UnverifiedActivityHandler, v as Federation, vt as ActivityTransformer, w as IdempotencyStrategy, x as FederationOptions, y as FederationBuilder, z as createFederationBuilder } from "./context-DI2gRbyN.cjs";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
7
+ import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-D8uSFzxe.cjs";
7
8
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-P9tE2WmM.cjs";
9
- import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-BDhgfjP7.cjs";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-BR_BB0bh.cjs";
9
+ import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-C504qevA.cjs";
10
+ import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-B0hW12_O.cjs";
11
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-yvIXFAEi.cjs";
11
12
  export * from "@fedify/vocab-runtime";
12
13
 
13
14
  //#region src/mod.d.ts
package/dist/mod.d.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CSddvgWN.js";
3
- import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-D6LP89UO.js";
3
+ import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-lf8Hsd91.js";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CnngXDNJ.js";
5
- import { $ as ParallelMessageQueue, A as FederationKvPrefixes, B as Router, C as IdempotencyKeyCallback, Ct as WebFingerLinksDispatcher, D as ObjectCallbackSetters, Dt as buildCollectionSynchronizationHeader, E as InboxListenerSetters, Et as PageItems, F as RetryContext, G as respondWithObject, H as RouterOptions, I as RetryPolicy, J as InProcessMessageQueueOptions, K as respondWithObjectIfAcceptable, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, Ot as digest, P as CreateExponentialBackoffPolicyOptions, Q as MessageQueueListenOptions, R as Message, S as FederationStartQueueOptions, St as UnverifiedActivityReason, T as InboxChallengePolicy, Tt as SenderKeyPair, U as RouterRouteResult, V as RouterError, W as RespondWithObjectOptions, X as MessageQueueDepth, Y as MessageQueue, Z as MessageQueueEnqueueOptions, _ as Federatable, _t as OutboxListener, a as GetSignedKeyOptions, at as CollectionCounter, b as FederationFetchOptions, bt as SharedInboxKeyDispatcher, c as ParseUriResult, ct as CustomCollectionCounter, d as SendActivityOptions, dt as InboxErrorHandler, et as ActorAliasMapper, f as SendActivityOptionsForCollection, ft as InboxListener, g as CustomCollectionCallbackSetters, gt as OutboxErrorHandler, h as ConstructorWithTypeId, ht as ObjectDispatcher, i as GetActorOptions, it as AuthorizePredicate, j as FederationOrigin, k as Rfc6570Expression, kt as ActivityTransformer, l as RequestContext, lt as CustomCollectionCursor, m as CollectionCallbackSetters, mt as ObjectAuthorizePredicate, n as Context, nt as ActorHandleMapper, o as InboxContext, ot as CollectionCursor, p as ActorCallbackSetters, pt as NodeInfoDispatcher, q as InProcessMessageQueue, r as ForwardActivityOptions, rt as ActorKeyPairsDispatcher, s as OutboxContext, st as CollectionDispatcher, t as ActorKeyPair, tt as ActorDispatcher, u as RouteActivityOptions, ut as CustomCollectionDispatcher, v as Federation, vt as OutboxListenerErrorHandler, w as IdempotencyStrategy, wt as SendActivityError, x as FederationOptions, xt as UnverifiedActivityHandler, y as FederationBuilder, yt as OutboxPermanentFailureHandler, z as createFederationBuilder } from "./context-cSUMk2da.js";
5
+ import { $ as CustomCollectionDispatcher, A as FederationKvPrefixes, B as RespondWithObjectOptions, C as IdempotencyKeyCallback, D as ObjectCallbackSetters, E as InboxListenerSetters, F as RetryContext, G as ActorHandleMapper, H as respondWithObjectIfAcceptable, I as RetryPolicy, J as CollectionCounter, K as ActorKeyPairsDispatcher, L as createExponentialBackoffPolicy, M as FederationQueueOptions, N as createFederation, O as OutboxListenerSetters, P as CreateExponentialBackoffPolicyOptions, Q as CustomCollectionCursor, R as Message, S as FederationStartQueueOptions, T as InboxChallengePolicy, U as ActorAliasMapper, V as respondWithObject, W as ActorDispatcher, X as CollectionDispatcher, Y as CollectionCursor, Z as CustomCollectionCounter, _ as Federatable, _t as digest, a as GetSignedKeyOptions, at as OutboxErrorHandler, b as FederationFetchOptions, c as ParseUriResult, ct as OutboxPermanentFailureHandler, d as SendActivityOptions, dt as UnverifiedActivityReason, et as InboxErrorHandler, f as SendActivityOptionsForCollection, ft as WebFingerLinksDispatcher, g as CustomCollectionCallbackSetters, gt as buildCollectionSynchronizationHeader, h as ConstructorWithTypeId, ht as PageItems, i as GetActorOptions, it as ObjectDispatcher, j as FederationOrigin, k as Rfc6570Expression, l as RequestContext, lt as SharedInboxKeyDispatcher, m as CollectionCallbackSetters, mt as SenderKeyPair, n as Context, nt as NodeInfoDispatcher, o as InboxContext, ot as OutboxListener, p as ActorCallbackSetters, pt as SendActivityError, q as AuthorizePredicate, r as ForwardActivityOptions, rt as ObjectAuthorizePredicate, s as OutboxContext, st as OutboxListenerErrorHandler, t as ActorKeyPair, tt as InboxListener, u as RouteActivityOptions, ut as UnverifiedActivityHandler, v as Federation, vt as ActivityTransformer, w as IdempotencyStrategy, x as FederationOptions, y as FederationBuilder, z as createFederationBuilder } from "./context-DCtsSHDv.js";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
7
+ import { a as MessageQueueEnqueueOptions, i as MessageQueueDepth, n as InProcessMessageQueueOptions, o as MessageQueueListenOptions, r as MessageQueue, s as ParallelMessageQueue, t as InProcessMessageQueue } from "./mq-D-nlpY04.js";
7
8
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
8
- import { n as handleWebFinger, t as WebFingerHandlerParameters } from "./mod-C6E8rkcz.js";
9
- import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-B-Lin9Sy.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DLrRb0dx.js";
9
+ import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-wYfuXeDE.js";
10
+ import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-COIAjwRS.js";
11
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-DFvNJcNb.js";
11
12
  export * from "@fedify/vocab-runtime";
12
13
 
13
14
  //#region src/mod.d.ts
package/dist/mod.js CHANGED
@@ -3,12 +3,12 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./chunk-CRNNMoPX.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
5
5
  import "./compat/mod.js";
6
- import { C as parseAcceptSignature, S as fulfillAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk, w as validateAcceptSignature, x as formatAcceptSignature } from "./http-CouJSFVK.js";
7
- import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-Dtjz-hSk.js";
8
- import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "./proof-n60t8o9P.js";
6
+ import { C as formatAcceptSignature, E as validateAcceptSignature, T as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk, w as fulfillAcceptSignature } from "./http-CToqG5ap.js";
7
+ import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-D7FrhN9q.js";
8
+ import { a as verifyProof, c as getKeyOwner, d as detachSignature, f as hasSignatureLike, h as verifySignature, i as verifyObject, l as attachSignature, m as verifyJsonLd, n as hasProofLike, p as signJsonLd, r as signObject, s as doesActorOwnKey, t as createProof, u as createSignature } from "./proof-NRmtrTDu.js";
9
9
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-CAY3OdLq.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-DBNpsneh.js";
11
- import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CuCn2xvM.js";
11
+ import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
14
14
  import "./sig/mod.js";