@fedify/fedify 2.0.0-pr.410.1558 → 2.0.0-pr.412.1692
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/actor-CrTGiTZd.cjs +42609 -0
- package/dist/{actor-CkjTCNqi.js → actor-D5S46edz.js} +1 -1
- package/dist/actor-D6K058Tb.d.cts +128 -0
- package/dist/{actor-DmsbGzXS.js → actor-G2S5sPEA.js} +6951 -2127
- package/dist/{actor-C22bXuuC.d.ts → actor-T6RyhRgk.d.ts} +1 -1
- package/dist/{authdocloader-BwV2NPfz.js → authdocloader-C5AvdCCi.js} +6 -6
- package/dist/authdocloader-CQMPmpaO.cjs +58 -0
- package/dist/{authdocloader-BJxkviIL.js → authdocloader-SjwloJUA.js} +3 -3
- package/dist/{builder-DbOVAz8i.js → builder-OA47XRft.js} +10 -4
- package/dist/chunk-DqRYRqnO.cjs +34 -0
- package/dist/{client-DrNZd6r_.js → client-Bmd-i8x8.js} +3 -22
- package/dist/client-CegPX0Rn.d.cts +222 -0
- package/dist/{client-DF8anIB5.d.ts → client-bgSdkFa2.d.ts} +2 -74
- package/dist/compat/mod.cjs +10 -0
- package/dist/compat/mod.d.cts +13 -0
- package/dist/compat/mod.d.ts +8 -8
- package/dist/compat/mod.js +5 -5
- package/dist/compat/transformers.test.js +19 -19
- package/dist/compat-DmDDELst.cjs +4 -0
- package/dist/compat-nxUqe4Z-.js +4 -0
- package/dist/{context-9gCpIkiz.d.ts → context-ByZprN0S.d.ts} +67 -7
- package/dist/context-C5BsZkDr.d.cts +2315 -0
- package/dist/docloader-7Ey7wNHx.cjs +4861 -0
- package/dist/{docloader-DnepZfu_.js → docloader-CkweNhUH.js} +189 -9
- package/dist/docloader-D-MrRyHl.d.cts +219 -0
- package/dist/{esm-D1HqBE3n.js → esm-CwHz8Y8t.js} +1 -1
- package/dist/federation/builder.test.js +6 -7
- package/dist/federation/collection.test.js +4 -4
- package/dist/federation/handler.test.js +23 -143
- package/dist/federation/idempotency.test.js +202 -0
- package/dist/federation/inbox.test.js +4 -4
- package/dist/federation/keycache.test.js +4 -4
- package/dist/federation/kv.test.js +4 -3
- package/dist/federation/middleware.test.js +231 -52
- package/dist/federation/mod.cjs +29 -0
- package/dist/federation/mod.d.cts +13 -0
- package/dist/federation/mod.d.ts +8 -8
- package/dist/federation/mod.js +15 -15
- package/dist/federation/mq.test.js +3 -3
- package/dist/federation/negotiation.test.d.ts +3 -0
- package/dist/federation/negotiation.test.js +28 -0
- package/dist/federation/retry.test.js +3 -3
- package/dist/federation/router.test.js +3 -3
- package/dist/federation/send.test.js +10 -10
- package/dist/{federation-CMX7WzeL.js → federation-D1U8YY9t.js} +3 -3
- package/dist/federation-H2_En3j5.cjs +244 -0
- package/dist/fixtures/media.example.com/avatars/test-avatar.jpg.json +6 -0
- package/dist/http-BiBofurJ.cjs +826 -0
- package/dist/{http-BEJUSX6j.js → http-C5tC93Hn.js} +7 -7
- package/dist/http-D-e6AFwR.d.cts +253 -0
- package/dist/{http-DqSNLFNY.d.ts → http-D6Uj2x2y.d.ts} +1 -1
- package/dist/{http-BgCF3jDs.js → http-DGjdMiLc.js} +3 -3
- package/dist/{inbox-Bq4EChoK.js → inbox-BoDY3z8G.js} +24 -7
- package/dist/key-CZR7QraT.cjs +290 -0
- package/dist/key-Cf8MffVe.cjs +10 -0
- package/dist/{key-D-0OLe9C.js → key-CkxrAIyp.js} +5 -5
- package/dist/key-Dk0j88Jo.js +10 -0
- package/dist/{key-BD3lpBWw.js → key-Epcl5jpz.js} +3 -3
- package/dist/{key-BYNqWXyu.js → key-IxRhZpOF.js} +2 -2
- package/dist/{keycache-yZDAc3-e.js → keycache-TEniXNel.js} +1 -1
- package/dist/{keys-Dtc-g6xq.js → keys-bZxcrZ9Z.js} +1 -1
- package/dist/kv-63Cil1MD.d.cts +81 -0
- package/dist/{ld-BJ484qSg.js → ld-DW7A0uIc.js} +4 -4
- package/dist/{lookup-Cj0sX50U.js → lookup-DhQCVVja.js} +21 -12
- package/dist/lookup-DiV4LFBg.cjs +137 -0
- package/dist/{lookup-BzogF2gp.js → lookup-cVRa2QM-.js} +4 -4
- package/dist/middleware-Be1JStOx.js +17 -0
- package/dist/middleware-CDOK7WOb.js +26 -0
- package/dist/{middleware-CiH0ptqy.js → middleware-Cgr3PtaJ.js} +58 -149
- package/dist/{middleware-DIZ1dnwT.js → middleware-DvvYAIsd.js} +87 -91
- package/dist/middleware-EjIW2mZB.cjs +17 -0
- package/dist/middleware-TfuVoceY.cjs +4231 -0
- package/dist/mod-8DMWKtQE.d.cts +80 -0
- package/dist/{mod-Drmz72EK.d.ts → mod-BhUKmBJD.d.ts} +2 -2
- package/dist/mod-C2tOeRkN.d.cts +1 -0
- package/dist/{mod-TFoH2Ql8.d.ts → mod-CerN_Sza.d.ts} +1 -1
- package/dist/mod-Cj1tHXBR.d.cts +102 -0
- package/dist/mod-CxkWO3Mg.d.cts +307 -0
- package/dist/{mod-Bqxcp7eN.d.ts → mod-D6hQoxC5.d.ts} +2 -2
- package/dist/mod-Djzcw2ry.d.cts +266 -0
- package/dist/{mod-Cxt4Kpf6.d.ts → mod-DlU8ISoa.d.ts} +19 -1
- package/dist/mod-FZd39qVq.d.cts +1 -0
- package/dist/mod-jQ4OODsl.d.cts +113 -0
- package/dist/mod.cjs +150 -0
- package/dist/mod.d.cts +17 -0
- package/dist/mod.d.ts +11 -11
- package/dist/mod.js +21 -21
- package/dist/mq-B7R1Q-M5.d.cts +140 -0
- package/dist/negotiation-5NPJL6zp.js +71 -0
- package/dist/nodeinfo/client.test.js +27 -106
- package/dist/nodeinfo/handler.test.js +20 -20
- package/dist/nodeinfo/mod.cjs +11 -0
- package/dist/nodeinfo/mod.d.cts +5 -0
- package/dist/nodeinfo/mod.d.ts +2 -2
- package/dist/nodeinfo/mod.js +7 -7
- package/dist/nodeinfo/types.test.js +5 -10
- package/dist/nodeinfo-Co9lJrWl.cjs +4 -0
- package/dist/nodeinfo-DfycQ8Wf.js +4 -0
- package/dist/{owner-9FMX4wQT.js → owner-6Vc3UXXE.js} +2 -2
- package/dist/owner-BN_tO3cY.d.cts +67 -0
- package/dist/{owner-CQPnQVtf.d.ts → owner-hd9lvQcP.d.ts} +2 -2
- package/dist/{proof-Arx4Q9Q6.js → proof-C1jhbeNv.js} +3 -3
- package/dist/proof-CRJWXFfT.cjs +673 -0
- package/dist/{proof-DnTD0avk.js → proof-Chi90OXv.js} +9 -9
- package/dist/runtime/authdocloader.test.js +9 -9
- package/dist/runtime/docloader.test.js +4 -4
- package/dist/runtime/key.test.js +5 -5
- package/dist/runtime/langstr.test.js +3 -3
- package/dist/runtime/link.test.d.ts +3 -0
- package/dist/runtime/link.test.js +61 -0
- package/dist/runtime/mod.cjs +25 -0
- package/dist/runtime/mod.d.cts +6 -0
- package/dist/runtime/mod.d.ts +3 -3
- package/dist/runtime/mod.js +10 -10
- package/dist/runtime/multibase/multibase.test.js +3 -3
- package/dist/runtime/url.test.js +3 -3
- package/dist/runtime-C58AJWSv.cjs +4 -0
- package/dist/runtime-DPYEDf-o.js +4 -0
- package/dist/{send-CcxHe0p3.js → send-DjATl6i3.js} +2 -2
- package/dist/sig/http.test.js +9 -9
- package/dist/sig/key.test.js +6 -6
- package/dist/sig/ld.test.js +7 -7
- package/dist/sig/mod.cjs +30 -0
- package/dist/sig/mod.d.cts +8 -0
- package/dist/sig/mod.d.ts +5 -5
- package/dist/sig/mod.js +10 -10
- package/dist/sig/owner.test.js +7 -7
- package/dist/sig/proof.test.js +7 -7
- package/dist/sig-ByHXzqUi.cjs +4 -0
- package/dist/sig-Cj3tk-ig.js +4 -0
- package/dist/testing/docloader.test.js +3 -3
- package/dist/testing/mod.d.ts +273 -28
- package/dist/testing/mod.js +3 -3
- package/dist/{testing-DFgpNAI6.js → testing-BnfPB5T-.js} +2 -2
- package/dist/{transformers-Dna8Fg7k.js → transformers-BFT6d7J5.js} +3 -3
- package/dist/transformers-CoBS-oFG.cjs +116 -0
- package/dist/{type-B2h-NRAo.js → type-NEA09tSC.js} +7262 -2258
- package/dist/{types-BIgY6c-l.js → types-BSuWJsOm.js} +1 -3
- package/dist/types-CmmUQisS.cjs +315 -0
- package/dist/{types-B1QuBj5L.js → types-dLXLjVLf.js} +8 -169
- package/dist/vocab/actor.test.js +5 -5
- package/dist/vocab/lookup.test.js +255 -5
- package/dist/vocab/mod.cjs +87 -0
- package/dist/vocab/mod.d.cts +6 -0
- package/dist/vocab/mod.d.ts +3 -3
- package/dist/vocab/mod.js +7 -7
- package/dist/vocab/type.test.js +3 -3
- package/dist/vocab/vocab.test.js +433 -9
- package/dist/{vocab-SOE1ifCr.d.ts → vocab-BI0Ak5lL.d.ts} +290 -0
- package/dist/vocab-C5Y-0fGj.cjs +291 -0
- package/dist/vocab-Dw1-yVGg.d.cts +14922 -0
- package/dist/{vocab-BREfYr1a.js → vocab-rWbHpc2J.js} +26 -17
- package/dist/webfinger/handler.test.js +19 -19
- package/dist/webfinger/lookup.test.js +4 -4
- package/dist/webfinger/mod.cjs +9 -0
- package/dist/webfinger/mod.d.cts +4 -0
- package/dist/webfinger/mod.js +6 -6
- package/dist/webfinger-BjOEdFPs.cjs +4 -0
- package/dist/webfinger-De_bU0iE.js +4 -0
- package/dist/x/cfworkers.cjs +100 -0
- package/dist/x/cfworkers.d.cts +59 -0
- package/dist/x/cfworkers.js +3 -3
- package/dist/x/cfworkers.test.js +3 -3
- package/dist/x/hono.cjs +61 -0
- package/dist/x/hono.d.cts +54 -0
- package/dist/x/hono.d.ts +7 -7
- package/dist/x/hono.js +3 -3
- package/dist/x/sveltekit.cjs +69 -0
- package/dist/x/sveltekit.d.cts +46 -0
- package/dist/x/sveltekit.d.ts +7 -7
- package/dist/x/sveltekit.js +3 -3
- package/package.json +68 -13
- package/dist/compat-Bb5myD13.js +0 -4
- package/dist/key-BmFoI4_J.js +0 -10
- package/dist/middleware-D2W4gwdv.js +0 -17
- package/dist/middleware-LmK3pQ2z.js +0 -26
- package/dist/nodeinfo/semver.test.js +0 -143
- package/dist/nodeinfo-CyEbLjHs.js +0 -4
- package/dist/runtime-BSkOVUWM.js +0 -4
- package/dist/semver-dArNLkR9.js +0 -149
- package/dist/sig-BXJO--F9.js +0 -4
- package/dist/webfinger-C3GIyXIg.js +0 -4
- /package/dist/{collection-CSzG2j1P.js → collection-CcnIw1qY.js} +0 -0
- /package/dist/{nodeinfo/semver.test.d.ts → federation/idempotency.test.d.ts} +0 -0
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import { Create, Follow, Person } from "../type-NEA09tSC.js";
|
7
|
+
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
|
+
import "../assert-MZs1qjMx.js";
|
9
|
+
import "../assert_instance_of-DHz7EHNU.js";
|
10
|
+
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
11
|
+
import { createFederation } from "../middleware-Cgr3PtaJ.js";
|
12
|
+
import "../client-Bmd-i8x8.js";
|
13
|
+
import "../lookup-DhQCVVja.js";
|
14
|
+
import "../types-BSuWJsOm.js";
|
15
|
+
import "../actor-D5S46edz.js";
|
16
|
+
import "../key-IxRhZpOF.js";
|
17
|
+
import "../http-DGjdMiLc.js";
|
18
|
+
import "../authdocloader-SjwloJUA.js";
|
19
|
+
import "../ld-DW7A0uIc.js";
|
20
|
+
import "../owner-6Vc3UXXE.js";
|
21
|
+
import { signObject } from "../proof-C1jhbeNv.js";
|
22
|
+
import "../inbox-BoDY3z8G.js";
|
23
|
+
import "../builder-OA47XRft.js";
|
24
|
+
import "../collection-CcnIw1qY.js";
|
25
|
+
import "../keycache-TEniXNel.js";
|
26
|
+
import "../negotiation-5NPJL6zp.js";
|
27
|
+
import "../retry-D4GJ670a.js";
|
28
|
+
import "../send-DjATl6i3.js";
|
29
|
+
import { mockDocumentLoader, test } from "../testing-BnfPB5T-.js";
|
30
|
+
import "../std__assert-X-_kMxKM.js";
|
31
|
+
import "../assert_rejects-DiIiJbZn.js";
|
32
|
+
import "../assert_is_error-BPGph1Jx.js";
|
33
|
+
import "../assert_not_equals-f3m3epl3.js";
|
34
|
+
import "../assert_throws-BOO88avQ.js";
|
35
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey } from "../keys-bZxcrZ9Z.js";
|
36
|
+
|
37
|
+
//#region src/federation/idempotency.test.ts
|
38
|
+
const kv = new MemoryKvStore();
|
39
|
+
const federationOptions = {
|
40
|
+
kv,
|
41
|
+
documentLoaderFactory: () => mockDocumentLoader,
|
42
|
+
authenticatedDocumentLoaderFactory: () => mockDocumentLoader
|
43
|
+
};
|
44
|
+
function createTestFederation() {
|
45
|
+
const federation = createFederation(federationOptions);
|
46
|
+
federation.setActorDispatcher("/users/{identifier}", (_, identifier) => identifier === "john" ? new Person({}) : null).setKeyPairsDispatcher(() => [{
|
47
|
+
privateKey: ed25519PrivateKey,
|
48
|
+
publicKey: ed25519PublicKey.publicKey
|
49
|
+
}]);
|
50
|
+
return federation;
|
51
|
+
}
|
52
|
+
test("Federation.setInboxListeners().withIdempotency() - per-origin strategy", async () => {
|
53
|
+
const federation = createTestFederation();
|
54
|
+
const processedActivities = [];
|
55
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("per-origin").on(Create, (ctx, activity$1) => {
|
56
|
+
processedActivities.push([ctx.recipient, activity$1]);
|
57
|
+
});
|
58
|
+
const activity = new Create({
|
59
|
+
id: new URL("https://example.com/activities/1"),
|
60
|
+
actor: new URL("https://example.com/person2")
|
61
|
+
});
|
62
|
+
const signedActivity = await signObject(activity, ed25519PrivateKey, ed25519Multikey.id);
|
63
|
+
const body = JSON.stringify(await signedActivity.toJsonLd({ contextLoader: mockDocumentLoader }));
|
64
|
+
let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
65
|
+
method: "POST",
|
66
|
+
headers: { "Content-Type": "application/activity+json" },
|
67
|
+
body
|
68
|
+
}), { contextData: void 0 });
|
69
|
+
assertEquals(response.status, 202);
|
70
|
+
assertEquals(processedActivities.length, 1);
|
71
|
+
assertEquals(processedActivities[0][0], "john");
|
72
|
+
response = await federation.fetch(new Request("https://example.com/inbox", {
|
73
|
+
method: "POST",
|
74
|
+
headers: { "Content-Type": "application/activity+json" },
|
75
|
+
body
|
76
|
+
}), { contextData: void 0 });
|
77
|
+
assertEquals(response.status, 202);
|
78
|
+
assertEquals(processedActivities.length, 1);
|
79
|
+
await kv.delete([
|
80
|
+
"_fedify",
|
81
|
+
"activityIdempotence",
|
82
|
+
"https://example.com:https://example.com/activities/1"
|
83
|
+
]);
|
84
|
+
});
|
85
|
+
test("Federation.setInboxListeners().withIdempotency() - per-inbox strategy", async () => {
|
86
|
+
const federation = createTestFederation();
|
87
|
+
const processedActivities = [];
|
88
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("per-inbox").on(Create, (ctx, activity$1) => {
|
89
|
+
processedActivities.push([ctx.recipient, activity$1]);
|
90
|
+
});
|
91
|
+
const activity = new Create({
|
92
|
+
id: new URL("https://example.com/activities/2"),
|
93
|
+
actor: new URL("https://example.com/person2")
|
94
|
+
});
|
95
|
+
const signedActivity = await signObject(activity, ed25519PrivateKey, ed25519Multikey.id);
|
96
|
+
const body = JSON.stringify(await signedActivity.toJsonLd({ contextLoader: mockDocumentLoader }));
|
97
|
+
let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
98
|
+
method: "POST",
|
99
|
+
headers: { "Content-Type": "application/activity+json" },
|
100
|
+
body
|
101
|
+
}), { contextData: void 0 });
|
102
|
+
assertEquals(response.status, 202);
|
103
|
+
assertEquals(processedActivities.length, 1);
|
104
|
+
assertEquals(processedActivities[0][0], "john");
|
105
|
+
response = await federation.fetch(new Request("https://example.com/inbox", {
|
106
|
+
method: "POST",
|
107
|
+
headers: { "Content-Type": "application/activity+json" },
|
108
|
+
body
|
109
|
+
}), { contextData: void 0 });
|
110
|
+
assertEquals(response.status, 202);
|
111
|
+
assertEquals(processedActivities.length, 2);
|
112
|
+
assertEquals(processedActivities[1][0], null);
|
113
|
+
response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
114
|
+
method: "POST",
|
115
|
+
headers: { "Content-Type": "application/activity+json" },
|
116
|
+
body
|
117
|
+
}), { contextData: void 0 });
|
118
|
+
assertEquals(response.status, 202);
|
119
|
+
assertEquals(processedActivities.length, 2);
|
120
|
+
});
|
121
|
+
test("Federation.setInboxListeners().withIdempotency() - global strategy", async () => {
|
122
|
+
const federation = createTestFederation();
|
123
|
+
const processedActivities = [];
|
124
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency("global").on(Create, (ctx, activity$1) => {
|
125
|
+
processedActivities.push([ctx.recipient, activity$1]);
|
126
|
+
});
|
127
|
+
const activity = new Create({
|
128
|
+
id: new URL("https://example.com/activities/3"),
|
129
|
+
actor: new URL("https://example.com/person2")
|
130
|
+
});
|
131
|
+
const signedActivity = await signObject(activity, ed25519PrivateKey, ed25519Multikey.id);
|
132
|
+
const body = JSON.stringify(await signedActivity.toJsonLd({ contextLoader: mockDocumentLoader }));
|
133
|
+
let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
134
|
+
method: "POST",
|
135
|
+
headers: { "Content-Type": "application/activity+json" },
|
136
|
+
body
|
137
|
+
}), { contextData: void 0 });
|
138
|
+
assertEquals(response.status, 202);
|
139
|
+
assertEquals(processedActivities.length, 1);
|
140
|
+
response = await federation.fetch(new Request("https://example.com/inbox", {
|
141
|
+
method: "POST",
|
142
|
+
headers: { "Content-Type": "application/activity+json" },
|
143
|
+
body
|
144
|
+
}), { contextData: void 0 });
|
145
|
+
assertEquals(response.status, 202);
|
146
|
+
assertEquals(processedActivities.length, 1);
|
147
|
+
});
|
148
|
+
test("Federation.setInboxListeners().withIdempotency() - custom callback", async () => {
|
149
|
+
const federation = createTestFederation();
|
150
|
+
const processedActivities = [];
|
151
|
+
federation.setInboxListeners("/users/{identifier}/inbox", "/inbox").withIdempotency((ctx, activity) => {
|
152
|
+
if (activity instanceof Follow) return null;
|
153
|
+
const inboxId = ctx.recipient ?? "shared";
|
154
|
+
return `${ctx.origin}:${activity.id?.href}:${inboxId}`;
|
155
|
+
}).on(Create, (ctx, activity) => {
|
156
|
+
processedActivities.push([ctx.recipient, activity]);
|
157
|
+
}).on(Follow, (ctx, activity) => {
|
158
|
+
processedActivities.push([ctx.recipient, activity]);
|
159
|
+
});
|
160
|
+
const createActivity = new Create({
|
161
|
+
id: new URL("https://example.com/activities/4"),
|
162
|
+
actor: new URL("https://example.com/person2")
|
163
|
+
});
|
164
|
+
const signedCreate = await signObject(createActivity, ed25519PrivateKey, ed25519Multikey.id);
|
165
|
+
const createBody = JSON.stringify(await signedCreate.toJsonLd({ contextLoader: mockDocumentLoader }));
|
166
|
+
let response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
167
|
+
method: "POST",
|
168
|
+
headers: { "Content-Type": "application/activity+json" },
|
169
|
+
body: createBody
|
170
|
+
}), { contextData: void 0 });
|
171
|
+
assertEquals(response.status, 202);
|
172
|
+
assertEquals(processedActivities.length, 1);
|
173
|
+
response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
174
|
+
method: "POST",
|
175
|
+
headers: { "Content-Type": "application/activity+json" },
|
176
|
+
body: createBody
|
177
|
+
}), { contextData: void 0 });
|
178
|
+
assertEquals(response.status, 202);
|
179
|
+
assertEquals(processedActivities.length, 1);
|
180
|
+
const followActivity = new Follow({
|
181
|
+
id: new URL("https://example.com/activities/5"),
|
182
|
+
actor: new URL("https://example.com/person2")
|
183
|
+
});
|
184
|
+
const signedFollow = await signObject(followActivity, ed25519PrivateKey, ed25519Multikey.id);
|
185
|
+
const followBody = JSON.stringify(await signedFollow.toJsonLd({ contextLoader: mockDocumentLoader }));
|
186
|
+
response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
187
|
+
method: "POST",
|
188
|
+
headers: { "Content-Type": "application/activity+json" },
|
189
|
+
body: followBody
|
190
|
+
}), { contextData: void 0 });
|
191
|
+
assertEquals(response.status, 202);
|
192
|
+
assertEquals(processedActivities.length, 2);
|
193
|
+
response = await federation.fetch(new Request("https://example.com/users/john/inbox", {
|
194
|
+
method: "POST",
|
195
|
+
headers: { "Content-Type": "application/activity+json" },
|
196
|
+
body: followBody
|
197
|
+
}), { contextData: void 0 });
|
198
|
+
assertEquals(response.status, 202);
|
199
|
+
assertEquals(processedActivities.length, 3);
|
200
|
+
});
|
201
|
+
|
202
|
+
//#endregion
|
@@ -3,11 +3,11 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, Create, Invite, Offer, Update } from "../type-
|
6
|
+
import { Activity, Create, Invite, Offer, Update } from "../type-NEA09tSC.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
|
-
import "../lookup-
|
9
|
-
import { InboxListenerSet } from "../inbox-
|
10
|
-
import { test } from "../testing-
|
8
|
+
import "../lookup-DhQCVVja.js";
|
9
|
+
import { InboxListenerSet } from "../inbox-BoDY3z8G.js";
|
10
|
+
import { test } from "../testing-BnfPB5T-.js";
|
11
11
|
import "../assert_is_error-BPGph1Jx.js";
|
12
12
|
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
13
13
|
|
@@ -3,14 +3,14 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { CryptographicKey, Multikey } from "../type-
|
6
|
+
import { CryptographicKey, Multikey } from "../type-NEA09tSC.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
10
10
|
import { MemoryKvStore } from "../kv-CRZrzyXm.js";
|
11
|
-
import "../lookup-
|
12
|
-
import { KvKeyCache } from "../keycache-
|
13
|
-
import { test } from "../testing-
|
11
|
+
import "../lookup-DhQCVVja.js";
|
12
|
+
import { KvKeyCache } from "../keycache-TEniXNel.js";
|
13
|
+
import { test } from "../testing-BnfPB5T-.js";
|
14
14
|
|
15
15
|
//#region src/federation/keycache.test.ts
|
16
16
|
test("KvKeyCache.set()", async () => {
|
@@ -3,13 +3,13 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import "../type-
|
6
|
+
import "../type-NEA09tSC.js";
|
7
7
|
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-CRZrzyXm.js";
|
11
|
-
import "../lookup-
|
12
|
-
import { test } from "../testing-
|
11
|
+
import "../lookup-DhQCVVja.js";
|
12
|
+
import { test } from "../testing-BnfPB5T-.js";
|
13
13
|
import "../std__assert-X-_kMxKM.js";
|
14
14
|
import "../assert_rejects-DiIiJbZn.js";
|
15
15
|
import "../assert_is_error-BPGph1Jx.js";
|
@@ -24,6 +24,7 @@ test("MemoryKvStore", async (t) => {
|
|
24
24
|
assertEquals(await store.get(["foo", "bar"]), "foobar");
|
25
25
|
assertEquals(await store.get(["foo"]), void 0);
|
26
26
|
await store.set(["foo", "baz"], "baz", { ttl: Temporal.Duration.from({ seconds: 0 }) });
|
27
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
27
28
|
assertEquals(await store.get(["foo", "baz"]), void 0);
|
28
29
|
});
|
29
30
|
await t.step("delete()", async () => {
|