@fedify/fedify 2.3.0-dev.1013 → 2.3.0-dev.1034
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/{builder-CROLcFVM.mjs → builder-y06Dq5bp.mjs} +14 -4
- package/dist/chunk-QSgtlS85.mjs +29 -0
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/outgoing-jsonld.test.mjs +1 -1
- package/dist/compat/public-audience.test.mjs +1 -1
- package/dist/compat/transformers.test.mjs +2 -2
- package/dist/{context-Dk_tacqz.mjs → context-7Azky82W.mjs} +3 -2
- package/dist/{context-BDl7Y6f-.d.cts → context-BKLGj9QO.d.cts} +24 -1
- package/dist/{context-zTZAI3KP.d.ts → context-DrNqYkPw.d.ts} +24 -1
- package/dist/{deno-Ctd-K-t6.mjs → deno-DB1H1VHx.mjs} +1 -1
- package/dist/{docloader-q9QT51g3.mjs → docloader-3HwiWeYL.mjs} +2 -2
- package/dist/{esm-DVILvP5e.mjs → esm-DhnRLoG9.mjs} +1 -24
- package/dist/execAsync-eck5rbtb.mjs +13 -0
- package/dist/federation/builder.test.mjs +8 -3
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/handler.test.mjs +48 -11
- package/dist/federation/idempotency.test.mjs +4 -4
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +2 -2
- package/dist/federation/kv.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +138 -15
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +1 -1
- package/dist/federation/negotiation.test.mjs +1 -1
- package/dist/federation/retry.test.mjs +1 -1
- package/dist/federation/send.test.mjs +4540 -11
- package/dist/federation/webfinger.test.mjs +3 -3
- package/dist/getMachineId-bsd-DqZ4QRFp.mjs +29 -0
- package/dist/getMachineId-darwin-DMbbW3m7.mjs +26 -0
- package/dist/getMachineId-linux-lyeD2ug3.mjs +22 -0
- package/dist/getMachineId-unsupported-JuKr57jY.mjs +17 -0
- package/dist/getMachineId-win-Dxyf5pJq.mjs +28 -0
- package/dist/{http-1NL30qCe.js → http-BUr93aO6.js} +1 -1
- package/dist/{http-CX_zHeOD.mjs → http-D9zG-L9N.mjs} +3 -3
- package/dist/{http-Du1Jgf2P.cjs → http-FnUTcdMf.cjs} +1 -1
- package/dist/{key-C1Oto4it.mjs → key-CV57mOYH.mjs} +1 -1
- package/dist/{kv-cache-aGOwL6Vj.cjs → kv-cache-BG9O8wVV.cjs} +1 -1
- package/dist/{kv-cache-CsC3P4uu.js → kv-cache-C3esyJFP.js} +1 -1
- package/dist/{ld-Dl1HIB1a.mjs → ld-sUf94RJ8.mjs} +2 -2
- package/dist/{middleware-BiFLcrEX.cjs → middleware-CKkBrsOD.cjs} +203 -32
- package/dist/{middleware-C1cf3_6V.mjs → middleware-cMxbPxDe.mjs} +1 -1
- package/dist/{middleware-CKJC8DRf.js → middleware-fAuUxD9-.js} +203 -32
- package/dist/{middleware-BwC5U8zJ.cjs → middleware-ohzkLsW4.cjs} +1 -1
- package/dist/{middleware-CEWDB8EB.mjs → middleware-pb2EqN_r.mjs} +75 -27
- package/dist/{mod-ckCOmoCz.d.ts → mod-B8Z8mBLk.d.ts} +1 -1
- package/dist/{mod-BghZgD_U.d.cts → mod-DClCOv0M.d.cts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +2 -2
- package/dist/mod.d.ts +2 -2
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/client.test.mjs +2 -2
- package/dist/nodeinfo/handler.test.mjs +3 -3
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/otel/exporter.test.mjs +25 -22
- package/dist/otel/mod.cjs +6 -5
- package/dist/otel/mod.d.cts +3 -2
- package/dist/otel/mod.d.ts +3 -2
- package/dist/otel/mod.js +6 -5
- package/dist/{outgoing-jsonld-CNmZLixq.mjs → outgoing-jsonld-Bi7n-dEy.mjs} +1 -1
- package/dist/{owner-CEWFJlqo.mjs → owner-DsPgl527.mjs} +2 -2
- package/dist/{proof-CDA3f-i5.cjs → proof-BhJpq_J9.cjs} +1 -1
- package/dist/{proof-BFyPVl1r.mjs → proof-iVfYyJpY.mjs} +4 -4
- package/dist/{proof-Dedf8md5.js → proof-k4mEvvdS.js} +1 -1
- package/dist/send-D-vYdfC6.mjs +306 -0
- package/dist/sig/accept.test.mjs +1 -1
- package/dist/sig/http.test.mjs +4 -4
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +2 -2
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/testing/mod.d.mts +18 -1
- package/dist/testing/mod.mjs +1 -1
- package/dist/utils/docloader.test.mjs +4 -4
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -6
- package/dist/send-BJickEP4.mjs +0 -193
- /package/dist/{accept-CPkZzmGN.mjs → accept-CceiKpCy.mjs} +0 -0
- /package/dist/{activity-listener-ell7W1s9.mjs → activity-listener-tztVvlNb.mjs} +0 -0
- /package/dist/{client-D_1QpnWt.mjs → client-CIiz1WX7.mjs} +0 -0
- /package/dist/{collection-D-HqUuA2.mjs → collection-CA3V5zyK.mjs} +0 -0
- /package/dist/{keycache-EGATflN-.mjs → keycache-BeU0LCII.mjs} +0 -0
- /package/dist/{keys-DGu1NFwu.mjs → keys-C3kae-6B.mjs} +0 -0
- /package/dist/{kv-cache-U__xU4qR.mjs → kv-cache-Bmv7tUzz.mjs} +0 -0
- /package/dist/{kv-rV3vodCc.mjs → kv-x2IvBUyq.mjs} +0 -0
- /package/dist/{negotiation-SQvQgUqe.mjs → negotiation-VnHNB0Q5.mjs} +0 -0
- /package/dist/{public-audience-DYFHzm_c.mjs → public-audience-PVTwU_Ex.mjs} +0 -0
- /package/dist/{retry-bMXBL97A.mjs → retry-_VvV0h9f.mjs} +0 -0
- /package/dist/{types-J53Kw7so.mjs → types-BFowWFTT.mjs} +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { t as esm_default } from "../esm-DVILvP5e.mjs";
|
|
5
4
|
import { n as RouterError } from "../router-CrMLXoOr.mjs";
|
|
6
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
7
|
-
import "../std__assert-CRDpx_HF.mjs";
|
|
6
|
+
import { i as assertExists } from "../std__assert-CRDpx_HF.mjs";
|
|
8
7
|
import { n as assertFalse, t as assertRejects } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
9
8
|
import { t as assertInstanceOf } from "../assert_instance_of-C4Ri6VuN.mjs";
|
|
10
9
|
import { t as assertThrows } from "../assert_throws-4NwKEy2q.mjs";
|
|
11
10
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
12
11
|
import { t as assertStrictEquals } from "../assert_strict_equals-Dmjbg-bA.mjs";
|
|
13
12
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
13
|
+
import { t as esm_default } from "../esm-DhnRLoG9.mjs";
|
|
14
|
+
import { l as verifyRequest, s as signRequest } from "../http-D9zG-L9N.mjs";
|
|
15
|
+
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-C3kae-6B.mjs";
|
|
16
|
+
import { t as getAuthenticatedDocumentLoader } from "../docloader-3HwiWeYL.mjs";
|
|
17
|
+
import { a as signJsonLd, o as verifyJsonLd, r as detachSignature } from "../ld-sUf94RJ8.mjs";
|
|
18
|
+
import { t as doesActorOwnKey } from "../owner-DsPgl527.mjs";
|
|
19
|
+
import { i as verifyObject, r as signObject } from "../proof-iVfYyJpY.mjs";
|
|
20
|
+
import { t as MemoryKvStore } from "../kv-x2IvBUyq.mjs";
|
|
21
|
+
import { i as KvSpecDeterminer, n as FederationImpl, o as createFederation, r as InboxContextImpl, t as ContextImpl } from "../middleware-pb2EqN_r.mjs";
|
|
22
|
+
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
23
23
|
import * as vocab from "@fedify/vocab";
|
|
24
24
|
import { getTypeId, lookupObject } from "@fedify/vocab";
|
|
25
25
|
import { FetchError, getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -270,7 +270,8 @@ test({
|
|
|
270
270
|
}));
|
|
271
271
|
ctx = federation.createContext(new URL("https://example.com/"), 123);
|
|
272
272
|
assertEquals(ctx.getNodeInfoUri(), new URL("https://example.com/nodeinfo/2.1"));
|
|
273
|
-
|
|
273
|
+
assertThrows(() => createFederation({ kv: new MemoryKvStore() }).setActorDispatcher("/users/{identifier}", () => null).mapActorAlias("/actor/{id}", "instance"), RouterError, "Path for actor alias must have no variables.");
|
|
274
|
+
federation.setActorDispatcher("/users/{identifier}", () => new vocab.Person({})).mapActorAlias("/bot", "bot").setKeyPairsDispatcher(() => [{
|
|
274
275
|
privateKey: rsaPrivateKey2,
|
|
275
276
|
publicKey: rsaPublicKey2.publicKey
|
|
276
277
|
}, {
|
|
@@ -279,11 +280,16 @@ test({
|
|
|
279
280
|
}]).mapHandle((_, username) => username === "HANDLE" ? "handle" : null);
|
|
280
281
|
ctx = federation.createContext(new URL("https://example.com/"), 123);
|
|
281
282
|
assertEquals(ctx.getActorUri("handle"), new URL("https://example.com/users/handle"));
|
|
283
|
+
assertEquals(ctx.getActorUri("bot"), new URL("https://example.com/bot"));
|
|
282
284
|
assertEquals(ctx.parseUri(new URL("https://example.com/")), null);
|
|
283
285
|
assertEquals(ctx.parseUri(new URL("https://example.com/users/handle")), {
|
|
284
286
|
type: "actor",
|
|
285
287
|
identifier: "handle"
|
|
286
288
|
});
|
|
289
|
+
assertEquals(ctx.parseUri(new URL("https://example.com/bot")), {
|
|
290
|
+
type: "actor",
|
|
291
|
+
identifier: "bot"
|
|
292
|
+
});
|
|
287
293
|
assertEquals(ctx.parseUri(null), null);
|
|
288
294
|
assertEquals(await ctx.getActorKeyPairs("handle"), [{
|
|
289
295
|
keyId: new URL("https://example.com/users/handle#main-key"),
|
|
@@ -775,7 +781,7 @@ test("Federation.fetch()", async (t) => {
|
|
|
775
781
|
inbox: ctx.getInboxUri(identifier),
|
|
776
782
|
preferredUsername: identifier
|
|
777
783
|
});
|
|
778
|
-
}).setKeyPairsDispatcher(() => {
|
|
784
|
+
}).mapActorAlias("/bot", "bot").setKeyPairsDispatcher(() => {
|
|
779
785
|
return [{
|
|
780
786
|
privateKey: rsaPrivateKey2,
|
|
781
787
|
publicKey: rsaPublicKey2.publicKey
|
|
@@ -799,6 +805,32 @@ test("Federation.fetch()", async (t) => {
|
|
|
799
805
|
assertEquals(dispatches, []);
|
|
800
806
|
assertEquals(response.status, 406);
|
|
801
807
|
});
|
|
808
|
+
await t.step("GET actor alias", async () => {
|
|
809
|
+
const { federation, dispatches } = createTestContext();
|
|
810
|
+
const response = await federation.fetch(new Request("https://example.com/bot", {
|
|
811
|
+
method: "GET",
|
|
812
|
+
headers: { "Accept": "application/activity+json" }
|
|
813
|
+
}), { contextData: void 0 });
|
|
814
|
+
assertEquals(dispatches, ["bot"]);
|
|
815
|
+
assertEquals(response.status, 200);
|
|
816
|
+
const body = await response.json();
|
|
817
|
+
assertEquals(body.id, "https://example.com/bot");
|
|
818
|
+
assertEquals(body.preferredUsername, "bot");
|
|
819
|
+
});
|
|
820
|
+
await t.step("WebFinger for actor alias", async () => {
|
|
821
|
+
const { federation } = createTestContext();
|
|
822
|
+
const response = await federation.fetch(new Request("https://example.com/.well-known/webfinger?resource=acct:bot@example.com"), { contextData: void 0 });
|
|
823
|
+
assertEquals(response.status, 200);
|
|
824
|
+
const body = await response.json();
|
|
825
|
+
assertEquals(body.subject, "acct:bot@example.com");
|
|
826
|
+
assertExists(body.links);
|
|
827
|
+
assert(Array.isArray(body.links));
|
|
828
|
+
const selfLink = body.links.find((l) => l.rel === "self");
|
|
829
|
+
assertExists(selfLink);
|
|
830
|
+
assertEquals(selfLink.href, "https://example.com/bot");
|
|
831
|
+
assertExists(body.aliases);
|
|
832
|
+
assert(body.aliases.includes("https://example.com/bot"));
|
|
833
|
+
});
|
|
802
834
|
await t.step("POST with application/json", async () => {
|
|
803
835
|
const { federation, inbox } = createTestContext();
|
|
804
836
|
const request = await signRequest(new Request("https://example.com/users/json/inbox", {
|
|
@@ -2054,6 +2086,49 @@ test("FederationImpl.processQueuedTask()", async (t) => {
|
|
|
2054
2086
|
attempt: 1
|
|
2055
2087
|
}]);
|
|
2056
2088
|
});
|
|
2089
|
+
await t.step("records queued inbox processing duration", async () => {
|
|
2090
|
+
const kv = new MemoryKvStore();
|
|
2091
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
2092
|
+
const federation = new FederationImpl({
|
|
2093
|
+
kv,
|
|
2094
|
+
meterProvider,
|
|
2095
|
+
queue: {
|
|
2096
|
+
enqueue(_message, _options) {
|
|
2097
|
+
return Promise.resolve();
|
|
2098
|
+
},
|
|
2099
|
+
listen(_handler, _options) {
|
|
2100
|
+
return Promise.resolve();
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
});
|
|
2104
|
+
let handled = false;
|
|
2105
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").on(vocab.Create, () => {
|
|
2106
|
+
handled = true;
|
|
2107
|
+
});
|
|
2108
|
+
await federation.processQueuedTask(void 0, {
|
|
2109
|
+
type: "inbox",
|
|
2110
|
+
id: crypto.randomUUID(),
|
|
2111
|
+
baseUrl: "https://example.com",
|
|
2112
|
+
activity: {
|
|
2113
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
2114
|
+
type: "Create",
|
|
2115
|
+
id: "https://remote.example/activities/1",
|
|
2116
|
+
actor: "https://remote.example/users/alice",
|
|
2117
|
+
object: {
|
|
2118
|
+
type: "Note",
|
|
2119
|
+
content: "Hello world"
|
|
2120
|
+
}
|
|
2121
|
+
},
|
|
2122
|
+
started: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2123
|
+
attempt: 0,
|
|
2124
|
+
identifier: null,
|
|
2125
|
+
traceContext: {}
|
|
2126
|
+
});
|
|
2127
|
+
assert(handled);
|
|
2128
|
+
const durations = recorder.getMeasurements("activitypub.inbox.processing_duration");
|
|
2129
|
+
assertEquals(durations.length, 1);
|
|
2130
|
+
assertEquals(durations[0].attributes["activitypub.activity.type"], "https://www.w3.org/ns/activitystreams#Create");
|
|
2131
|
+
});
|
|
2057
2132
|
});
|
|
2058
2133
|
test("FederationImpl.processQueuedTask() permanent failure", async (t) => {
|
|
2059
2134
|
esm_default.spyGlobal();
|
|
@@ -2088,7 +2163,9 @@ test("FederationImpl.processQueuedTask() permanent failure", async (t) => {
|
|
|
2088
2163
|
return Promise.resolve();
|
|
2089
2164
|
}
|
|
2090
2165
|
},
|
|
2091
|
-
...options.permanentFailureStatusCodes ? { permanentFailureStatusCodes: options.permanentFailureStatusCodes } : {}
|
|
2166
|
+
...options.permanentFailureStatusCodes ? { permanentFailureStatusCodes: options.permanentFailureStatusCodes } : {},
|
|
2167
|
+
...options.meterProvider ? { meterProvider: options.meterProvider } : {},
|
|
2168
|
+
...options.tracerProvider ? { tracerProvider: options.tracerProvider } : {}
|
|
2092
2169
|
});
|
|
2093
2170
|
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox");
|
|
2094
2171
|
return {
|
|
@@ -2123,7 +2200,12 @@ test("FederationImpl.processQueuedTask() permanent failure", async (t) => {
|
|
|
2123
2200
|
};
|
|
2124
2201
|
}
|
|
2125
2202
|
await t.step("410 Gone triggers permanent failure handler", async () => {
|
|
2126
|
-
const
|
|
2203
|
+
const [meterProvider, recorder] = createTestMeterProvider();
|
|
2204
|
+
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
2205
|
+
const { federation, queuedMessages } = setup({
|
|
2206
|
+
meterProvider,
|
|
2207
|
+
tracerProvider
|
|
2208
|
+
});
|
|
2127
2209
|
let handlerCalled = false;
|
|
2128
2210
|
let handlerValues = {};
|
|
2129
2211
|
federation.setOutboxPermanentFailureHandler((_ctx, values) => {
|
|
@@ -2137,6 +2219,17 @@ test("FederationImpl.processQueuedTask() permanent failure", async (t) => {
|
|
|
2137
2219
|
assertInstanceOf(handlerValues.activity, vocab.Create);
|
|
2138
2220
|
assertEquals(handlerValues.actorIds, [new URL("https://gone.example/users/bob"), new URL("https://gone.example/users/charlie")]);
|
|
2139
2221
|
assertEquals(queuedMessages, []);
|
|
2222
|
+
const failures = recorder.getMeasurements("activitypub.delivery.permanent_failure");
|
|
2223
|
+
assertEquals(failures.length, 1);
|
|
2224
|
+
assertEquals(failures[0].value, 1);
|
|
2225
|
+
assertEquals(failures[0].attributes["activitypub.remote.host"], "gone.example");
|
|
2226
|
+
assertEquals(failures[0].attributes["http.response.status_code"], 410);
|
|
2227
|
+
const events = exporter.getEvents("activitypub.outbox", "activitypub.delivery.failed");
|
|
2228
|
+
assertEquals(events.length, 1);
|
|
2229
|
+
assertEquals(events[0].attributes?.["activitypub.remote.host"], "gone.example");
|
|
2230
|
+
assertEquals(events[0].attributes?.["activitypub.delivery.attempt"], 0);
|
|
2231
|
+
assertEquals(events[0].attributes?.["activitypub.delivery.permanent_failure"], true);
|
|
2232
|
+
assertEquals(events[0].attributes?.["http.response.status_code"], 410);
|
|
2140
2233
|
});
|
|
2141
2234
|
await t.step("404 Not Found triggers permanent failure handler", async () => {
|
|
2142
2235
|
const { federation, queuedMessages } = setup();
|
|
@@ -2212,6 +2305,36 @@ test("FederationImpl.processQueuedTask() permanent failure", async (t) => {
|
|
|
2212
2305
|
assertEquals(handlerActorIds, []);
|
|
2213
2306
|
assertEquals(queuedMessages, []);
|
|
2214
2307
|
});
|
|
2308
|
+
await t.step("malformed inbox does not break failure handling", async () => {
|
|
2309
|
+
await withLogtapeLock(async () => {
|
|
2310
|
+
const [tracerProvider, exporter] = createTestTracerProvider();
|
|
2311
|
+
const { federation, queuedMessages } = setup({ tracerProvider });
|
|
2312
|
+
const records = [];
|
|
2313
|
+
await reset();
|
|
2314
|
+
try {
|
|
2315
|
+
await configure({
|
|
2316
|
+
sinks: { buffer(record) {
|
|
2317
|
+
records.push(record);
|
|
2318
|
+
} },
|
|
2319
|
+
filters: {},
|
|
2320
|
+
loggers: [{
|
|
2321
|
+
category: [],
|
|
2322
|
+
sinks: ["buffer"]
|
|
2323
|
+
}]
|
|
2324
|
+
});
|
|
2325
|
+
await federation.processQueuedTask(void 0, createOutboxMessage("not a url", "https://example.com/activity/9", ["https://gone.example/users/bob"]));
|
|
2326
|
+
assertEquals(queuedMessages.length, 1);
|
|
2327
|
+
assertEquals(queuedMessages[0].attempt, 1);
|
|
2328
|
+
const events = exporter.getEvents("activitypub.outbox", "activitypub.delivery.failed");
|
|
2329
|
+
assertEquals(events.length, 1);
|
|
2330
|
+
assertEquals(events[0].attributes?.["activitypub.remote.host"], void 0);
|
|
2331
|
+
assertEquals(events[0].attributes?.["activitypub.delivery.attempt"], 0);
|
|
2332
|
+
assertEquals(records.some((record) => record.rawMessage === "Invalid inbox URL in queued outbox message: {inbox}" && record.properties.inbox === "not a url"), true);
|
|
2333
|
+
} finally {
|
|
2334
|
+
await reset();
|
|
2335
|
+
}
|
|
2336
|
+
});
|
|
2337
|
+
});
|
|
2215
2338
|
esm_default.hardReset();
|
|
2216
2339
|
});
|
|
2217
2340
|
test("ContextImpl.lookupObject()", async (t) => {
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -2,7 +2,7 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
require("../chunk-DDcVe30Y.cjs");
|
|
5
|
-
const require_middleware = require("../middleware-
|
|
5
|
+
const require_middleware = require("../middleware-CKkBrsOD.cjs");
|
|
6
6
|
let es_toolkit = require("es-toolkit");
|
|
7
7
|
//#region src/federation/kv.ts
|
|
8
8
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, 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-
|
|
1
|
+
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, 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-BKLGj9QO.cjs";
|
|
2
2
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-CbLNp3zQ.cjs";
|
|
3
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
3
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-DClCOv0M.cjs";
|
|
4
4
|
export { 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, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
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, 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-
|
|
3
|
+
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, 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-DrNqYkPw.js";
|
|
4
4
|
import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "../kv-GFYnFoOl.js";
|
|
5
|
-
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-
|
|
5
|
+
import { n as handleWebFinger, t as WebFingerHandlerParameters } from "../mod-B8Z8mBLk.js";
|
|
6
6
|
export { 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, GetActorOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueDepth, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxContext, OutboxErrorHandler, OutboxListener, OutboxListenerErrorHandler, OutboxListenerSetters, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
|
-
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-
|
|
3
|
+
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-fAuUxD9-.js";
|
|
4
4
|
import { isEqual } from "es-toolkit";
|
|
5
5
|
//#region src/federation/kv.ts
|
|
6
6
|
/**
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import "../std__assert-CRDpx_HF.mjs";
|
|
5
5
|
import { n as assertFalse } from "../assert_rejects-B-qJtC9Z.mjs";
|
|
6
6
|
import { t as assert } from "../assert-DikXweDx.mjs";
|
|
7
|
-
import { t as acceptsJsonLd } from "../negotiation-
|
|
7
|
+
import { t as acceptsJsonLd } from "../negotiation-VnHNB0Q5.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/federation/negotiation.test.ts
|
|
10
10
|
test("acceptsJsonLd()", () => {
|
|
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { l as AssertionError, t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import { t as assertNotEquals } from "../assert_not_equals--wG9hV7u.mjs";
|
|
6
|
-
import { t as createExponentialBackoffPolicy } from "../retry-
|
|
6
|
+
import { t as createExponentialBackoffPolicy } from "../retry-_VvV0h9f.mjs";
|
|
7
7
|
import { test } from "@fedify/fixture";
|
|
8
8
|
//#region src/federation/retry.test.ts
|
|
9
9
|
test("createExponentialBackoffPolicy()", () => {
|