@fedify/fedify 2.1.1 → 2.1.3
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.
- package/dist/{accept-D7sAxyNa.js → accept-Dd__NiUL.mjs} +10 -8
- package/dist/{assert-MZs1qjMx.js → assert-ddO5KLpe.mjs} +5 -9
- package/dist/{assert_equals-DSbWqCm3.js → assert_equals-Ew3jOFa3.mjs} +55 -69
- package/dist/{assert_instance_of-DHz7EHNU.js → assert_instance_of-C4Ri6VuN.mjs} +5 -9
- package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals--wG9hV7u.mjs} +6 -13
- package/dist/{assert_rejects-0h7I2Esa.js → assert_rejects-B-qJtC9Z.mjs} +6 -11
- package/dist/{assert_throws-rjdMBf31.js → assert_throws-4NwKEy2q.mjs} +5 -10
- package/dist/{builder-DbKYZdSy.js → builder-BKo51w-F.mjs} +32 -41
- package/dist/{chunk-CGaQZ11T.cjs → chunk-DDcVe30Y.cjs} +23 -24
- package/dist/{chunk-DJNbSFdH.js → chunk-nlSIicah.js} +8 -8
- package/dist/{client-BxMZiQaD.d.ts → client-AtlibPOU.d.ts} +1 -1
- package/dist/{client-CoCIaTNO.js → client-DEpOVgY1.mjs} +9 -13
- package/dist/{client-C97KOq3x.d.cts → client-z-8dc-e1.d.cts} +1 -1
- package/dist/{collection-CSzG2j1P.js → collection-BD6-SZ6O.mjs} +7 -12
- package/dist/compat/mod.cjs +5 -8
- package/dist/compat/mod.d.cts +78 -6
- package/dist/compat/mod.d.ts +78 -6
- package/dist/compat/mod.js +4 -8
- package/dist/compat/transformers.test.mjs +62 -0
- package/dist/{context-DyJjQQ_H.d.ts → context-BOiMZBu5.d.ts} +9 -18
- package/dist/{context-BcqA-0BL.d.cts → context-BhZVy7RB.d.cts} +9 -18
- package/dist/{context-Aqenou7c.js → context-Juj6bdHC.mjs} +7 -11
- package/dist/deno-D5r_9RvZ.mjs +8 -0
- package/dist/{docloader-Ck0SCLXX.js → docloader-B9CXCw8i.mjs} +8 -14
- package/dist/{esm-nLm00z9V.js → esm-DVILvP5e.mjs} +50 -89
- package/dist/federation/builder.test.d.mts +2 -0
- package/dist/federation/{builder.test.js → builder.test.mjs} +21 -44
- package/dist/federation/collection.test.d.mts +2 -0
- package/dist/federation/collection.test.mjs +21 -0
- package/dist/federation/handler.test.d.mts +2 -0
- package/dist/federation/{handler.test.js → handler.test.mjs} +69 -131
- package/dist/federation/idempotency.test.d.mts +2 -0
- package/dist/federation/{idempotency.test.js → idempotency.test.mjs} +31 -63
- package/dist/federation/inbox.test.d.mts +2 -0
- package/dist/federation/{inbox.test.js → inbox.test.mjs} +8 -12
- package/dist/federation/keycache.test.d.mts +2 -0
- package/dist/federation/{keycache.test.js → keycache.test.mjs} +13 -19
- package/dist/federation/kv.test.d.mts +2 -0
- package/dist/federation/{kv.test.js → kv.test.mjs} +11 -22
- package/dist/federation/middleware.test.d.mts +2 -0
- package/dist/federation/{middleware.test.js → middleware.test.mjs} +173 -262
- package/dist/federation/mod.cjs +327 -16
- package/dist/federation/mod.d.cts +3 -6
- package/dist/federation/mod.d.ts +3 -6
- package/dist/federation/mod.js +322 -13
- package/dist/federation/mq.test.d.mts +2 -0
- package/dist/federation/{mq.test.js → mq.test.mjs} +21 -35
- package/dist/federation/negotiation.test.d.mts +2 -0
- package/dist/federation/{negotiation.test.js → negotiation.test.mjs} +9 -16
- package/dist/federation/retry.test.d.mts +2 -0
- package/dist/federation/{retry.test.js → retry.test.mjs} +8 -11
- package/dist/federation/router.test.d.mts +2 -0
- package/dist/federation/{router.test.js → router.test.mjs} +11 -16
- package/dist/federation/send.test.d.mts +2 -0
- package/dist/federation/{send.test.js → send.test.mjs} +22 -30
- package/dist/federation/webfinger.test.d.mts +2 -0
- package/dist/federation/{webfinger.test.js → webfinger.test.mjs} +22 -56
- package/dist/{http-DFzT4YFG.js → http-B53alCGi.mjs} +23 -43
- package/dist/{http-ca2xny58.cjs → http-BngkmEhl.cjs} +177 -302
- package/dist/{http-BudnHZE2.d.cts → http-CrGuipxe.d.cts} +1 -6
- package/dist/{http-EUQ6crVa.js → http-PS3wuU8D.js} +53 -184
- package/dist/{http-Dax_FIBo.d.ts → http-aQzN9Ayi.d.ts} +1 -6
- package/dist/{inbox-BMLz_-pL.js → inbox-CHsLu5ai.mjs} +18 -26
- package/dist/{key-CypuWa94.js → key-D9Np_ZXl.mjs} +29 -37
- package/dist/{keycache-CpGWAUbj.js → keycache-CCSwkQcY.mjs} +5 -10
- package/dist/{keys-BFve7QQv.js → keys-BAK-tUlf.mjs} +5 -9
- package/dist/{kv-BL4nlICN.d.cts → kv-CbLNp3zQ.d.cts} +1 -1
- package/dist/{kv-DXEUEP6z.d.ts → kv-GFYnFoOl.d.ts} +1 -1
- package/dist/{kv-cache-Bw2F2ABq.js → kv-cache-B01V7s3h.mjs} +4 -8
- package/dist/{kv-cache-SKgbvvu4.js → kv-cache-B2Qi5MGv.js} +6 -13
- package/dist/{kv-cache-BBJFLMW5.cjs → kv-cache-YCtINZK4.cjs} +27 -34
- package/dist/{kv-QzKcOQgP.js → kv-tL2TOE9X.mjs} +6 -10
- package/dist/{ld-CXLtTc0G.js → ld-BaxRFhDd.mjs} +17 -31
- package/dist/{middleware-CL6XaAFy.cjs → middleware-Bsv-7iX7.cjs} +532 -587
- package/dist/middleware-C37OmOz_.mjs +5 -0
- package/dist/middleware-CelV2xrI.cjs +4 -0
- package/dist/{middleware-CvS6hWm3.js → middleware-Dn1kk96N.js} +335 -382
- package/dist/{middleware-BHJ0xm0L.js → middleware-dFn6ozt5.mjs} +282 -317
- package/dist/{mod-Bx9jcLB8.d.cts → mod-B505FZBC.d.cts} +3 -3
- package/dist/{mod-em2Il1eD.d.cts → mod-Bp_CzKd4.d.cts} +2 -2
- package/dist/{mod-Cs2dYEwI.d.ts → mod-D7PAuO6k.d.ts} +3 -3
- package/dist/{mod-D6MdymW7.d.ts → mod-DKOAow7a.d.ts} +2 -2
- package/dist/{mod-Coe7KEgX.d.cts → mod-DoJBjjnO.d.cts} +2 -2
- package/dist/{mod-D6dOd--H.d.ts → mod-DvxszxXC.d.ts} +2 -2
- package/dist/mod.cjs +29 -74
- package/dist/mod.d.cts +11 -14
- package/dist/mod.d.ts +11 -15
- package/dist/mod.js +17 -71
- package/dist/{negotiation-BlAuS_nr.js → negotiation-DnsfFF8I.mjs} +7 -11
- package/dist/nodeinfo/client.test.d.mts +2 -0
- package/dist/nodeinfo/{client.test.js → client.test.mjs} +22 -40
- package/dist/nodeinfo/handler.test.d.mts +2 -0
- package/dist/nodeinfo/{handler.test.js → handler.test.mjs} +13 -43
- package/dist/nodeinfo/mod.cjs +5 -8
- package/dist/nodeinfo/mod.d.cts +2 -3
- package/dist/nodeinfo/mod.d.ts +2 -3
- package/dist/nodeinfo/mod.js +4 -8
- package/dist/nodeinfo/types.test.d.mts +2 -0
- package/dist/nodeinfo/{types.test.js → types.test.mjs} +9 -16
- package/dist/otel/exporter.test.d.mts +2 -0
- package/dist/otel/{exporter.test.js → exporter.test.mjs} +124 -178
- package/dist/otel/mod.cjs +15 -20
- package/dist/otel/mod.d.cts +2 -2
- package/dist/otel/mod.d.ts +2 -2
- package/dist/otel/mod.js +8 -14
- package/dist/{owner-gd0Q9FuU.d.ts → owner-74ARJ5TL.d.ts} +1 -1
- package/dist/{owner-1AbPBOOZ.d.cts → owner-CptqhsOy.d.cts} +1 -1
- package/dist/{owner-CwMai3jn.js → owner-dxM51u36.mjs} +11 -16
- package/dist/{proof-ZuJBOUoi.js → proof-CH5U0k7G.mjs} +21 -33
- package/dist/{proof-sCID81Ua.cjs → proof-D39qiki3.cjs} +133 -157
- package/dist/{proof-6Zw1FW7t.js → proof-Dpgqx9RS.js} +32 -58
- package/dist/{retry-mqLf4b-R.js → retry-B_E3V_Dx.mjs} +4 -7
- package/dist/{router-D9eI0s4b.js → router-CrMLXoOr.mjs} +4 -8
- package/dist/runtime/mod.cjs +11 -13
- package/dist/runtime/mod.d.cts +6 -2
- package/dist/runtime/mod.d.ts +0 -1
- package/dist/runtime/mod.js +4 -7
- package/dist/{send-BW73dy6Q.js → send-D1-4ZnQq.mjs} +8 -13
- package/dist/sig/accept.test.d.mts +2 -0
- package/dist/sig/{accept.test.js → accept.test.mjs} +35 -70
- package/dist/sig/http.test.d.mts +2 -0
- package/dist/sig/{http.test.js → http.test.mjs} +166 -280
- package/dist/sig/key.test.d.mts +2 -0
- package/dist/sig/{key.test.js → key.test.mjs} +11 -18
- package/dist/sig/ld.test.d.mts +2 -0
- package/dist/sig/{ld.test.js → ld.test.mjs} +22 -35
- package/dist/sig/mod.cjs +6 -9
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +5 -9
- package/dist/sig/owner.test.d.mts +2 -0
- package/dist/sig/{owner.test.js → owner.test.mjs} +19 -34
- package/dist/sig/proof.test.d.mts +2 -0
- package/dist/sig/{proof.test.js → proof.test.mjs} +16 -27
- package/dist/{std__assert-X-_kMxKM.js → std__assert-Duiq_YC9.mjs} +12 -24
- package/dist/testing/{mod.d.ts → mod.d.mts} +26 -90
- package/dist/testing/mod.mjs +6 -0
- package/dist/{transformers-3g8GZwkZ.cjs → transformers-NeAONrAq.cjs} +20 -25
- package/dist/{transformers-C3FLHUd6.js → transformers-ve6e2xcg.js} +3 -7
- package/dist/{types-CPz01LGH.js → types-DCP0WLdt.mjs} +4 -7
- package/dist/{types-Cd_hszr_.cjs → types-KC4QAoxe.cjs} +29 -34
- package/dist/{types-C93Ob9cU.js → types-hvL8ElAs.js} +8 -13
- package/dist/utils/docloader.test.d.mts +2 -0
- package/dist/utils/{docloader.test.js → docloader.test.mjs} +14 -25
- package/dist/utils/kv-cache.test.d.mts +2 -0
- package/dist/utils/{kv-cache.test.js → kv-cache.test.mjs} +25 -40
- package/dist/utils/mod.cjs +5 -9
- package/dist/utils/mod.d.cts +1 -3
- package/dist/utils/mod.d.ts +1 -3
- package/dist/utils/mod.js +4 -9
- package/dist/vocab/cjs.test.d.mts +2 -0
- package/dist/vocab/cjs.test.mjs +14 -0
- package/dist/vocab/mod.cjs +10 -12
- package/dist/vocab/mod.js +3 -5
- package/package.json +8 -8
- package/dist/compat/transformers.test.d.ts +0 -3
- package/dist/compat/transformers.test.js +0 -88
- package/dist/compat-Bb4NuTUO.js +0 -4
- package/dist/compat-DmDDELst.cjs +0 -4
- package/dist/deno-DH972JvX.js +0 -121
- package/dist/federation/builder.test.d.ts +0 -3
- package/dist/federation/collection.test.d.ts +0 -3
- package/dist/federation/collection.test.js +0 -32
- package/dist/federation/handler.test.d.ts +0 -3
- package/dist/federation/idempotency.test.d.ts +0 -3
- package/dist/federation/inbox.test.d.ts +0 -3
- package/dist/federation/keycache.test.d.ts +0 -3
- package/dist/federation/kv.test.d.ts +0 -3
- package/dist/federation/middleware.test.d.ts +0 -3
- package/dist/federation/mq.test.d.ts +0 -3
- package/dist/federation/negotiation.test.d.ts +0 -3
- package/dist/federation/retry.test.d.ts +0 -3
- package/dist/federation/router.test.d.ts +0 -3
- package/dist/federation/send.test.d.ts +0 -3
- package/dist/federation/webfinger.test.d.ts +0 -3
- package/dist/federation-Bp3HI26G.cjs +0 -350
- package/dist/federation-DaMfqRm4.js +0 -332
- package/dist/middleware-B8FJuMM0.js +0 -27
- package/dist/middleware-BVp930fR.js +0 -12
- package/dist/middleware-BvGP-uXy.cjs +0 -12
- package/dist/mod-B7QkWzrL.d.cts +0 -80
- package/dist/mod-Bh8mqlYw.d.cts +0 -9
- package/dist/mod-D6HodEq7.d.ts +0 -7
- package/dist/mod-SMHOMNpZ.d.ts +0 -82
- package/dist/mod-gq_Xfdz8.d.cts +0 -1
- package/dist/nodeinfo/client.test.d.ts +0 -3
- package/dist/nodeinfo/handler.test.d.ts +0 -3
- package/dist/nodeinfo/types.test.d.ts +0 -3
- package/dist/nodeinfo-DoESQxq5.js +0 -4
- package/dist/nodeinfo-DuMYTpbZ.cjs +0 -4
- package/dist/otel/exporter.test.d.ts +0 -3
- package/dist/runtime-c2Njxsry.cjs +0 -17
- package/dist/runtime-poamPCMb.js +0 -13
- package/dist/sig/accept.test.d.ts +0 -3
- package/dist/sig/http.test.d.ts +0 -3
- package/dist/sig/key.test.d.ts +0 -3
- package/dist/sig/ld.test.d.ts +0 -3
- package/dist/sig/owner.test.d.ts +0 -3
- package/dist/sig/proof.test.d.ts +0 -3
- package/dist/sig-BNhspNOf.js +0 -4
- package/dist/sig-vX39WyWI.cjs +0 -4
- package/dist/testing/mod.js +0 -10
- package/dist/utils/docloader.test.d.ts +0 -3
- package/dist/utils/kv-cache.test.d.ts +0 -3
- package/dist/utils-BQ9KqEK9.cjs +0 -4
- package/dist/utils-Dn5OPdSW.js +0 -4
- /package/dist/{mod-AGjRfPjT.d.ts → compat/transformers.test.d.mts} +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
globalThis.addEventListener = () => {};
|
|
4
3
|
import { testDefinitions } from "@fedify/fixture";
|
|
5
4
|
import { Activity, Actor, Collection, CryptographicKey, Hashtag, Link, LookupObjectOptions, Multikey, Object as Object$1, Recipient, TraverseCollectionOptions } from "@fedify/vocab";
|
|
6
|
-
import { DocumentLoader, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
7
5
|
import { Link as Link$1, LookupWebFingerOptions, ResourceDescriptor } from "@fedify/webfinger";
|
|
8
6
|
import { TracerProvider } from "@opentelemetry/api";
|
|
7
|
+
import { DocumentLoader, GetUserAgentOptions } from "@fedify/vocab-runtime";
|
|
9
8
|
|
|
10
9
|
//#region src/nodeinfo/types.d.ts
|
|
11
10
|
/**
|
|
@@ -131,12 +130,6 @@ interface Usage {
|
|
|
131
130
|
*/
|
|
132
131
|
readonly localComments: number;
|
|
133
132
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Converts a {@link NodeInfo} object to a JSON value.
|
|
136
|
-
* @param nodeInfo The {@link NodeInfo} object to convert.
|
|
137
|
-
* @returns The JSON value that complies with the NodeInfo schema.
|
|
138
|
-
* @throws {TypeError} If the {@link NodeInfo} object is invalid.
|
|
139
|
-
*/
|
|
140
133
|
//#endregion
|
|
141
134
|
//#region src/nodeinfo/client.d.ts
|
|
142
135
|
/**
|
|
@@ -172,22 +165,8 @@ interface GetNodeInfoOptions {
|
|
|
172
165
|
*/
|
|
173
166
|
userAgent?: GetUserAgentOptions | string;
|
|
174
167
|
}
|
|
175
|
-
/**
|
|
176
|
-
* Fetches a NodeInfo document from the given URL.
|
|
177
|
-
* @param url The base URL of the server. If `options.direct` is turned off
|
|
178
|
-
* (default), the NodeInfo document will be fetched from
|
|
179
|
-
* the `.well-known` location of this URL (hence the only origin
|
|
180
|
-
* of the URL is used). If `options.direct` is turned on,
|
|
181
|
-
* the NodeInfo document will be fetched from the given URL.
|
|
182
|
-
* @param options Options for fetching the NodeInfo document.
|
|
183
|
-
* @returns The NodeInfo document if it could be fetched successfully.
|
|
184
|
-
* Otherwise, `undefined` is returned.
|
|
185
|
-
* @since 1.2.0
|
|
186
|
-
*/
|
|
187
|
-
|
|
188
168
|
//#endregion
|
|
189
169
|
//#region src/sig/key.d.ts
|
|
190
|
-
|
|
191
170
|
/**
|
|
192
171
|
* Detailed fetch failure information from {@link fetchKeyDetailed}.
|
|
193
172
|
* @since 2.1.0
|
|
@@ -198,10 +177,6 @@ type FetchKeyErrorResult = {
|
|
|
198
177
|
} | {
|
|
199
178
|
readonly error: Error;
|
|
200
179
|
};
|
|
201
|
-
/**
|
|
202
|
-
* The result of {@link fetchKeyDetailed}.
|
|
203
|
-
* @since 2.1.0
|
|
204
|
-
*/
|
|
205
180
|
//#endregion
|
|
206
181
|
//#region src/sig/owner.d.ts
|
|
207
182
|
/**
|
|
@@ -224,20 +199,8 @@ interface GetKeyOwnerOptions {
|
|
|
224
199
|
*/
|
|
225
200
|
tracerProvider?: TracerProvider;
|
|
226
201
|
}
|
|
227
|
-
/**
|
|
228
|
-
* Gets the actor that owns the specified key. Returns `null` if the key has no
|
|
229
|
-
* known owner.
|
|
230
|
-
*
|
|
231
|
-
* @param keyId The ID of the key to check, or the key itself.
|
|
232
|
-
* @param options Options for getting the key owner.
|
|
233
|
-
* @returns The actor that owns the key, or `null` if the key has no known
|
|
234
|
-
* owner.
|
|
235
|
-
* @since 0.7.0
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
202
|
//#endregion
|
|
239
203
|
//#region src/sig/http.d.ts
|
|
240
|
-
|
|
241
204
|
/**
|
|
242
205
|
* The reason why {@link verifyRequestDetailed} could not verify a request.
|
|
243
206
|
* @since 2.1.0
|
|
@@ -252,10 +215,6 @@ type VerifyRequestFailureReason = {
|
|
|
252
215
|
} | {
|
|
253
216
|
readonly type: "noSignature";
|
|
254
217
|
};
|
|
255
|
-
/**
|
|
256
|
-
* The detailed result of {@link verifyRequestDetailed}.
|
|
257
|
-
* @since 2.1.0
|
|
258
|
-
*/
|
|
259
218
|
//#endregion
|
|
260
219
|
//#region src/federation/collection.d.ts
|
|
261
220
|
/**
|
|
@@ -266,14 +225,6 @@ interface PageItems<TItem> {
|
|
|
266
225
|
readonly nextCursor?: string | null;
|
|
267
226
|
readonly items: readonly TItem[];
|
|
268
227
|
}
|
|
269
|
-
/**
|
|
270
|
-
* Calculates the [partial follower collection digest][1].
|
|
271
|
-
*
|
|
272
|
-
* [1]: https://w3id.org/fep/8fcf#partial-follower-collection-digest
|
|
273
|
-
* @param uris The URIs to calculate the digest. Duplicate URIs are ignored.
|
|
274
|
-
* @returns The digest.
|
|
275
|
-
*/
|
|
276
|
-
|
|
277
228
|
//#endregion
|
|
278
229
|
//#region src/federation/send.d.ts
|
|
279
230
|
/**
|
|
@@ -290,10 +241,6 @@ interface SenderKeyPair {
|
|
|
290
241
|
*/
|
|
291
242
|
readonly keyId: URL;
|
|
292
243
|
}
|
|
293
|
-
/**
|
|
294
|
-
* Parameters for {@link sendActivity}.
|
|
295
|
-
*/
|
|
296
|
-
|
|
297
244
|
/**
|
|
298
245
|
* An error that is thrown when an activity fails to send to a remote inbox.
|
|
299
246
|
* It contains structured information about the failure, including the HTTP
|
|
@@ -497,15 +444,6 @@ type SharedInboxKeyDispatcher<TContextData> = (context: Context<TContextData>) =
|
|
|
497
444
|
} | {
|
|
498
445
|
username: string;
|
|
499
446
|
} | null>;
|
|
500
|
-
/**
|
|
501
|
-
* A callback that handles errors during outbox processing.
|
|
502
|
-
*
|
|
503
|
-
* @param error The error that occurred.
|
|
504
|
-
* @param activity The activity that caused the error. If it is `null`, the
|
|
505
|
-
* error occurred during deserializing the activity.
|
|
506
|
-
* @since 0.6.0
|
|
507
|
-
*/
|
|
508
|
-
|
|
509
447
|
/**
|
|
510
448
|
* A callback that handles permanent delivery failures when sending activities
|
|
511
449
|
* to remote inboxes.
|
|
@@ -527,13 +465,9 @@ type SharedInboxKeyDispatcher<TContextData> = (context: Context<TContextData>) =
|
|
|
527
465
|
* @since 2.0.0
|
|
528
466
|
*/
|
|
529
467
|
type OutboxPermanentFailureHandler<TContextData> = (context: Context<TContextData>, values: {
|
|
530
|
-
/** The inbox URL that failed. */
|
|
531
|
-
readonly
|
|
532
|
-
/** The
|
|
533
|
-
readonly activity: Activity;
|
|
534
|
-
/** The error that occurred. */
|
|
535
|
-
readonly error: SendActivityError;
|
|
536
|
-
/** The HTTP status code returned by the inbox. */
|
|
468
|
+
/** The inbox URL that failed. */readonly inbox: URL; /** The activity that failed to deliver. */
|
|
469
|
+
readonly activity: Activity; /** The error that occurred. */
|
|
470
|
+
readonly error: SendActivityError; /** The HTTP status code returned by the inbox. */
|
|
537
471
|
readonly statusCode: number;
|
|
538
472
|
/**
|
|
539
473
|
* The actor IDs that were supposed to receive the activity at this inbox.
|
|
@@ -1102,15 +1036,6 @@ interface Federation<TContextData> extends Federatable<TContextData> {
|
|
|
1102
1036
|
*/
|
|
1103
1037
|
fetch(request: Request, options: FederationFetchOptions<TContextData>): Promise<Response>;
|
|
1104
1038
|
}
|
|
1105
|
-
/**
|
|
1106
|
-
* A builder for creating a {@link Federation} object. It defers the actual
|
|
1107
|
-
* instantiation of the {@link Federation} object until the {@link build}
|
|
1108
|
-
* method is called so that dispatchers and listeners can be registered
|
|
1109
|
-
* before the {@link Federation} object is instantiated.
|
|
1110
|
-
* @template TContextData The context data to pass to the {@link Context}.
|
|
1111
|
-
* @since 1.6.0
|
|
1112
|
-
*/
|
|
1113
|
-
|
|
1114
1039
|
/**
|
|
1115
1040
|
* Additional settings for the actor dispatcher.
|
|
1116
1041
|
*
|
|
@@ -1972,7 +1897,8 @@ type ParseUriResult =
|
|
|
1972
1897
|
}
|
|
1973
1898
|
/**
|
|
1974
1899
|
* The case of an object URI.
|
|
1975
|
-
*/
|
|
1900
|
+
*/
|
|
1901
|
+
| {
|
|
1976
1902
|
readonly type: "object";
|
|
1977
1903
|
readonly class: ConstructorWithTypeId<Object$1>;
|
|
1978
1904
|
readonly typeId: URL;
|
|
@@ -1980,59 +1906,68 @@ type ParseUriResult =
|
|
|
1980
1906
|
}
|
|
1981
1907
|
/**
|
|
1982
1908
|
* The case of an shared inbox URI.
|
|
1983
|
-
*/
|
|
1909
|
+
*/
|
|
1910
|
+
| {
|
|
1984
1911
|
readonly type: "inbox";
|
|
1985
1912
|
readonly identifier: undefined;
|
|
1986
1913
|
}
|
|
1987
1914
|
/**
|
|
1988
1915
|
* The case of an personal inbox URI.
|
|
1989
|
-
*/
|
|
1916
|
+
*/
|
|
1917
|
+
| {
|
|
1990
1918
|
readonly type: "inbox";
|
|
1991
1919
|
readonly identifier: string;
|
|
1992
1920
|
}
|
|
1993
1921
|
/**
|
|
1994
1922
|
* The case of an outbox collection URI.
|
|
1995
|
-
*/
|
|
1923
|
+
*/
|
|
1924
|
+
| {
|
|
1996
1925
|
readonly type: "outbox";
|
|
1997
1926
|
readonly identifier: string;
|
|
1998
1927
|
}
|
|
1999
1928
|
/**
|
|
2000
1929
|
* The case of a following collection URI.
|
|
2001
|
-
*/
|
|
1930
|
+
*/
|
|
1931
|
+
| {
|
|
2002
1932
|
readonly type: "following";
|
|
2003
1933
|
readonly identifier: string;
|
|
2004
1934
|
}
|
|
2005
1935
|
/**
|
|
2006
1936
|
* The case of a followers collection URI.
|
|
2007
|
-
*/
|
|
1937
|
+
*/
|
|
1938
|
+
| {
|
|
2008
1939
|
readonly type: "followers";
|
|
2009
1940
|
readonly identifier: string;
|
|
2010
1941
|
}
|
|
2011
1942
|
/**
|
|
2012
1943
|
* The case of a liked collection URI.
|
|
2013
1944
|
* @since 0.11.0
|
|
2014
|
-
*/
|
|
1945
|
+
*/
|
|
1946
|
+
| {
|
|
2015
1947
|
readonly type: "liked";
|
|
2016
1948
|
readonly identifier: string;
|
|
2017
1949
|
}
|
|
2018
1950
|
/**
|
|
2019
1951
|
* The case of a featured collection URI.
|
|
2020
1952
|
* @since 0.11.0
|
|
2021
|
-
*/
|
|
1953
|
+
*/
|
|
1954
|
+
| {
|
|
2022
1955
|
readonly type: "featured";
|
|
2023
1956
|
readonly identifier: string;
|
|
2024
1957
|
}
|
|
2025
1958
|
/**
|
|
2026
1959
|
* The case of a featured tags collection URI.
|
|
2027
1960
|
* @since 0.11.0
|
|
2028
|
-
*/
|
|
1961
|
+
*/
|
|
1962
|
+
| {
|
|
2029
1963
|
readonly type: "featuredTags";
|
|
2030
1964
|
readonly identifier: string;
|
|
2031
1965
|
}
|
|
2032
1966
|
/**
|
|
2033
1967
|
* The case of a custom collection URI.
|
|
2034
1968
|
* @since 1.8.0
|
|
2035
|
-
*/
|
|
1969
|
+
*/
|
|
1970
|
+
| {
|
|
2036
1971
|
readonly type: "collection";
|
|
2037
1972
|
readonly name: string | symbol;
|
|
2038
1973
|
readonly class: ConstructorWithTypeId<Object$1>;
|
|
@@ -2042,7 +1977,8 @@ type ParseUriResult =
|
|
|
2042
1977
|
/**
|
|
2043
1978
|
* The case of a custom ordered collection URI.
|
|
2044
1979
|
* @since 1.8.0
|
|
2045
|
-
*/
|
|
1980
|
+
*/
|
|
1981
|
+
| {
|
|
2046
1982
|
readonly type: "orderedCollection";
|
|
2047
1983
|
readonly name: string | symbol;
|
|
2048
1984
|
readonly class: ConstructorWithTypeId<Object$1>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { n as createRequestContext, t as createInboxContext } from "../context-Juj6bdHC.mjs";
|
|
5
|
+
import { testDefinitions } from "@fedify/fixture";
|
|
6
|
+
export { createInboxContext, createRequestContext, testDefinitions };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const require_chunk = require('./chunk-CGaQZ11T.cjs');
|
|
6
|
-
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
7
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
require("./chunk-DDcVe30Y.cjs");
|
|
8
4
|
//#region src/compat/transformers.ts
|
|
9
|
-
const logger = (0,
|
|
5
|
+
const logger = (0, require("@logtape/logtape").getLogger)([
|
|
10
6
|
"fedify",
|
|
11
7
|
"compat",
|
|
12
8
|
"transformers"
|
|
@@ -94,23 +90,22 @@ function actorDehydrator(activity, _context) {
|
|
|
94
90
|
function getDefaultActivityTransformers() {
|
|
95
91
|
return [autoIdAssigner, actorDehydrator];
|
|
96
92
|
}
|
|
97
|
-
|
|
98
93
|
//#endregion
|
|
99
|
-
Object.defineProperty(exports,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
Object.defineProperty(exports, "actorDehydrator", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function() {
|
|
97
|
+
return actorDehydrator;
|
|
98
|
+
}
|
|
104
99
|
});
|
|
105
|
-
Object.defineProperty(exports,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
Object.defineProperty(exports, "autoIdAssigner", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function() {
|
|
103
|
+
return autoIdAssigner;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "getDefaultActivityTransformers", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function() {
|
|
109
|
+
return getDefaultActivityTransformers;
|
|
110
|
+
}
|
|
110
111
|
});
|
|
111
|
-
Object.defineProperty(exports, 'getDefaultActivityTransformers', {
|
|
112
|
-
enumerable: true,
|
|
113
|
-
get: function () {
|
|
114
|
-
return getDefaultActivityTransformers;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
5
3
|
import { getLogger } from "@logtape/logtape";
|
|
6
|
-
|
|
7
4
|
//#region src/compat/transformers.ts
|
|
8
5
|
const logger = getLogger([
|
|
9
6
|
"fedify",
|
|
@@ -93,6 +90,5 @@ function actorDehydrator(activity, _context) {
|
|
|
93
90
|
function getDefaultActivityTransformers() {
|
|
94
91
|
return [autoIdAssigner, actorDehydrator];
|
|
95
92
|
}
|
|
96
|
-
|
|
97
93
|
//#endregion
|
|
98
|
-
export {
|
|
94
|
+
export { autoIdAssigner as n, getDefaultActivityTransformers as r, actorDehydrator as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
6
4
|
//#region src/nodeinfo/types.ts
|
|
7
5
|
/**
|
|
8
6
|
* Converts a {@link NodeInfo} object to a JSON value.
|
|
@@ -44,6 +42,5 @@ function nodeInfoToJson(nodeInfo) {
|
|
|
44
42
|
metadata: nodeInfo.metadata ?? {}
|
|
45
43
|
};
|
|
46
44
|
}
|
|
47
|
-
|
|
48
45
|
//#endregion
|
|
49
|
-
export { nodeInfoToJson };
|
|
46
|
+
export { nodeInfoToJson as t };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
|
7
|
-
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
|
8
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
require("./chunk-DDcVe30Y.cjs");
|
|
4
|
+
let _logtape_logtape = require("@logtape/logtape");
|
|
5
|
+
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
9
6
|
//#region src/nodeinfo/client.ts
|
|
10
|
-
const logger = (0,
|
|
7
|
+
const logger = (0, _logtape_logtape.getLogger)([
|
|
11
8
|
"fedify",
|
|
12
9
|
"nodeinfo",
|
|
13
10
|
"client"
|
|
@@ -19,7 +16,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
19
16
|
const wellKnownUrl = new URL("/.well-known/nodeinfo", url);
|
|
20
17
|
const wellKnownResponse = await fetch(wellKnownUrl, { headers: {
|
|
21
18
|
Accept: "application/json",
|
|
22
|
-
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0,
|
|
19
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, _fedify_vocab_runtime.getUserAgent)(options.userAgent)
|
|
23
20
|
} });
|
|
24
21
|
if (!wellKnownResponse.ok) {
|
|
25
22
|
logger.error("Failed to fetch {url}: {status} {statusText}", {
|
|
@@ -27,22 +24,22 @@ async function getNodeInfo(url, options = {}) {
|
|
|
27
24
|
status: wellKnownResponse.status,
|
|
28
25
|
statusText: wellKnownResponse.statusText
|
|
29
26
|
});
|
|
30
|
-
return
|
|
27
|
+
return;
|
|
31
28
|
}
|
|
32
29
|
const wellKnownRd = await wellKnownResponse.json();
|
|
33
|
-
const link = wellKnownRd?.links?.find((link
|
|
30
|
+
const link = wellKnownRd?.links?.find((link) => link != null && "rel" in link && (link.rel === "http://nodeinfo.diaspora.software/ns/schema/2.0" || link.rel === "http://nodeinfo.diaspora.software/ns/schema/2.1") && "href" in link && link.href != null);
|
|
34
31
|
if (link == null || link.href == null) {
|
|
35
32
|
logger.error("Failed to find a NodeInfo document link from {url}: {resourceDescriptor}", {
|
|
36
33
|
url: wellKnownUrl.href,
|
|
37
34
|
resourceDescriptor: wellKnownRd
|
|
38
35
|
});
|
|
39
|
-
return
|
|
36
|
+
return;
|
|
40
37
|
}
|
|
41
38
|
nodeInfoUrl = link.href;
|
|
42
39
|
}
|
|
43
40
|
const response = await fetch(nodeInfoUrl, { headers: {
|
|
44
41
|
Accept: "application/json",
|
|
45
|
-
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0,
|
|
42
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : (0, _fedify_vocab_runtime.getUserAgent)(options.userAgent)
|
|
46
43
|
} });
|
|
47
44
|
if (!response.ok) {
|
|
48
45
|
logger.error("Failed to fetch NodeInfo document from {url}: {status} {statusText}", {
|
|
@@ -50,7 +47,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
50
47
|
status: response.status,
|
|
51
48
|
statusText: response.statusText
|
|
52
49
|
});
|
|
53
|
-
return
|
|
50
|
+
return;
|
|
54
51
|
}
|
|
55
52
|
const data = await response.json();
|
|
56
53
|
if (options.parse === "none") return data;
|
|
@@ -60,7 +57,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
60
57
|
url: url.toString(),
|
|
61
58
|
error
|
|
62
59
|
});
|
|
63
|
-
return
|
|
60
|
+
return;
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
/**
|
|
@@ -255,7 +252,6 @@ function parseUsage(data, options = {}) {
|
|
|
255
252
|
localComments
|
|
256
253
|
};
|
|
257
254
|
}
|
|
258
|
-
|
|
259
255
|
//#endregion
|
|
260
256
|
//#region src/nodeinfo/types.ts
|
|
261
257
|
/**
|
|
@@ -298,23 +294,22 @@ function nodeInfoToJson(nodeInfo) {
|
|
|
298
294
|
metadata: nodeInfo.metadata ?? {}
|
|
299
295
|
};
|
|
300
296
|
}
|
|
301
|
-
|
|
302
297
|
//#endregion
|
|
303
|
-
Object.defineProperty(exports,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
298
|
+
Object.defineProperty(exports, "getNodeInfo", {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
get: function() {
|
|
301
|
+
return getNodeInfo;
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
Object.defineProperty(exports, "nodeInfoToJson", {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: function() {
|
|
307
|
+
return nodeInfoToJson;
|
|
308
|
+
}
|
|
308
309
|
});
|
|
309
|
-
Object.defineProperty(exports,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
Object.defineProperty(exports, "parseNodeInfo", {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
get: function() {
|
|
313
|
+
return parseNodeInfo;
|
|
314
|
+
}
|
|
314
315
|
});
|
|
315
|
-
Object.defineProperty(exports, 'parseNodeInfo', {
|
|
316
|
-
enumerable: true,
|
|
317
|
-
get: function () {
|
|
318
|
-
return parseNodeInfo;
|
|
319
|
-
}
|
|
320
|
-
});
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
5
3
|
import { getLogger } from "@logtape/logtape";
|
|
6
4
|
import { getUserAgent } from "@fedify/vocab-runtime";
|
|
7
|
-
|
|
8
5
|
//#region src/nodeinfo/client.ts
|
|
9
6
|
const logger = getLogger([
|
|
10
7
|
"fedify",
|
|
@@ -26,16 +23,16 @@ async function getNodeInfo(url, options = {}) {
|
|
|
26
23
|
status: wellKnownResponse.status,
|
|
27
24
|
statusText: wellKnownResponse.statusText
|
|
28
25
|
});
|
|
29
|
-
return
|
|
26
|
+
return;
|
|
30
27
|
}
|
|
31
28
|
const wellKnownRd = await wellKnownResponse.json();
|
|
32
|
-
const link = wellKnownRd?.links?.find((link
|
|
29
|
+
const link = wellKnownRd?.links?.find((link) => link != null && "rel" in link && (link.rel === "http://nodeinfo.diaspora.software/ns/schema/2.0" || link.rel === "http://nodeinfo.diaspora.software/ns/schema/2.1") && "href" in link && link.href != null);
|
|
33
30
|
if (link == null || link.href == null) {
|
|
34
31
|
logger.error("Failed to find a NodeInfo document link from {url}: {resourceDescriptor}", {
|
|
35
32
|
url: wellKnownUrl.href,
|
|
36
33
|
resourceDescriptor: wellKnownRd
|
|
37
34
|
});
|
|
38
|
-
return
|
|
35
|
+
return;
|
|
39
36
|
}
|
|
40
37
|
nodeInfoUrl = link.href;
|
|
41
38
|
}
|
|
@@ -49,7 +46,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
49
46
|
status: response.status,
|
|
50
47
|
statusText: response.statusText
|
|
51
48
|
});
|
|
52
|
-
return
|
|
49
|
+
return;
|
|
53
50
|
}
|
|
54
51
|
const data = await response.json();
|
|
55
52
|
if (options.parse === "none") return data;
|
|
@@ -59,7 +56,7 @@ async function getNodeInfo(url, options = {}) {
|
|
|
59
56
|
url: url.toString(),
|
|
60
57
|
error
|
|
61
58
|
});
|
|
62
|
-
return
|
|
59
|
+
return;
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
/**
|
|
@@ -254,7 +251,6 @@ function parseUsage(data, options = {}) {
|
|
|
254
251
|
localComments
|
|
255
252
|
};
|
|
256
253
|
}
|
|
257
|
-
|
|
258
254
|
//#endregion
|
|
259
255
|
//#region src/nodeinfo/types.ts
|
|
260
256
|
/**
|
|
@@ -297,6 +293,5 @@ function nodeInfoToJson(nodeInfo) {
|
|
|
297
293
|
metadata: nodeInfo.metadata ?? {}
|
|
298
294
|
};
|
|
299
295
|
}
|
|
300
|
-
|
|
301
296
|
//#endregion
|
|
302
|
-
export { getNodeInfo
|
|
297
|
+
export { getNodeInfo as n, parseNodeInfo as r, nodeInfoToJson as t };
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../accept-D7sAxyNa.js";
|
|
12
|
-
import "../key-CypuWa94.js";
|
|
13
|
-
import { verifyRequest } from "../http-DFzT4YFG.js";
|
|
14
|
-
import { getAuthenticatedDocumentLoader } from "../docloader-Ck0SCLXX.js";
|
|
15
|
-
import "../std__assert-X-_kMxKM.js";
|
|
16
|
-
import { assertRejects } from "../assert_rejects-0h7I2Esa.js";
|
|
17
|
-
import "../assert_throws-rjdMBf31.js";
|
|
18
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
19
|
-
import { rsaPrivateKey2 } from "../keys-BFve7QQv.js";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
|
+
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
|
+
import "../std__assert-Duiq_YC9.mjs";
|
|
7
|
+
import { t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
8
|
+
import { l as verifyRequest } from "../http-B53alCGi.mjs";
|
|
9
|
+
import { i as rsaPrivateKey2 } from "../keys-BAK-tUlf.mjs";
|
|
10
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-B9CXCw8i.mjs";
|
|
20
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
21
12
|
import { UrlError } from "@fedify/vocab-runtime";
|
|
22
|
-
|
|
23
13
|
//#region src/utils/docloader.test.ts
|
|
24
14
|
test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
25
15
|
esm_default.spyGlobal();
|
|
@@ -32,11 +22,10 @@ test("getAuthenticatedDocumentLoader()", async (t) => {
|
|
|
32
22
|
return new Response(JSON.stringify(v != null), { headers: { "Content-Type": "application/json" } });
|
|
33
23
|
});
|
|
34
24
|
await t.step("test", async () => {
|
|
35
|
-
|
|
25
|
+
assertEquals(await (await getAuthenticatedDocumentLoader({
|
|
36
26
|
keyId: new URL("https://example.com/key2"),
|
|
37
27
|
privateKey: rsaPrivateKey2
|
|
38
|
-
})
|
|
39
|
-
assertEquals(await loader("https://example.com/object"), {
|
|
28
|
+
}))("https://example.com/object"), {
|
|
40
29
|
contextUrl: null,
|
|
41
30
|
documentUrl: "https://example.com/object",
|
|
42
31
|
document: true
|
|
@@ -98,5 +87,5 @@ test("getAuthenticatedDocumentLoader() cancellation", {
|
|
|
98
87
|
});
|
|
99
88
|
esm_default.hardReset();
|
|
100
89
|
});
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
//#endregion
|
|
91
|
+
export {};
|