@fedify/fedify 2.0.1 → 2.0.2-dev.407

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 (97) hide show
  1. package/dist/{builder-CqPrSnE5.js → builder-CmXCvILP.js} +3 -3
  2. package/dist/client-BxMZiQaD.d.ts +224 -0
  3. package/dist/client-C97KOq3x.d.cts +222 -0
  4. package/dist/compat/mod.d.cts +6 -6
  5. package/dist/compat/mod.d.ts +6 -6
  6. package/dist/compat/transformers.test.js +11 -11
  7. package/dist/context-Dy5ro7zD.d.ts +2515 -0
  8. package/dist/context-o4OhjMHe.d.cts +2513 -0
  9. package/dist/{deno-CIi8RNND.js → deno-r4zOZb6i.js} +1 -1
  10. package/dist/{docloader-CmrEfaGw.js → docloader-B3FBDYHA.js} +2 -2
  11. package/dist/federation/builder.test.js +3 -3
  12. package/dist/federation/handler.test.js +11 -11
  13. package/dist/federation/idempotency.test.js +11 -11
  14. package/dist/federation/inbox.test.js +2 -2
  15. package/dist/federation/middleware.test.js +11 -11
  16. package/dist/federation/mod.cjs +4 -4
  17. package/dist/federation/mod.d.cts +6 -6
  18. package/dist/federation/mod.d.ts +6 -6
  19. package/dist/federation/mod.js +4 -4
  20. package/dist/federation/send.test.js +5 -5
  21. package/dist/federation/webfinger.test.js +11 -11
  22. package/dist/{http-Dvox_xrq.js → http-B2qDw-ld.js} +2 -2
  23. package/dist/{http-BjroyS-9.cjs → http-BeDhqNdl.cjs} +1 -1
  24. package/dist/{http-CCsNu78I.js → http-Cu7-n4zt.js} +1 -1
  25. package/dist/http-Cz3MlXAZ.d.cts +244 -0
  26. package/dist/http-DkHdFfrc.d.ts +246 -0
  27. package/dist/{inbox-CiTdVhJQ.js → inbox-COVt7NM_.js} +1 -1
  28. package/dist/{key-C7JS89OH.js → key-D3c7zdQ4.js} +1 -1
  29. package/dist/kv-BL4nlICN.d.cts +110 -0
  30. package/dist/kv-DXEUEP6z.d.ts +113 -0
  31. package/dist/{kv-cache-BqFnozz0.cjs → kv-cache-BXA2Q9DI.cjs} +1 -1
  32. package/dist/{kv-cache-6b2ldIo-.js → kv-cache-CtV4175p.js} +1 -1
  33. package/dist/{ld-C8i1kViF.js → ld-B5-SoHWy.js} +2 -2
  34. package/dist/middleware-BDtfAFen.cjs +12 -0
  35. package/dist/{middleware-DqJ1cmZE.cjs → middleware-BjvalmrW.cjs} +4 -4
  36. package/dist/{middleware-CfL_Pd6a.js → middleware-CyrPv2j3.js} +4 -4
  37. package/dist/{middleware-B3GuN6Gj.js → middleware-D1v2KqML.js} +4 -4
  38. package/dist/{middleware-B4Bgz0MJ.js → middleware-Dp0_BtQF.js} +10 -10
  39. package/dist/{middleware-0fnsG0v7.js → middleware-DsPC0qJ_.js} +11 -11
  40. package/dist/mod-Bm_GwNTL.d.cts +80 -0
  41. package/dist/mod-CIR7gJW8.d.ts +64 -0
  42. package/dist/mod-CwZXZJ9d.d.ts +91 -0
  43. package/dist/mod-DPkRU3EK.d.cts +266 -0
  44. package/dist/mod-DQWhp0xs.d.ts +82 -0
  45. package/dist/mod-DUWcVv49.d.ts +268 -0
  46. package/dist/mod-DXsQakeS.d.cts +89 -0
  47. package/dist/mod-DwqZ5l67.d.cts +62 -0
  48. package/dist/mod.cjs +4 -4
  49. package/dist/mod.d.cts +9 -9
  50. package/dist/mod.d.ts +9 -9
  51. package/dist/mod.js +4 -4
  52. package/dist/nodeinfo/handler.test.js +11 -11
  53. package/dist/nodeinfo/mod.d.cts +1 -1
  54. package/dist/nodeinfo/mod.d.ts +1 -1
  55. package/dist/otel/mod.d.cts +145 -145
  56. package/dist/otel/mod.d.ts +145 -145
  57. package/dist/owner-1AbPBOOZ.d.cts +66 -0
  58. package/dist/{owner-BOSWh-ha.js → owner-KwXXBWZ3.js} +1 -1
  59. package/dist/owner-gd0Q9FuU.d.ts +68 -0
  60. package/dist/{proof-C8qvlfLD.cjs → proof-BcQ-0Eck.cjs} +1 -1
  61. package/dist/{proof-D61EYfPl.js → proof-DqYaOkxv.js} +1 -1
  62. package/dist/{proof-BeT_MFIx.js → proof-S-df7nOa.js} +2 -2
  63. package/dist/{send-D7lC06r9.js → send-BFqsdYMW.js} +2 -2
  64. package/dist/sig/http.test.js +3 -3
  65. package/dist/sig/key.test.js +2 -2
  66. package/dist/sig/ld.test.js +3 -3
  67. package/dist/sig/mod.cjs +2 -2
  68. package/dist/sig/mod.d.cts +3 -3
  69. package/dist/sig/mod.d.ts +3 -3
  70. package/dist/sig/mod.js +2 -2
  71. package/dist/sig/owner.test.js +3 -3
  72. package/dist/sig/proof.test.js +3 -3
  73. package/dist/utils/docloader.test.js +4 -4
  74. package/dist/utils/mod.cjs +2 -2
  75. package/dist/utils/mod.d.cts +3 -3
  76. package/dist/utils/mod.d.ts +3 -3
  77. package/dist/utils/mod.js +2 -2
  78. package/package.json +6 -6
  79. package/dist/client-CwkOPN13.d.cts +0 -222
  80. package/dist/client-a7NwzhA2.d.ts +0 -224
  81. package/dist/context-BdNW_8a3.d.cts +0 -2554
  82. package/dist/context-C-GVKcJR.d.ts +0 -2556
  83. package/dist/http-CCEu-x1_.d.cts +0 -253
  84. package/dist/http-CODSJcKx.d.ts +0 -255
  85. package/dist/kv-g9jFc34-.d.cts +0 -110
  86. package/dist/kv-jg_8SMc1.d.ts +0 -113
  87. package/dist/middleware-DILzU8Ot.cjs +0 -12
  88. package/dist/mod-5PNty1K9.d.cts +0 -80
  89. package/dist/mod-BcpEGTWV.d.cts +0 -62
  90. package/dist/mod-COO7VMcm.d.cts +0 -266
  91. package/dist/mod-CevNbUol.d.ts +0 -91
  92. package/dist/mod-CtO31FCx.d.ts +0 -64
  93. package/dist/mod-Da9fNDyC.d.ts +0 -82
  94. package/dist/mod-ErTjUJs9.d.cts +0 -89
  95. package/dist/mod-q2IR8UiH.d.ts +0 -268
  96. package/dist/owner-9yZ5Ibsb.d.cts +0 -66
  97. package/dist/owner-DQYAbVmX.d.ts +0 -68
@@ -0,0 +1,268 @@
1
+ import { Temporal } from "@js-temporal/polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import { KeyCache } from "./http-DkHdFfrc.js";
4
+ import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
5
+ import { TracerProvider } from "@opentelemetry/api";
6
+ import { DocumentLoader } from "@fedify/vocab-runtime";
7
+
8
+ //#region src/sig/ld.d.ts
9
+ /**
10
+ * A signature of a JSON-LD document.
11
+ * @since 1.0.0
12
+ */
13
+ interface Signature {
14
+ "@context"?: "https://w3id.org/identity/v1";
15
+ type: "RsaSignature2017";
16
+ id?: string;
17
+ creator: string;
18
+ created: string;
19
+ signatureValue: string;
20
+ }
21
+ /**
22
+ * Attaches a LD signature to the given JSON-LD document.
23
+ * @param jsonLd The JSON-LD document to attach the signature to. It is not
24
+ * modified.
25
+ * @param signature The signature to attach.
26
+ * @returns The JSON-LD document with the attached signature.
27
+ * @throws {TypeError} If the input document is not a valid JSON-LD document.
28
+ * @since 1.0.0
29
+ */
30
+ declare function attachSignature(jsonLd: unknown, signature: Signature): {
31
+ signature: Signature;
32
+ };
33
+ /**
34
+ * Options for creating Linked Data Signatures.
35
+ * @since 1.0.0
36
+ */
37
+ interface CreateSignatureOptions {
38
+ /**
39
+ * The context loader for loading remote JSON-LD contexts.
40
+ */
41
+ contextLoader?: DocumentLoader;
42
+ /**
43
+ * The time when the signature was created. If not specified, the current
44
+ * time will be used.
45
+ */
46
+ created?: Temporal.Instant;
47
+ }
48
+ /**
49
+ * Creates a LD signature for the given JSON-LD document.
50
+ * @param jsonLd The JSON-LD document to sign.
51
+ * @param privateKey The private key to sign the document.
52
+ * @param keyId The ID of the public key that corresponds to the private key.
53
+ * @param options Additional options for creating the signature.
54
+ * See also {@link CreateSignatureOptions}.
55
+ * @return The created signature.
56
+ * @throws {TypeError} If the private key is invalid or unsupported.
57
+ * @since 1.0.0
58
+ */
59
+ declare function createSignature(jsonLd: unknown, privateKey: CryptoKey, keyId: URL, {
60
+ contextLoader,
61
+ created
62
+ }?: CreateSignatureOptions): Promise<Signature>;
63
+ /**
64
+ * Options for signing JSON-LD documents.
65
+ * @since 1.0.0
66
+ */
67
+ interface SignJsonLdOptions extends CreateSignatureOptions {
68
+ /**
69
+ * The OpenTelemetry tracer provider for tracing the signing process.
70
+ * If omitted, the global tracer provider is used.
71
+ * @since 1.3.0
72
+ */
73
+ tracerProvider?: TracerProvider;
74
+ }
75
+ /**
76
+ * Signs the given JSON-LD document with the private key and returns the signed
77
+ * JSON-LD document.
78
+ * @param jsonLd The JSON-LD document to sign.
79
+ * @param privateKey The private key to sign the document.
80
+ * @param keyId The key ID to use in the signature. It will be used by the
81
+ * verifier to fetch the corresponding public key.
82
+ * @param options Additional options for signing the document.
83
+ * See also {@link SignJsonLdOptions}.
84
+ * @returns The signed JSON-LD document.
85
+ * @throws {TypeError} If the private key is invalid or unsupported.
86
+ * @since 1.0.0
87
+ */
88
+ declare function signJsonLd(jsonLd: unknown, privateKey: CryptoKey, keyId: URL, options: SignJsonLdOptions): Promise<{
89
+ signature: Signature;
90
+ }>;
91
+ /**
92
+ * Detaches Linked Data Signatures from the given JSON-LD document.
93
+ * @param jsonLd The JSON-LD document to modify.
94
+ * @returns The modified JSON-LD document. If the input document does not
95
+ * contain a signature, the original document is returned.
96
+ * @since 1.0.0
97
+ */
98
+ declare function detachSignature(jsonLd: unknown): unknown;
99
+ /**
100
+ * Options for verifying Linked Data Signatures.
101
+ * @since 1.0.0
102
+ */
103
+ interface VerifySignatureOptions {
104
+ /**
105
+ * The document loader to use for fetching the public key.
106
+ */
107
+ documentLoader?: DocumentLoader;
108
+ /**
109
+ * The context loader to use for JSON-LD context retrieval.
110
+ */
111
+ contextLoader?: DocumentLoader;
112
+ /**
113
+ * The key cache to use for caching public keys.
114
+ */
115
+ keyCache?: KeyCache;
116
+ /**
117
+ * The OpenTelemetry tracer provider for tracing the verification process.
118
+ * If omitted, the global tracer provider is used.
119
+ * @since 1.3.0
120
+ */
121
+ tracerProvider?: TracerProvider;
122
+ }
123
+ /**
124
+ * Verifies Linked Data Signatures of the given JSON-LD document.
125
+ * @param jsonLd The JSON-LD document to verify.
126
+ * @param options Options for verifying the signature.
127
+ * @returns The public key that signed the document or `null` if the signature
128
+ * is invalid or the key is not found.
129
+ * @since 1.0.0
130
+ */
131
+ declare function verifySignature(jsonLd: unknown, options?: VerifySignatureOptions): Promise<CryptographicKey | null>;
132
+ /**
133
+ * Options for verifying JSON-LD documents.
134
+ */
135
+ interface VerifyJsonLdOptions extends VerifySignatureOptions {}
136
+ /**
137
+ * Verify the authenticity of the given JSON-LD document using Linked Data
138
+ * Signatures. If the document is signed, this function verifies the signature
139
+ * and checks if the document is attributed to the owner of the public key.
140
+ * If the document is not signed, this function returns `false`.
141
+ * @param jsonLd The JSON-LD document to verify.
142
+ * @param options Options for verifying the document.
143
+ * @returns `true` if the document is authentic; `false` otherwise.
144
+ */
145
+ declare function verifyJsonLd(jsonLd: unknown, options?: VerifyJsonLdOptions): Promise<boolean>;
146
+ //#endregion
147
+ //#region src/sig/proof.d.ts
148
+ /**
149
+ * Options for {@link createProof}.
150
+ * @since 0.10.0
151
+ */
152
+ interface CreateProofOptions {
153
+ /**
154
+ * The context loader for loading remote JSON-LD contexts.
155
+ */
156
+ contextLoader?: DocumentLoader;
157
+ /**
158
+ * The JSON-LD context to use for serializing the object to sign.
159
+ */
160
+ context?: string | Record<string, string> | (string | Record<string, string>)[];
161
+ /**
162
+ * The time when the proof was created. If not specified, the current time
163
+ * will be used.
164
+ */
165
+ created?: Temporal.Instant;
166
+ }
167
+ /**
168
+ * Creates a proof for the given object.
169
+ * @param object The object to create a proof for.
170
+ * @param privateKey The private key to sign the proof with.
171
+ * @param keyId The key ID to use in the proof. It will be used by the verifier.
172
+ * @param options Additional options. See also {@link CreateProofOptions}.
173
+ * @returns The created proof.
174
+ * @throws {TypeError} If the private key is invalid or unsupported.
175
+ * @since 0.10.0
176
+ */
177
+ declare function createProof(object: Object$1, privateKey: CryptoKey, keyId: URL, {
178
+ contextLoader,
179
+ context,
180
+ created
181
+ }?: CreateProofOptions): Promise<DataIntegrityProof>;
182
+ /**
183
+ * Options for {@link signObject}.
184
+ * @since 0.10.0
185
+ */
186
+ interface SignObjectOptions extends CreateProofOptions {
187
+ /**
188
+ * The document loader for loading remote JSON-LD documents.
189
+ */
190
+ documentLoader?: DocumentLoader;
191
+ /**
192
+ * The OpenTelemetry tracer provider. If omitted, the global tracer provider
193
+ * is used.
194
+ * @since 1.3.0
195
+ */
196
+ tracerProvider?: TracerProvider;
197
+ }
198
+ /**
199
+ * Signs the given object with the private key and returns the signed object.
200
+ * @param object The object to create a proof for.
201
+ * @param privateKey The private key to sign the proof with.
202
+ * @param keyId The key ID to use in the proof. It will be used by the verifier.
203
+ * @param options Additional options. See also {@link SignObjectOptions}.
204
+ * @returns The signed object.
205
+ * @throws {TypeError} If the private key is invalid or unsupported.
206
+ * @since 0.10.0
207
+ */
208
+ declare function signObject<T extends Object$1>(object: T, privateKey: CryptoKey, keyId: URL, options?: SignObjectOptions): Promise<T>;
209
+ /**
210
+ * Options for {@link verifyProof}.
211
+ * @since 0.10.0
212
+ */
213
+ interface VerifyProofOptions {
214
+ /**
215
+ * The context loader for loading remote JSON-LD contexts.
216
+ */
217
+ contextLoader?: DocumentLoader;
218
+ /**
219
+ * The document loader for loading remote JSON-LD documents.
220
+ */
221
+ documentLoader?: DocumentLoader;
222
+ /**
223
+ * The key cache to use for caching public keys.
224
+ * @since 0.12.0
225
+ */
226
+ keyCache?: KeyCache;
227
+ /**
228
+ * The OpenTelemetry tracer provider. If omitted, the global tracer provider
229
+ * is used.
230
+ * @since 1.3.0
231
+ */
232
+ tracerProvider?: TracerProvider;
233
+ }
234
+ /**
235
+ * Verifies the given proof for the object.
236
+ * @param jsonLd The JSON-LD object to verify the proof for. If it contains
237
+ * any proofs, they will be ignored.
238
+ * @param proof The proof to verify.
239
+ * @param options Additional options. See also {@link VerifyProofOptions}.
240
+ * @returns The public key that was used to sign the proof, or `null` if the
241
+ * proof is invalid.
242
+ * @since 0.10.0
243
+ */
244
+ declare function verifyProof(jsonLd: unknown, proof: DataIntegrityProof, options?: VerifyProofOptions): Promise<Multikey | null>;
245
+ /**
246
+ * Options for {@link verifyObject}.
247
+ * @since 0.10.0
248
+ */
249
+ interface VerifyObjectOptions extends VerifyProofOptions {}
250
+ /**
251
+ * Verifies the given object. It will verify all the proofs in the object,
252
+ * and succeed only if all the proofs are valid and all attributions and
253
+ * actors are authenticated by the proofs.
254
+ * @template T The type of the object to verify.
255
+ * @param cls The class of the object to verify. It must be a subclass of
256
+ * the {@link Object}.
257
+ * @param jsonLd The JSON-LD object to verify. It's assumed that the object
258
+ * is a compacted JSON-LD representation of a `T` with `@context`.
259
+ * @param options Additional options. See also {@link VerifyObjectOptions}.
260
+ * @returns The object if it's verified, or `null` if it's not.
261
+ * @throws {TypeError} If the object is invalid or unsupported.
262
+ * @since 0.10.0
263
+ */
264
+ declare function verifyObject<T extends Object$1>(cls: (new (...args: any[]) => T) & {
265
+ fromJsonLd(jsonLd: unknown, options: VerifyObjectOptions): Promise<T>;
266
+ }, jsonLd: unknown, options?: VerifyObjectOptions): Promise<T | null>;
267
+ //#endregion
268
+ export { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature };
@@ -0,0 +1,89 @@
1
+ import { HttpMessageSignaturesSpecDeterminer } from "./http-Cz3MlXAZ.cjs";
2
+ import { KvKey, KvStore } from "./kv-BL4nlICN.cjs";
3
+ import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
4
+ import { TracerProvider } from "@opentelemetry/api";
5
+
6
+ //#region src/utils/docloader.d.ts
7
+ /**
8
+ * Options for {@link getAuthenticatedDocumentLoader}.
9
+ * @see {@link getAuthenticatedDocumentLoader}
10
+ * @since 1.3.0
11
+ */
12
+ interface GetAuthenticatedDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
13
+ /**
14
+ * An optional spec determiner for HTTP Message Signatures.
15
+ * It determines the spec to use for signing requests.
16
+ * It is used for double-knocking
17
+ * (see <https://swicg.github.io/activitypub-http-signature/#how-to-upgrade-supported-versions>).
18
+ * @since 1.6.0
19
+ */
20
+ specDeterminer?: HttpMessageSignaturesSpecDeterminer;
21
+ /**
22
+ * The OpenTelemetry tracer provider. If omitted, the global tracer provider
23
+ * is used.
24
+ * @since 1.6.0
25
+ */
26
+ tracerProvider?: TracerProvider;
27
+ }
28
+ /**
29
+ * Gets an authenticated {@link DocumentLoader} for the given identity.
30
+ * Note that an authenticated document loader intentionally does not cache
31
+ * the fetched documents.
32
+ * @param identity The identity to get the document loader for.
33
+ * The actor's key pair.
34
+ * @param options The options for the document loader.
35
+ * @returns The authenticated document loader.
36
+ * @throws {TypeError} If the key is invalid or unsupported.
37
+ * @since 0.4.0
38
+ */
39
+ declare function getAuthenticatedDocumentLoader(identity: {
40
+ keyId: URL;
41
+ privateKey: CryptoKey;
42
+ }, {
43
+ allowPrivateAddress,
44
+ userAgent,
45
+ specDeterminer,
46
+ tracerProvider
47
+ }?: GetAuthenticatedDocumentLoaderOptions): DocumentLoader;
48
+ //#endregion
49
+ //#region src/utils/kv-cache.d.ts
50
+ /**
51
+ * The parameters for {@link kvCache} function.
52
+ */
53
+ interface KvCacheParameters {
54
+ /**
55
+ * The document loader to decorate with a cache.
56
+ */
57
+ readonly loader: DocumentLoader;
58
+ /**
59
+ * The key–value store to use for backing the cache.
60
+ */
61
+ readonly kv: KvStore;
62
+ /**
63
+ * The key prefix to use for namespacing the cache.
64
+ * `["_fedify", "remoteDocument"]` by default.
65
+ */
66
+ readonly prefix?: KvKey;
67
+ /**
68
+ * The per-URL cache rules in the array of `[urlPattern, duration]` pairs
69
+ * where `urlPattern` is either a string, a {@link URL}, or
70
+ * a {@link URLPattern} and `duration` is a {@link Temporal.DurationLike}.
71
+ * The `duration` is allowed to be at most 30 days.
72
+ *
73
+ * By default, 5 minutes for all URLs.
74
+ */
75
+ readonly rules?: readonly [string | URL | URLPattern, Temporal.Duration | Temporal.DurationLike][];
76
+ }
77
+ /**
78
+ * Decorates a {@link DocumentLoader} with a cache backed by a {@link KvStore}.
79
+ * @param parameters The parameters for the cache.
80
+ * @returns The decorated document loader which is cache-enabled.
81
+ */
82
+ declare function kvCache({
83
+ loader,
84
+ kv,
85
+ prefix,
86
+ rules
87
+ }: KvCacheParameters): DocumentLoader;
88
+ //#endregion
89
+ export { getAuthenticatedDocumentLoader, kvCache };
@@ -0,0 +1,62 @@
1
+ import { ActorAliasMapper, ActorDispatcher, ActorHandleMapper, RequestContext, WebFingerLinksDispatcher } from "./context-o4OhjMHe.cjs";
2
+ import { Span, Tracer } from "@opentelemetry/api";
3
+
4
+ //#region src/federation/webfinger.d.ts
5
+ /**
6
+ * Parameters for {@link handleWebFinger}.
7
+ */
8
+ interface WebFingerHandlerParameters<TContextData> {
9
+ /**
10
+ * The request context.
11
+ */
12
+ context: RequestContext<TContextData>;
13
+ /**
14
+ * The canonical hostname of the server, if it's explicitly configured.
15
+ * @since 1.5.0
16
+ */
17
+ host?: string;
18
+ /**
19
+ * The callback for dispatching the actor.
20
+ */
21
+ actorDispatcher?: ActorDispatcher<TContextData>;
22
+ /**
23
+ * The callback for mapping a WebFinger username to the corresponding actor's
24
+ * internal identifier, or `null` if the username is not found.
25
+ * @since 0.15.0
26
+ */
27
+ actorHandleMapper?: ActorHandleMapper<TContextData>;
28
+ /**
29
+ * The callback for mapping a WebFinger query to the corresponding actor's
30
+ * internal identifier or username, or `null` if the query is not found.
31
+ * @since 1.4.0
32
+ */
33
+ actorAliasMapper?: ActorAliasMapper<TContextData>;
34
+ /**
35
+ * The callback for dispatching the Links of webFinger.
36
+ */
37
+ webFingerLinksDispatcher?: WebFingerLinksDispatcher<TContextData>;
38
+ /**
39
+ * The function to call when the actor is not found.
40
+ */
41
+ onNotFound(request: Request): Response | Promise<Response>;
42
+ /**
43
+ * The OpenTelemetry tracer.
44
+ * @since 1.3.0
45
+ */
46
+ tracer?: Tracer;
47
+ /**
48
+ * The span for the request.
49
+ * @since 1.3.0
50
+ */
51
+ span?: Span;
52
+ }
53
+ /**
54
+ * Handles a WebFinger request. You would not typically call this function
55
+ * directly, but instead use {@link Federation.fetch} method.
56
+ * @param request The WebFinger request to handle.
57
+ * @param parameters The parameters for handling the request.
58
+ * @returns The response to the request.
59
+ */
60
+ declare function handleWebFinger<TContextData>(request: Request, options: WebFingerHandlerParameters<TContextData>): Promise<Response>;
61
+ //#endregion
62
+ export { WebFingerHandlerParameters, handleWebFinger };
package/dist/mod.cjs CHANGED
@@ -5,12 +5,12 @@
5
5
  const require_chunk = require('./chunk-CGaQZ11T.cjs');
6
6
  const require_transformers = require('./transformers-3g8GZwkZ.cjs');
7
7
  require('./compat-DmDDELst.cjs');
8
- const require_http = require('./http-BjroyS-9.cjs');
9
- const require_middleware = require('./middleware-DqJ1cmZE.cjs');
10
- const require_proof = require('./proof-C8qvlfLD.cjs');
8
+ const require_http = require('./http-BeDhqNdl.cjs');
9
+ const require_middleware = require('./middleware-BjvalmrW.cjs');
10
+ const require_proof = require('./proof-BcQ-0Eck.cjs');
11
11
  const require_federation = require('./federation-Bp3HI26G.cjs');
12
12
  const require_types = require('./types-Cd_hszr_.cjs');
13
- const require_kv_cache = require('./kv-cache-BqFnozz0.cjs');
13
+ const require_kv_cache = require('./kv-cache-BXA2Q9DI.cjs');
14
14
  require('./nodeinfo-DuMYTpbZ.cjs');
15
15
  const require_runtime = require('./runtime-c2Njxsry.cjs');
16
16
  require('./sig-vX39WyWI.cjs');
package/dist/mod.d.cts CHANGED
@@ -1,14 +1,14 @@
1
1
  import { __export, __reExport, mod_d_exports } from "./mod-Bh8mqlYw.cjs";
2
- import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./client-CwkOPN13.cjs";
3
- import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-CCEu-x1_.cjs";
4
- import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "./owner-9yZ5Ibsb.cjs";
5
- import { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./context-BdNW_8a3.cjs";
6
- import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore } from "./kv-g9jFc34-.cjs";
7
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./mod-5PNty1K9.cjs";
8
- import { WebFingerHandlerParameters, handleWebFinger } from "./mod-BcpEGTWV.cjs";
2
+ import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./client-C97KOq3x.cjs";
3
+ import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-Cz3MlXAZ.cjs";
4
+ import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "./owner-1AbPBOOZ.cjs";
5
+ import { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./context-o4OhjMHe.cjs";
6
+ import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore } from "./kv-BL4nlICN.cjs";
7
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./mod-Bm_GwNTL.cjs";
8
+ import { WebFingerHandlerParameters, handleWebFinger } from "./mod-DwqZ5l67.cjs";
9
9
  import "./mod-gq_Xfdz8.cjs";
10
- import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./mod-COO7VMcm.cjs";
11
- import { getAuthenticatedDocumentLoader, kvCache } from "./mod-ErTjUJs9.cjs";
10
+ import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./mod-DPkRU3EK.cjs";
11
+ import { getAuthenticatedDocumentLoader, kvCache } from "./mod-DXsQakeS.cjs";
12
12
 
13
13
  //#region src/mod.d.ts
14
14
  declare namespace mod_d_exports$1 {
package/dist/mod.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { __export, __reExport } from "./chunk-DJNbSFdH.js";
4
- import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./client-a7NwzhA2.js";
5
- import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-CODSJcKx.js";
6
- import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "./owner-DQYAbVmX.js";
7
- import { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./context-C-GVKcJR.js";
8
- import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore } from "./kv-jg_8SMc1.js";
9
- import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./mod-Da9fNDyC.js";
10
- import { WebFingerHandlerParameters, handleWebFinger } from "./mod-CtO31FCx.js";
4
+ import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./client-BxMZiQaD.js";
5
+ import { FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestOptions, exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-DkHdFfrc.js";
6
+ import { DoesActorOwnKeyOptions, GetKeyOwnerOptions, doesActorOwnKey, getKeyOwner } from "./owner-gd0Q9FuU.js";
7
+ import { ActivityTransformer, ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "./context-Dy5ro7zD.js";
8
+ import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore } from "./kv-DXEUEP6z.js";
9
+ import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./mod-DQWhp0xs.js";
10
+ import { WebFingerHandlerParameters, handleWebFinger } from "./mod-CIR7gJW8.js";
11
11
  import "./mod-AGjRfPjT.js";
12
12
  import { mod_d_exports } from "./mod-D6HodEq7.js";
13
- import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./mod-q2IR8UiH.js";
14
- import { getAuthenticatedDocumentLoader, kvCache } from "./mod-CevNbUol.js";
13
+ import { CreateProofOptions, CreateSignatureOptions, SignJsonLdOptions, SignObjectOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyProofOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./mod-DUWcVv49.js";
14
+ import { getAuthenticatedDocumentLoader, kvCache } from "./mod-CwZXZJ9d.js";
15
15
 
16
16
  //#region src/mod.d.ts
17
17
  declare namespace mod_d_exports$1 {
package/dist/mod.js CHANGED
@@ -5,12 +5,12 @@
5
5
  import { __export, __reExport } from "./chunk-DJNbSFdH.js";
6
6
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./transformers-C3FLHUd6.js";
7
7
  import "./compat-Bb4NuTUO.js";
8
- import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-CCsNu78I.js";
9
- import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-B3GuN6Gj.js";
10
- import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-D61EYfPl.js";
8
+ import { exportJwk, fetchKey, generateCryptoKeyPair, importJwk, signRequest, verifyRequest } from "./http-Cu7-n4zt.js";
9
+ import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "./middleware-D1v2KqML.js";
10
+ import { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, getKeyOwner, signJsonLd, signObject, verifyJsonLd, verifyObject, verifyProof, verifySignature } from "./proof-DqYaOkxv.js";
11
11
  import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation-DaMfqRm4.js";
12
12
  import { getNodeInfo, nodeInfoToJson, parseNodeInfo } from "./types-C93Ob9cU.js";
13
- import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-6b2ldIo-.js";
13
+ import { getAuthenticatedDocumentLoader, kvCache } from "./kv-cache-CtV4175p.js";
14
14
  import "./nodeinfo-DoESQxq5.js";
15
15
  import { runtime_exports } from "./runtime-poamPCMb.js";
16
16
  import "./sig-BNhspNOf.js";
@@ -8,25 +8,25 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
8
8
  import "../assert-MZs1qjMx.js";
9
9
  import "../assert_instance_of-DHz7EHNU.js";
10
10
  import { MemoryKvStore } from "../kv-QzKcOQgP.js";
11
- import "../deno-CIi8RNND.js";
12
- import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-B4Bgz0MJ.js";
11
+ import "../deno-r4zOZb6i.js";
12
+ import { createFederation, handleNodeInfo, handleNodeInfoJrd } from "../middleware-Dp0_BtQF.js";
13
13
  import "../client-Dg7OfUDA.js";
14
14
  import "../router-D9eI0s4b.js";
15
15
  import "../types-CPz01LGH.js";
16
- import "../key-C7JS89OH.js";
17
- import "../http-Dvox_xrq.js";
18
- import "../ld-C8i1kViF.js";
19
- import "../owner-BOSWh-ha.js";
20
- import "../proof-BeT_MFIx.js";
21
- import "../docloader-CmrEfaGw.js";
16
+ import "../key-D3c7zdQ4.js";
17
+ import "../http-B2qDw-ld.js";
18
+ import "../ld-B5-SoHWy.js";
19
+ import "../owner-KwXXBWZ3.js";
20
+ import "../proof-S-df7nOa.js";
21
+ import "../docloader-B3FBDYHA.js";
22
22
  import "../kv-cache-B__dHl7g.js";
23
- import "../inbox-CiTdVhJQ.js";
24
- import "../builder-CqPrSnE5.js";
23
+ import "../inbox-COVt7NM_.js";
24
+ import "../builder-CmXCvILP.js";
25
25
  import "../collection-CcnIw1qY.js";
26
26
  import "../keycache-DRxpZ5r9.js";
27
27
  import "../negotiation-5NPJL6zp.js";
28
28
  import "../retry-D4GJ670a.js";
29
- import "../send-D7lC06r9.js";
29
+ import "../send-BFqsdYMW.js";
30
30
  import "../std__assert-DWivtrGR.js";
31
31
  import "../assert_rejects-Ce45JcFg.js";
32
32
  import "../assert_throws-BNXdRGWP.js";
@@ -1,3 +1,3 @@
1
- import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "../client-CwkOPN13.cjs";
1
+ import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "../client-C97KOq3x.cjs";
2
2
  import "../mod-gq_Xfdz8.cjs";
3
3
  export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };
@@ -1,5 +1,5 @@
1
1
  import { Temporal } from "@js-temporal/polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "../client-a7NwzhA2.js";
3
+ import { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo } from "../client-BxMZiQaD.js";
4
4
  import "../mod-AGjRfPjT.js";
5
5
  export { GetNodeInfoOptions, InboundService, JsonValue, NodeInfo, OutboundService, ParseNodeInfoOptions, Protocol, Services, Software, Usage, getNodeInfo, nodeInfoToJson, parseNodeInfo };