@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,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { MockKvStore, kvCache } from "../kv-cache-Bw2F2ABq.js";
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { n as kvCache, t as MockKvStore } from "../kv-cache-B01V7s3h.mjs";
|
|
7
5
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
8
|
-
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
9
6
|
import { deepStrictEqual, throws } from "node:assert";
|
|
10
|
-
|
|
7
|
+
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
11
8
|
//#region src/utils/kv-cache.test.ts
|
|
12
9
|
test("kvCache()", async (t) => {
|
|
13
10
|
const kv = new MockKvStore();
|
|
@@ -33,12 +30,11 @@ test("kvCache()", async (t) => {
|
|
|
33
30
|
type: "Object"
|
|
34
31
|
}
|
|
35
32
|
});
|
|
36
|
-
|
|
33
|
+
deepStrictEqual(await kv.get([
|
|
37
34
|
"_test",
|
|
38
35
|
"cached",
|
|
39
36
|
"https://example.com/object"
|
|
40
|
-
]);
|
|
41
|
-
deepStrictEqual(cache, result);
|
|
37
|
+
]), result);
|
|
42
38
|
await kv.set([
|
|
43
39
|
"_test",
|
|
44
40
|
"cached",
|
|
@@ -48,8 +44,7 @@ test("kvCache()", async (t) => {
|
|
|
48
44
|
documentUrl: "https://example.org/",
|
|
49
45
|
document: { "id": "https://example.org/" }
|
|
50
46
|
});
|
|
51
|
-
|
|
52
|
-
deepStrictEqual(result2, {
|
|
47
|
+
deepStrictEqual(await loader("https://example.org/"), {
|
|
53
48
|
contextUrl: null,
|
|
54
49
|
documentUrl: "https://example.org/",
|
|
55
50
|
document: { "id": "https://example.org/" }
|
|
@@ -63,22 +58,19 @@ test("kvCache()", async (t) => {
|
|
|
63
58
|
documentUrl: "https://example.net/",
|
|
64
59
|
document: { "id": "https://example.net/" }
|
|
65
60
|
});
|
|
66
|
-
|
|
67
|
-
deepStrictEqual(result3, {
|
|
61
|
+
deepStrictEqual(await loader("https://example.net/"), {
|
|
68
62
|
contextUrl: null,
|
|
69
63
|
documentUrl: "https://example.net/",
|
|
70
64
|
document: { "id": "https://example.net/" }
|
|
71
65
|
});
|
|
72
66
|
});
|
|
73
67
|
await t.step("not cached", async () => {
|
|
74
|
-
|
|
68
|
+
deepStrictEqual(await kvCache({
|
|
75
69
|
kv,
|
|
76
70
|
loader: mockDocumentLoader,
|
|
77
71
|
rules: [],
|
|
78
72
|
prefix: ["_test", "not cached"]
|
|
79
|
-
})
|
|
80
|
-
const result = await loader("https://example.com/object");
|
|
81
|
-
deepStrictEqual(result, {
|
|
73
|
+
})("https://example.com/object"), {
|
|
82
74
|
contextUrl: null,
|
|
83
75
|
documentUrl: "https://example.com/object",
|
|
84
76
|
document: {
|
|
@@ -88,12 +80,11 @@ test("kvCache()", async (t) => {
|
|
|
88
80
|
type: "Object"
|
|
89
81
|
}
|
|
90
82
|
});
|
|
91
|
-
|
|
83
|
+
deepStrictEqual(await kv.get([
|
|
92
84
|
"test2",
|
|
93
85
|
"not cached",
|
|
94
86
|
"https://example.com/object"
|
|
95
|
-
]);
|
|
96
|
-
deepStrictEqual(cache, void 0);
|
|
87
|
+
]), void 0);
|
|
97
88
|
});
|
|
98
89
|
await t.step("maximum cache duration", () => {
|
|
99
90
|
throws(() => kvCache({
|
|
@@ -128,7 +119,7 @@ test("kvCache()", async (t) => {
|
|
|
128
119
|
throw new Error("Failed to list keys");
|
|
129
120
|
}
|
|
130
121
|
}
|
|
131
|
-
|
|
122
|
+
deepStrictEqual(await kvCache({
|
|
132
123
|
kv: new KvStoreThrowsException(),
|
|
133
124
|
loader: mockDocumentLoader,
|
|
134
125
|
rules: [
|
|
@@ -137,9 +128,7 @@ test("kvCache()", async (t) => {
|
|
|
137
128
|
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
|
138
129
|
],
|
|
139
130
|
prefix: ["_test", "not cached"]
|
|
140
|
-
})
|
|
141
|
-
const result = await loader("https://example.com/object");
|
|
142
|
-
deepStrictEqual(result, {
|
|
131
|
+
})("https://example.com/object"), {
|
|
143
132
|
contextUrl: null,
|
|
144
133
|
documentUrl: "https://example.com/object",
|
|
145
134
|
document: {
|
|
@@ -151,7 +140,7 @@ test("kvCache()", async (t) => {
|
|
|
151
140
|
});
|
|
152
141
|
});
|
|
153
142
|
await t.step("preloaded contexts bypass cache", async () => {
|
|
154
|
-
const kv
|
|
143
|
+
const kv = new MockKvStore();
|
|
155
144
|
let loaderCalled = false;
|
|
156
145
|
const mockLoader = (url) => {
|
|
157
146
|
loaderCalled = true;
|
|
@@ -162,29 +151,26 @@ test("kvCache()", async (t) => {
|
|
|
162
151
|
});
|
|
163
152
|
};
|
|
164
153
|
const loader = kvCache({
|
|
165
|
-
kv
|
|
154
|
+
kv,
|
|
166
155
|
loader: mockLoader,
|
|
167
156
|
prefix: ["_test", "preloaded"]
|
|
168
157
|
});
|
|
169
158
|
const activityStreamsUrl = "https://www.w3.org/ns/activitystreams";
|
|
170
159
|
loaderCalled = false;
|
|
171
|
-
|
|
172
|
-
deepStrictEqual(result, {
|
|
160
|
+
deepStrictEqual(await loader(activityStreamsUrl), {
|
|
173
161
|
contextUrl: null,
|
|
174
162
|
documentUrl: activityStreamsUrl,
|
|
175
163
|
document: preloadedContexts[activityStreamsUrl]
|
|
176
164
|
});
|
|
177
165
|
deepStrictEqual(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
|
178
|
-
|
|
166
|
+
deepStrictEqual(await kv.get([
|
|
179
167
|
"_test",
|
|
180
168
|
"preloaded",
|
|
181
169
|
activityStreamsUrl
|
|
182
|
-
]);
|
|
183
|
-
deepStrictEqual(cachedValue, void 0, "Preloaded contexts should not be cached in KV store");
|
|
170
|
+
]), void 0, "Preloaded contexts should not be cached in KV store");
|
|
184
171
|
const securityUrl = "https://w3id.org/security/v1";
|
|
185
172
|
loaderCalled = false;
|
|
186
|
-
|
|
187
|
-
deepStrictEqual(result2, {
|
|
173
|
+
deepStrictEqual(await loader(securityUrl), {
|
|
188
174
|
contextUrl: null,
|
|
189
175
|
documentUrl: securityUrl,
|
|
190
176
|
document: preloadedContexts[securityUrl]
|
|
@@ -199,13 +185,12 @@ test("kvCache()", async (t) => {
|
|
|
199
185
|
document: { "mock": "document" }
|
|
200
186
|
});
|
|
201
187
|
deepStrictEqual(loaderCalled, true, "Loader should be called for non-preloaded URLs");
|
|
202
|
-
|
|
188
|
+
deepStrictEqual(await kv.get([
|
|
203
189
|
"_test",
|
|
204
190
|
"preloaded",
|
|
205
191
|
nonPreloadedUrl
|
|
206
|
-
]);
|
|
207
|
-
deepStrictEqual(cachedValue2, result3, "Non-preloaded URLs should be cached");
|
|
192
|
+
]), result3, "Non-preloaded URLs should be cached");
|
|
208
193
|
});
|
|
209
194
|
});
|
|
210
|
-
|
|
211
|
-
|
|
195
|
+
//#endregion
|
|
196
|
+
export {};
|
package/dist/utils/mod.cjs
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require('../http-ca2xny58.cjs');
|
|
6
|
-
const require_kv_cache = require('../kv-cache-BBJFLMW5.cjs');
|
|
7
|
-
require('../utils-BQ9KqEK9.cjs');
|
|
8
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const require_kv_cache = require("../kv-cache-YCtINZK4.cjs");
|
|
9
5
|
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
|
10
|
-
exports.kvCache = require_kv_cache.kvCache;
|
|
6
|
+
exports.kvCache = require_kv_cache.kvCache;
|
package/dist/utils/mod.d.cts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../kv-BL4nlICN.cjs";
|
|
3
|
-
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-Bx9jcLB8.cjs";
|
|
1
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-B505FZBC.cjs";
|
|
4
2
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/utils/mod.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import "../
|
|
4
|
-
import "../kv-DXEUEP6z.js";
|
|
5
|
-
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-Cs2dYEwI.js";
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../mod-D7PAuO6k.js";
|
|
6
4
|
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/utils/mod.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "../http-EUQ6crVa.js";
|
|
6
|
-
import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-SKgbvvu4.js";
|
|
7
|
-
import "../utils-Dn5OPdSW.js";
|
|
8
|
-
|
|
9
|
-
export { getAuthenticatedDocumentLoader, kvCache };
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "../kv-cache-B2Qi5MGv.js";
|
|
4
|
+
export { getAuthenticatedDocumentLoader, kvCache };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
2
|
+
import "urlpattern-polyfill";
|
|
3
|
+
globalThis.addEventListener = () => {};
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import { test } from "@fedify/fixture";
|
|
6
|
+
import { strictEqual } from "node:assert";
|
|
7
|
+
//#region src/vocab/cjs.test.ts
|
|
8
|
+
test("CommonJS vocab entry exports Object", { ignore: "Deno" in globalThis }, () => {
|
|
9
|
+
const vocab = createRequire(import.meta.url)("./mod.cjs");
|
|
10
|
+
strictEqual(typeof vocab.Object, "function");
|
|
11
|
+
strictEqual(typeof vocab.Update, "function");
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export {};
|
package/dist/vocab/mod.cjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
get: function () { return __fedify_vocab[k]; }
|
|
12
|
-
});
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
+
var _fedify_vocab = require("@fedify/vocab");
|
|
4
|
+
Object.keys(_fedify_vocab).forEach(function(k) {
|
|
5
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _fedify_vocab[k];
|
|
9
|
+
}
|
|
10
|
+
});
|
|
13
11
|
});
|
package/dist/vocab/mod.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/fedify",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "An ActivityPub server framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ActivityPub",
|
|
@@ -144,9 +144,9 @@
|
|
|
144
144
|
"uri-template-router": "^1.0.0",
|
|
145
145
|
"url-template": "^3.1.1",
|
|
146
146
|
"urlpattern-polyfill": "^10.1.0",
|
|
147
|
-
"@fedify/vocab
|
|
148
|
-
"@fedify/
|
|
149
|
-
"@fedify/
|
|
147
|
+
"@fedify/vocab": "2.1.3",
|
|
148
|
+
"@fedify/vocab-runtime": "2.1.3",
|
|
149
|
+
"@fedify/webfinger": "2.1.3"
|
|
150
150
|
},
|
|
151
151
|
"devDependencies": {
|
|
152
152
|
"@std/assert": "npm:@jsr/std__assert@^0.226.0",
|
|
@@ -154,12 +154,12 @@
|
|
|
154
154
|
"@types/node": "^24.2.1",
|
|
155
155
|
"fetch-mock": "^12.5.4",
|
|
156
156
|
"miniflare": "^4.20250523.0",
|
|
157
|
-
"tsdown": "^0.
|
|
157
|
+
"tsdown": "^0.21.6",
|
|
158
158
|
"tsx": "^4.19.4",
|
|
159
|
-
"typescript": "^5.9.
|
|
159
|
+
"typescript": "^5.9.2",
|
|
160
160
|
"wrangler": "^4.17.0",
|
|
161
|
-
"@fedify/
|
|
162
|
-
"@fedify/
|
|
161
|
+
"@fedify/vocab-tools": "^2.1.3",
|
|
162
|
+
"@fedify/fixture": "2.0.0"
|
|
163
163
|
},
|
|
164
164
|
"scripts": {
|
|
165
165
|
"build:self": "tsdown",
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
6
|
-
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
7
|
-
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
|
-
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
9
|
-
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-DH972JvX.js";
|
|
11
|
-
import { FederationImpl, actorDehydrator, autoIdAssigner } from "../middleware-BHJ0xm0L.js";
|
|
12
|
-
import "../client-CoCIaTNO.js";
|
|
13
|
-
import "../router-D9eI0s4b.js";
|
|
14
|
-
import "../types-CPz01LGH.js";
|
|
15
|
-
import "../accept-D7sAxyNa.js";
|
|
16
|
-
import "../key-CypuWa94.js";
|
|
17
|
-
import "../http-DFzT4YFG.js";
|
|
18
|
-
import "../ld-CXLtTc0G.js";
|
|
19
|
-
import "../owner-CwMai3jn.js";
|
|
20
|
-
import "../proof-ZuJBOUoi.js";
|
|
21
|
-
import "../docloader-Ck0SCLXX.js";
|
|
22
|
-
import "../kv-cache-Bw2F2ABq.js";
|
|
23
|
-
import "../inbox-BMLz_-pL.js";
|
|
24
|
-
import "../builder-DbKYZdSy.js";
|
|
25
|
-
import "../collection-CSzG2j1P.js";
|
|
26
|
-
import "../keycache-CpGWAUbj.js";
|
|
27
|
-
import "../negotiation-BlAuS_nr.js";
|
|
28
|
-
import "../retry-mqLf4b-R.js";
|
|
29
|
-
import "../send-BW73dy6Q.js";
|
|
30
|
-
import { test } from "@fedify/fixture";
|
|
31
|
-
import { Follow, Person } from "@fedify/vocab";
|
|
32
|
-
|
|
33
|
-
//#region src/compat/transformers.test.ts
|
|
34
|
-
const federation = new FederationImpl({ kv: new MemoryKvStore() });
|
|
35
|
-
const context = federation.createContext(new URL("http://example.com/"));
|
|
36
|
-
test("autoIdAssigner", async () => {
|
|
37
|
-
const activity = new Follow({
|
|
38
|
-
actor: new URL("http://example.com/actors/1"),
|
|
39
|
-
object: new Person({
|
|
40
|
-
id: new URL("http://example.com/actors/2"),
|
|
41
|
-
name: "Bob",
|
|
42
|
-
preferredUsername: "bob"
|
|
43
|
-
})
|
|
44
|
-
});
|
|
45
|
-
const result = autoIdAssigner(activity, context);
|
|
46
|
-
const { id } = result;
|
|
47
|
-
assertInstanceOf(id, URL);
|
|
48
|
-
assertEquals(id.origin, "http://example.com");
|
|
49
|
-
assertEquals(id.pathname, "/");
|
|
50
|
-
assertEquals(id.search, "");
|
|
51
|
-
assert(id.hash.match(/^#Follow\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/));
|
|
52
|
-
assertEquals(await result.toJsonLd(), await new Follow({
|
|
53
|
-
id,
|
|
54
|
-
actor: new URL("http://example.com/actors/1"),
|
|
55
|
-
object: new Person({
|
|
56
|
-
id: new URL("http://example.com/actors/2"),
|
|
57
|
-
name: "Bob",
|
|
58
|
-
preferredUsername: "bob"
|
|
59
|
-
})
|
|
60
|
-
}).toJsonLd());
|
|
61
|
-
});
|
|
62
|
-
test("actorDehydrator()", async () => {
|
|
63
|
-
const activity = new Follow({
|
|
64
|
-
id: new URL("http://example.com/activities/1"),
|
|
65
|
-
actor: new Person({
|
|
66
|
-
id: new URL("http://example.com/actors/1"),
|
|
67
|
-
name: "Alice",
|
|
68
|
-
preferredUsername: "alice"
|
|
69
|
-
}),
|
|
70
|
-
object: new Person({
|
|
71
|
-
id: new URL("http://example.com/actors/2"),
|
|
72
|
-
name: "Bob",
|
|
73
|
-
preferredUsername: "bob"
|
|
74
|
-
})
|
|
75
|
-
});
|
|
76
|
-
const result = actorDehydrator(activity, context);
|
|
77
|
-
assertEquals(await result.toJsonLd(), await new Follow({
|
|
78
|
-
id: new URL("http://example.com/activities/1"),
|
|
79
|
-
actor: new URL("http://example.com/actors/1"),
|
|
80
|
-
object: new Person({
|
|
81
|
-
id: new URL("http://example.com/actors/2"),
|
|
82
|
-
name: "Bob",
|
|
83
|
-
preferredUsername: "bob"
|
|
84
|
-
})
|
|
85
|
-
}).toJsonLd());
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
//#endregion
|
package/dist/compat-Bb4NuTUO.js
DELETED
package/dist/compat-DmDDELst.cjs
DELETED
package/dist/deno-DH972JvX.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
6
|
-
//#region deno.json
|
|
7
|
-
var name = "@fedify/fedify";
|
|
8
|
-
var version = "2.1.1";
|
|
9
|
-
var license = "MIT";
|
|
10
|
-
var exports = {
|
|
11
|
-
".": "./src/mod.ts",
|
|
12
|
-
"./compat": "./src/compat/mod.ts",
|
|
13
|
-
"./federation": "./src/federation/mod.ts",
|
|
14
|
-
"./nodeinfo": "./src/nodeinfo/mod.ts",
|
|
15
|
-
"./otel": "./src/otel/mod.ts",
|
|
16
|
-
"./runtime": "./src/runtime/mod.ts",
|
|
17
|
-
"./sig": "./src/sig/mod.ts",
|
|
18
|
-
"./utils": "./src/utils/mod.ts",
|
|
19
|
-
"./vocab": "./src/vocab/mod.ts"
|
|
20
|
-
};
|
|
21
|
-
var imports = {
|
|
22
|
-
"@multiformats/base-x": "npm:@multiformats/base-x@^4.0.1",
|
|
23
|
-
"@std/assert": "jsr:@std/assert@^0.226.0",
|
|
24
|
-
"@std/url": "jsr:@std/url@^0.225.1",
|
|
25
|
-
"asn1js": "npm:asn1js@^3.0.7",
|
|
26
|
-
"fast-check": "npm:fast-check@^3.22.0",
|
|
27
|
-
"fetch-mock": "npm:fetch-mock@^12.5.2",
|
|
28
|
-
"json-canon": "npm:json-canon@^1.0.1",
|
|
29
|
-
"jsonld": "npm:jsonld@^9.0.0",
|
|
30
|
-
"pkijs": "npm:pkijs@^3.3.3",
|
|
31
|
-
"structured-field-values": "npm:structured-field-values@^2.0.4",
|
|
32
|
-
"uri-template-router": "npm:uri-template-router@^1.0.0",
|
|
33
|
-
"url-template": "npm:url-template@^3.1.1"
|
|
34
|
-
};
|
|
35
|
-
var exclude = [
|
|
36
|
-
".test-report.xml",
|
|
37
|
-
"apidoc/",
|
|
38
|
-
"dist/",
|
|
39
|
-
"node_modules/",
|
|
40
|
-
"npm/",
|
|
41
|
-
"pnpm-lock.yaml",
|
|
42
|
-
"src/cfworkers/dist/",
|
|
43
|
-
"src/cfworkers/fixtures/",
|
|
44
|
-
"src/cfworkers/imports.ts",
|
|
45
|
-
"src/cfworkers/README.md",
|
|
46
|
-
"src/cfworkers/server.ts",
|
|
47
|
-
"src/cfworkers/server.js",
|
|
48
|
-
"src/cfworkers/server.js.map"
|
|
49
|
-
];
|
|
50
|
-
var publish = { "exclude": [
|
|
51
|
-
"**/*.test.ts",
|
|
52
|
-
"src/testing/",
|
|
53
|
-
"tsdown.config.ts",
|
|
54
|
-
"scripts/",
|
|
55
|
-
"wrangler.toml"
|
|
56
|
-
] };
|
|
57
|
-
var tasks = {
|
|
58
|
-
"codegen": "deno task -f @fedify/vocab compile",
|
|
59
|
-
"cache": {
|
|
60
|
-
"command": "deno cache src/mod.ts",
|
|
61
|
-
"dependencies": ["codegen"]
|
|
62
|
-
},
|
|
63
|
-
"check": {
|
|
64
|
-
"command": "deno fmt --check && deno lint && deno check src/**/*.ts",
|
|
65
|
-
"dependencies": ["codegen"]
|
|
66
|
-
},
|
|
67
|
-
"test": {
|
|
68
|
-
"command": "deno test --check --doc --allow-read --allow-write --allow-env --unstable-kv --trace-leaks --parallel",
|
|
69
|
-
"dependencies": ["codegen"]
|
|
70
|
-
},
|
|
71
|
-
"coverage": "deno task test --clean --coverage && deno coverage --html coverage",
|
|
72
|
-
"bench": {
|
|
73
|
-
"command": "deno bench --allow-read --allow-write --allow-net --allow-env --allow-run --unstable-kv",
|
|
74
|
-
"dependencies": ["codegen"]
|
|
75
|
-
},
|
|
76
|
-
"apidoc": {
|
|
77
|
-
"command": "deno doc --html --name=Fedify --output=apidoc/ src/mod.ts",
|
|
78
|
-
"dependencies": ["codegen"]
|
|
79
|
-
},
|
|
80
|
-
"publish": {
|
|
81
|
-
"command": "deno publish",
|
|
82
|
-
"dependencies": ["codegen"]
|
|
83
|
-
},
|
|
84
|
-
"pnpm:install": "pnpm install --silent",
|
|
85
|
-
"pnpm:build": {
|
|
86
|
-
"command": "pnpm exec tsdown",
|
|
87
|
-
"dependencies": ["pnpm:build-vocab"]
|
|
88
|
-
},
|
|
89
|
-
"test:node": {
|
|
90
|
-
"command": "cd dist/ && node --test",
|
|
91
|
-
"dependencies": ["pnpm:build"]
|
|
92
|
-
},
|
|
93
|
-
"test:bun": {
|
|
94
|
-
"command": "cd dist/ && bun test --timeout 60000",
|
|
95
|
-
"dependencies": ["pnpm:build"]
|
|
96
|
-
},
|
|
97
|
-
"test:cfworkers": {
|
|
98
|
-
"command": "pnpm exec wrangler deploy --dry-run --outdir src/cfworkers && node --import=tsx src/cfworkers/client.ts",
|
|
99
|
-
"dependencies": ["pnpm:build"]
|
|
100
|
-
},
|
|
101
|
-
"test-all": { "dependencies": [
|
|
102
|
-
"check",
|
|
103
|
-
"test",
|
|
104
|
-
"test:node",
|
|
105
|
-
"test:bun",
|
|
106
|
-
"test:cfworkers"
|
|
107
|
-
] }
|
|
108
|
-
};
|
|
109
|
-
var deno_default = {
|
|
110
|
-
name,
|
|
111
|
-
version,
|
|
112
|
-
license,
|
|
113
|
-
exports,
|
|
114
|
-
imports,
|
|
115
|
-
exclude,
|
|
116
|
-
publish,
|
|
117
|
-
tasks
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
//#endregion
|
|
121
|
-
export { deno_default };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
import { URLPattern } from "urlpattern-polyfill";
|
|
4
|
-
globalThis.addEventListener = () => {};
|
|
5
|
-
|
|
6
|
-
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
7
|
-
import "../assert-MZs1qjMx.js";
|
|
8
|
-
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
|
-
import { buildCollectionSynchronizationHeader, digest } from "../collection-CSzG2j1P.js";
|
|
10
|
-
import "../std__assert-X-_kMxKM.js";
|
|
11
|
-
import "../assert_rejects-0h7I2Esa.js";
|
|
12
|
-
import "../assert_throws-rjdMBf31.js";
|
|
13
|
-
import "../assert_not_equals-f3m3epl3.js";
|
|
14
|
-
import { test } from "@fedify/fixture";
|
|
15
|
-
import { decodeHex } from "byte-encodings/hex";
|
|
16
|
-
|
|
17
|
-
//#region src/federation/collection.test.ts
|
|
18
|
-
test("digest()", async () => {
|
|
19
|
-
const uris = [
|
|
20
|
-
new URL("https://testing.example.org/users/1"),
|
|
21
|
-
new URL("https://testing.example.org/users/2"),
|
|
22
|
-
new URL("https://testing.example.org/users/2")
|
|
23
|
-
];
|
|
24
|
-
const result = await digest(uris);
|
|
25
|
-
assertEquals(result, decodeHex("c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f"));
|
|
26
|
-
});
|
|
27
|
-
test("buildCollectionSynchronizationHeader()", async () => {
|
|
28
|
-
const header = await buildCollectionSynchronizationHeader("https://testing.example.org/users/1/followers", ["https://testing.example.org/users/2", "https://testing.example.org/users/1"]);
|
|
29
|
-
assertEquals(header, "collectionId=\"https://testing.example.org/users/1/followers\", url=\"https://testing.example.org/users/1/followers?base-url=https%3A%2F%2Ftesting.example.org%2F\", digest=\"c33f48cd341ef046a206b8a72ec97af65079f9a3a9b90eef79c5920dce45c61f\"");
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
//#endregion
|