@fedify/fedify 2.0.0-pr.412.1692 → 2.0.0-pr.412.1794
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/README.md +3 -0
- package/dist/{actor-D5S46edz.js → actor-BXHc5r-q.js} +1 -1
- package/dist/{actor-CrTGiTZd.cjs → actor-Ba9Z1eNJ.cjs} +921 -1451
- package/dist/{actor-T6RyhRgk.d.ts → actor-DqFajh9s.d.ts} +2 -2
- package/dist/{actor-G2S5sPEA.js → actor-DzhunPC_.js} +189 -677
- package/dist/{actor-D6K058Tb.d.cts → actor-f2NtjyCg.d.cts} +2 -2
- package/dist/{assert_rejects-DiIiJbZn.js → assert_rejects-Ce45JcFg.js} +1 -1
- package/dist/{assert_is_error-BPGph1Jx.js → assert_throws-BNXdRGWP.js} +31 -1
- package/dist/{builder-OA47XRft.js → builder-u7usRsT3.js} +7 -8
- package/dist/{client-CegPX0Rn.d.cts → client-94iWEfQa.d.cts} +1 -1
- package/dist/{client-bgSdkFa2.d.ts → client-BsGzbnV-.d.ts} +1 -1
- package/dist/{client-Bmd-i8x8.js → client-pY7-3icS.js} +1 -1
- package/dist/compat/mod.d.cts +11 -12
- package/dist/compat/mod.d.ts +11 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-ByZprN0S.d.ts → context-DG0huGW-.d.ts} +124 -127
- package/dist/{context-C5BsZkDr.d.cts → context-DJ8aSy2Q.d.cts} +124 -127
- package/dist/{authdocloader-SjwloJUA.js → docloader-CrbAy9Oc.js} +17 -8
- package/dist/{esm-CwHz8Y8t.js → esm-C-Qa1zEM.js} +11 -11
- package/dist/federation/builder.test.js +8 -10
- package/dist/federation/collection.test.js +7 -9
- package/dist/federation/handler.test.js +25 -26
- package/dist/federation/idempotency.test.js +25 -26
- package/dist/federation/inbox.test.js +4 -6
- package/dist/federation/keycache.test.js +3 -4
- package/dist/federation/kv.test.js +6 -8
- package/dist/federation/middleware.test.js +32 -33
- package/dist/federation/mod.cjs +9 -11
- package/dist/federation/mod.d.cts +12 -13
- package/dist/federation/mod.d.ts +12 -13
- package/dist/federation/mod.js +9 -11
- package/dist/federation/mq.test.js +8 -10
- package/dist/federation/negotiation.test.js +7 -9
- package/dist/federation/retry.test.js +4 -5
- package/dist/federation/router.test.js +6 -8
- package/dist/federation/send.test.js +13 -15
- package/dist/{http-D6Uj2x2y.d.ts → http-BbO0ejuk.d.ts} +2 -2
- package/dist/{http-C5tC93Hn.js → http-CUVx-vzb.js} +256 -6
- package/dist/{http-DGjdMiLc.js → http-D2kIm9la.js} +2 -2
- package/dist/{http-BiBofurJ.cjs → http-Dofes42e.cjs} +289 -9
- package/dist/{http-D-e6AFwR.d.cts → http-M8k5mKc0.d.cts} +2 -2
- package/dist/{inbox-BoDY3z8G.js → inbox-HjG5peXY.js} +1 -1
- package/dist/{key-IxRhZpOF.js → key-CxdLUFS6.js} +3 -2
- package/dist/{keycache-TEniXNel.js → keycache-bU7COwsh.js} +1 -1
- package/dist/{keys-bZxcrZ9Z.js → keys-DMHs8XNn.js} +2 -1
- package/dist/kv-cache-CGXcDejL.js +122 -0
- package/dist/kv-cache-DN9pfMBe.js +94 -0
- package/dist/kv-cache-Dkvbn6rg.cjs +134 -0
- package/dist/{ld-DW7A0uIc.js → ld-CIhvSCCr.js} +3 -2
- package/dist/{lookup-cVRa2QM-.js → lookup-CHkCVZTU.js} +131 -2
- package/dist/lookup-CfFkONZD.cjs +272 -0
- package/dist/{type-NEA09tSC.js → lookup-DQRtjvb1.js} +503 -5328
- package/dist/middleware-Bot7EEwV.js +26 -0
- package/dist/middleware-CFJgmUMW.cjs +15 -0
- package/dist/{middleware-Cgr3PtaJ.js → middleware-CJlj5Olw.js} +44 -48
- package/dist/middleware-CjHl2NHA.js +15 -0
- package/dist/{middleware-TfuVoceY.cjs → middleware-D74TgW2E.cjs} +60 -66
- package/dist/{middleware-DvvYAIsd.js → middleware-DMk2Mdn9.js} +40 -46
- package/dist/mod-0noXw66R.d.cts +107 -0
- package/dist/{mod-BhUKmBJD.d.ts → mod-B2iOw50L.d.ts} +3 -3
- package/dist/mod-B9M-8jm2.d.ts +109 -0
- package/dist/{mod-DlU8ISoa.d.ts → mod-BlVovdcy.d.ts} +2 -2
- package/dist/{mod-D6hQoxC5.d.ts → mod-BoHnwOCs.d.ts} +2 -2
- package/dist/{mod-CxkWO3Mg.d.cts → mod-BxRCHTz-.d.cts} +2 -2
- package/dist/{mod-jQ4OODsl.d.cts → mod-C58MZ7Wx.d.cts} +1 -1
- package/dist/{mod-8DMWKtQE.d.cts → mod-DJcZDvjA.d.cts} +2 -2
- package/dist/{mod-Djzcw2ry.d.cts → mod-DgdBYYa0.d.cts} +3 -3
- package/dist/{mod-DBzN0aCM.d.ts → mod-Ds0mpFZU.d.ts} +1 -1
- package/dist/mod.cjs +19 -32
- package/dist/mod.d.cts +15 -16
- package/dist/mod.d.ts +16 -17
- package/dist/mod.js +14 -16
- package/dist/nodeinfo/client.test.js +8 -10
- package/dist/nodeinfo/handler.test.js +24 -25
- package/dist/nodeinfo/mod.cjs +2 -3
- package/dist/nodeinfo/mod.d.cts +2 -4
- package/dist/nodeinfo/mod.d.ts +2 -4
- package/dist/nodeinfo/mod.js +2 -3
- package/dist/nodeinfo/types.test.js +7 -9
- package/dist/{owner-BN_tO3cY.d.cts → owner-B4HbyP8s.d.cts} +3 -3
- package/dist/{owner-6Vc3UXXE.js → owner-Dvh7mBvr.js} +3 -2
- package/dist/{owner-hd9lvQcP.d.ts → owner-kQRGVXG1.d.ts} +3 -3
- package/dist/{proof-CRJWXFfT.cjs → proof-D0uThUvD.cjs} +17 -16
- package/dist/{proof-C1jhbeNv.js → proof-Dgy35fzc.js} +2 -2
- package/dist/{proof-Chi90OXv.js → proof-fqzaMJ4g.js} +5 -4
- package/dist/{send-DjATl6i3.js → send-Drp20VO9.js} +2 -2
- package/dist/sig/http.test.js +12 -13
- package/dist/sig/key.test.js +9 -11
- package/dist/sig/ld.test.js +8 -10
- package/dist/sig/mod.cjs +9 -11
- package/dist/sig/mod.d.cts +5 -7
- package/dist/sig/mod.d.ts +5 -7
- package/dist/sig/mod.js +5 -7
- package/dist/sig/owner.test.js +10 -12
- package/dist/sig/proof.test.js +13 -14
- package/dist/testing/docloader.test.js +6 -8
- package/dist/testing/mod.d.ts +114 -196
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-BnfPB5T-.js → testing-g4UC4liW.js} +1 -2
- package/dist/{types-dLXLjVLf.js → types-BtUjyi5y.js} +1 -1
- package/dist/{types-CmmUQisS.cjs → types-CWgzGaqk.cjs} +3 -3
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +14 -15
- package/dist/utils/kv-cache.test.js +209 -0
- package/dist/utils/mod.cjs +12 -0
- package/dist/utils/mod.d.cts +5 -0
- package/dist/utils/mod.d.ts +7 -0
- package/dist/utils/mod.js +11 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +7 -9
- package/dist/vocab/mod.cjs +3 -4
- package/dist/vocab/mod.d.cts +3 -5
- package/dist/vocab/mod.d.ts +3 -5
- package/dist/vocab/mod.js +3 -4
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +9 -10
- package/dist/{vocab-BI0Ak5lL.d.ts → vocab-BCWe1Ih5.d.ts} +2 -21
- package/dist/{vocab-rWbHpc2J.js → vocab-BnR3nIU9.js} +3 -3
- package/dist/{vocab-Dw1-yVGg.d.cts → vocab-CeDBzu-f.d.cts} +2 -21
- package/dist/{vocab-C5Y-0fGj.cjs → vocab-DFaWWYDn.cjs} +5 -5
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +2 -3
- package/dist/webfinger/mod.d.cts +1 -3
- package/dist/webfinger/mod.d.ts +1 -3
- package/dist/webfinger/mod.js +2 -3
- package/dist/x/cfworkers.d.cts +2 -2
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +6 -8
- package/dist/x/hono.d.cts +10 -11
- package/dist/x/hono.d.ts +10 -11
- package/dist/x/sveltekit.d.cts +10 -11
- package/dist/x/sveltekit.d.ts +10 -11
- package/package.json +18 -17
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-C5AvdCCi.js +0 -52
- package/dist/authdocloader-CQMPmpaO.cjs +0 -58
- package/dist/docloader-7Ey7wNHx.cjs +0 -4861
- package/dist/docloader-CkweNhUH.js +0 -4795
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-D-MrRyHl.d.cts +0 -219
- package/dist/key-CZR7QraT.cjs +0 -290
- package/dist/key-Cf8MffVe.cjs +0 -10
- package/dist/key-CkxrAIyp.js +0 -260
- package/dist/key-Dk0j88Jo.js +0 -10
- package/dist/key-Epcl5jpz.js +0 -10
- package/dist/lookup-DhQCVVja.js +0 -331
- package/dist/lookup-DiV4LFBg.cjs +0 -137
- package/dist/middleware-Be1JStOx.js +0 -17
- package/dist/middleware-CDOK7WOb.js +0 -26
- package/dist/middleware-EjIW2mZB.cjs +0 -17
- package/dist/mod-CerN_Sza.d.ts +0 -104
- package/dist/mod-Cj1tHXBR.d.cts +0 -102
- package/dist/runtime/docloader.test.js +0 -522
- package/dist/runtime/key.test.d.ts +0 -3
- package/dist/runtime/key.test.js +0 -103
- package/dist/runtime/langstr.test.d.ts +0 -3
- package/dist/runtime/langstr.test.js +0 -39
- package/dist/runtime/link.test.d.ts +0 -3
- package/dist/runtime/link.test.js +0 -61
- package/dist/runtime/mod.cjs +0 -25
- package/dist/runtime/mod.d.cts +0 -6
- package/dist/runtime/mod.d.ts +0 -8
- package/dist/runtime/mod.js +0 -13
- package/dist/runtime/multibase/multibase.test.d.ts +0 -3
- package/dist/runtime/multibase/multibase.test.js +0 -358
- package/dist/runtime/url.test.d.ts +0 -3
- package/dist/runtime/url.test.js +0 -45
- /package/dist/{assert_not_equals-f3m3epl3.js → assert_not_equals-C80BG-_5.js} +0 -0
- /package/dist/{collection-CcnIw1qY.js → collection-BzWsN9pB.js} +0 -0
- /package/dist/{denokv-Bv33Xxea.js → denokv-CCssOzMJ.js} +0 -0
- /package/dist/{federation-H2_En3j5.cjs → federation-CRpdnOMS.cjs} +0 -0
- /package/dist/{federation-D1U8YY9t.js → federation-jcR8-ZxP.js} +0 -0
- /package/dist/{kv-C7sopW2E.d.ts → kv-BKNZ-Tb-.d.ts} +0 -0
- /package/dist/{kv-63Cil1MD.d.cts → kv-Bxr0Q87_.d.cts} +0 -0
- /package/dist/{mod-FZd39qVq.d.cts → mod-B-hUPT2N.d.cts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-CVgZgliM.d.ts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-xIj-IT58.d.ts} +0 -0
- /package/dist/{mq-CRGm1e_F.d.ts → mq-CUKlBw08.d.ts} +0 -0
- /package/dist/{mq-B7R1Q-M5.d.cts → mq-DcJPkXD5.d.cts} +0 -0
- /package/dist/{negotiation-5NPJL6zp.js → negotiation-C4nFufNk.js} +0 -0
- /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-BnthBobC.js} +0 -0
- /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-CdN0rEnZ.cjs} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{runtime-DPYEDf-o.js → sig-C34-oHBl.js} +0 -0
- /package/dist/{runtime-C58AJWSv.cjs → sig-YYj5tCnr.cjs} +0 -0
- /package/dist/{std__assert-X-_kMxKM.js → std__assert-DWivtrGR.js} +0 -0
- /package/dist/{types-BSuWJsOm.js → types-C2XVl6gj.js} +0 -0
- /package/dist/{runtime → utils}/docloader.test.d.ts +0 -0
- /package/dist/{runtime/authdocloader.test.d.ts → utils/kv-cache.test.d.ts} +0 -0
- /package/dist/{sig-Cj3tk-ig.js → utils-D-Va7aXC.js} +0 -0
- /package/dist/{sig-ByHXzqUi.cjs → utils-DyRU1gdZ.cjs} +0 -0
- /package/dist/{webfinger-De_bU0iE.js → webfinger-C72Y8lrh.js} +0 -0
- /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-vAtLmxOF.cjs} +0 -0
@@ -0,0 +1,209 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import "../lookup-DQRtjvb1.js";
|
7
|
+
import { MockKvStore, kvCache } from "../kv-cache-DN9pfMBe.js";
|
8
|
+
import { mockDocumentLoader, test } from "../testing-g4UC4liW.js";
|
9
|
+
import { preloadedContexts } from "@fedify/vocab-runtime";
|
10
|
+
import { deepStrictEqual, throws } from "node:assert";
|
11
|
+
|
12
|
+
//#region src/utils/kv-cache.test.ts
|
13
|
+
test("kvCache()", async (t) => {
|
14
|
+
const kv = new MockKvStore();
|
15
|
+
await t.step("cached", async () => {
|
16
|
+
const loader = kvCache({
|
17
|
+
kv,
|
18
|
+
loader: mockDocumentLoader,
|
19
|
+
rules: [
|
20
|
+
["https://example.org/", Temporal.Duration.from({ days: 1 })],
|
21
|
+
[new URL("https://example.net/"), Temporal.Duration.from({ days: 1 })],
|
22
|
+
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
23
|
+
],
|
24
|
+
prefix: ["_test", "cached"]
|
25
|
+
});
|
26
|
+
const result = await loader("https://example.com/object");
|
27
|
+
deepStrictEqual(result, {
|
28
|
+
contextUrl: null,
|
29
|
+
documentUrl: "https://example.com/object",
|
30
|
+
document: {
|
31
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
32
|
+
id: "https://example.com/object",
|
33
|
+
name: "Fetched object",
|
34
|
+
type: "Object"
|
35
|
+
}
|
36
|
+
});
|
37
|
+
const cache = await kv.get([
|
38
|
+
"_test",
|
39
|
+
"cached",
|
40
|
+
"https://example.com/object"
|
41
|
+
]);
|
42
|
+
deepStrictEqual(cache, result);
|
43
|
+
await kv.set([
|
44
|
+
"_test",
|
45
|
+
"cached",
|
46
|
+
"https://example.org/"
|
47
|
+
], {
|
48
|
+
contextUrl: null,
|
49
|
+
documentUrl: "https://example.org/",
|
50
|
+
document: { "id": "https://example.org/" }
|
51
|
+
});
|
52
|
+
const result2 = await loader("https://example.org/");
|
53
|
+
deepStrictEqual(result2, {
|
54
|
+
contextUrl: null,
|
55
|
+
documentUrl: "https://example.org/",
|
56
|
+
document: { "id": "https://example.org/" }
|
57
|
+
});
|
58
|
+
await kv.set([
|
59
|
+
"_test",
|
60
|
+
"cached",
|
61
|
+
"https://example.net/"
|
62
|
+
], {
|
63
|
+
contextUrl: null,
|
64
|
+
documentUrl: "https://example.net/",
|
65
|
+
document: { "id": "https://example.net/" }
|
66
|
+
});
|
67
|
+
const result3 = await loader("https://example.net/");
|
68
|
+
deepStrictEqual(result3, {
|
69
|
+
contextUrl: null,
|
70
|
+
documentUrl: "https://example.net/",
|
71
|
+
document: { "id": "https://example.net/" }
|
72
|
+
});
|
73
|
+
});
|
74
|
+
await t.step("not cached", async () => {
|
75
|
+
const loader = kvCache({
|
76
|
+
kv,
|
77
|
+
loader: mockDocumentLoader,
|
78
|
+
rules: [],
|
79
|
+
prefix: ["_test", "not cached"]
|
80
|
+
});
|
81
|
+
const result = await loader("https://example.com/object");
|
82
|
+
deepStrictEqual(result, {
|
83
|
+
contextUrl: null,
|
84
|
+
documentUrl: "https://example.com/object",
|
85
|
+
document: {
|
86
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
87
|
+
id: "https://example.com/object",
|
88
|
+
name: "Fetched object",
|
89
|
+
type: "Object"
|
90
|
+
}
|
91
|
+
});
|
92
|
+
const cache = await kv.get([
|
93
|
+
"test2",
|
94
|
+
"not cached",
|
95
|
+
"https://example.com/object"
|
96
|
+
]);
|
97
|
+
deepStrictEqual(cache, void 0);
|
98
|
+
});
|
99
|
+
await t.step("maximum cache duration", () => {
|
100
|
+
throws(() => kvCache({
|
101
|
+
kv,
|
102
|
+
loader: mockDocumentLoader,
|
103
|
+
rules: [["https://example.com/", Temporal.Duration.from({
|
104
|
+
days: 30,
|
105
|
+
seconds: 1
|
106
|
+
})]]
|
107
|
+
}), TypeError, "The maximum cache duration is 30 days");
|
108
|
+
throws(() => kvCache({
|
109
|
+
kv,
|
110
|
+
loader: mockDocumentLoader,
|
111
|
+
rules: [[new URLPattern("https://example.com/*"), Temporal.Duration.from({
|
112
|
+
days: 30,
|
113
|
+
seconds: 1
|
114
|
+
})]]
|
115
|
+
}), TypeError, "The maximum cache duration is 30 days");
|
116
|
+
});
|
117
|
+
await t.step("on kv store exception", async () => {
|
118
|
+
class KvStoreThrowsException {
|
119
|
+
get(_key) {
|
120
|
+
throw new Error("Failed to get key");
|
121
|
+
}
|
122
|
+
set(_key, _value, _options) {
|
123
|
+
throw new Error("Failed to set key");
|
124
|
+
}
|
125
|
+
delete(_key) {
|
126
|
+
throw new Error("Failed to delete key");
|
127
|
+
}
|
128
|
+
}
|
129
|
+
const loader = kvCache({
|
130
|
+
kv: new KvStoreThrowsException(),
|
131
|
+
loader: mockDocumentLoader,
|
132
|
+
rules: [
|
133
|
+
["https://example.org/", Temporal.Duration.from({ days: 1 })],
|
134
|
+
[new URL("https://example.net/"), Temporal.Duration.from({ days: 1 })],
|
135
|
+
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
136
|
+
],
|
137
|
+
prefix: ["_test", "not cached"]
|
138
|
+
});
|
139
|
+
const result = await loader("https://example.com/object");
|
140
|
+
deepStrictEqual(result, {
|
141
|
+
contextUrl: null,
|
142
|
+
documentUrl: "https://example.com/object",
|
143
|
+
document: {
|
144
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
145
|
+
id: "https://example.com/object",
|
146
|
+
name: "Fetched object",
|
147
|
+
type: "Object"
|
148
|
+
}
|
149
|
+
});
|
150
|
+
});
|
151
|
+
await t.step("preloaded contexts bypass cache", async () => {
|
152
|
+
const kv$1 = new MockKvStore();
|
153
|
+
let loaderCalled = false;
|
154
|
+
const mockLoader = (url) => {
|
155
|
+
loaderCalled = true;
|
156
|
+
return Promise.resolve({
|
157
|
+
contextUrl: null,
|
158
|
+
documentUrl: url,
|
159
|
+
document: { "mock": "document" }
|
160
|
+
});
|
161
|
+
};
|
162
|
+
const loader = kvCache({
|
163
|
+
kv: kv$1,
|
164
|
+
loader: mockLoader,
|
165
|
+
prefix: ["_test", "preloaded"]
|
166
|
+
});
|
167
|
+
const activityStreamsUrl = "https://www.w3.org/ns/activitystreams";
|
168
|
+
loaderCalled = false;
|
169
|
+
const result = await loader(activityStreamsUrl);
|
170
|
+
deepStrictEqual(result, {
|
171
|
+
contextUrl: null,
|
172
|
+
documentUrl: activityStreamsUrl,
|
173
|
+
document: preloadedContexts[activityStreamsUrl]
|
174
|
+
});
|
175
|
+
deepStrictEqual(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
176
|
+
const cachedValue = await kv$1.get([
|
177
|
+
"_test",
|
178
|
+
"preloaded",
|
179
|
+
activityStreamsUrl
|
180
|
+
]);
|
181
|
+
deepStrictEqual(cachedValue, void 0, "Preloaded contexts should not be cached in KV store");
|
182
|
+
const securityUrl = "https://w3id.org/security/v1";
|
183
|
+
loaderCalled = false;
|
184
|
+
const result2 = await loader(securityUrl);
|
185
|
+
deepStrictEqual(result2, {
|
186
|
+
contextUrl: null,
|
187
|
+
documentUrl: securityUrl,
|
188
|
+
document: preloadedContexts[securityUrl]
|
189
|
+
});
|
190
|
+
deepStrictEqual(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
191
|
+
const nonPreloadedUrl = "https://example.com/not-preloaded";
|
192
|
+
loaderCalled = false;
|
193
|
+
const result3 = await loader(nonPreloadedUrl);
|
194
|
+
deepStrictEqual(result3, {
|
195
|
+
contextUrl: null,
|
196
|
+
documentUrl: nonPreloadedUrl,
|
197
|
+
document: { "mock": "document" }
|
198
|
+
});
|
199
|
+
deepStrictEqual(loaderCalled, true, "Loader should be called for non-preloaded URLs");
|
200
|
+
const cachedValue2 = await kv$1.get([
|
201
|
+
"_test",
|
202
|
+
"preloaded",
|
203
|
+
nonPreloadedUrl
|
204
|
+
]);
|
205
|
+
deepStrictEqual(cachedValue2, result3, "Non-preloaded URLs should be cached");
|
206
|
+
});
|
207
|
+
});
|
208
|
+
|
209
|
+
//#endregion
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
require('../lookup-CfFkONZD.cjs');
|
6
|
+
require('../actor-Ba9Z1eNJ.cjs');
|
7
|
+
require('../http-Dofes42e.cjs');
|
8
|
+
const require_kv_cache = require('../kv-cache-Dkvbn6rg.cjs');
|
9
|
+
require('../utils-DyRU1gdZ.cjs');
|
10
|
+
|
11
|
+
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
12
|
+
exports.kvCache = require_kv_cache.kvCache;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
3
|
+
import "../vocab-BCWe1Ih5.js";
|
4
|
+
import "../http-BbO0ejuk.js";
|
5
|
+
import "../kv-BKNZ-Tb-.js";
|
6
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-B9M-8jm2.js";
|
7
|
+
export { getAuthenticatedDocumentLoader, kvCache };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import "../lookup-CHkCVZTU.js";
|
6
|
+
import "../actor-DzhunPC_.js";
|
7
|
+
import "../http-CUVx-vzb.js";
|
8
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-CGXcDejL.js";
|
9
|
+
import "../utils-D-Va7aXC.js";
|
10
|
+
|
11
|
+
export { getAuthenticatedDocumentLoader, kvCache };
|
package/dist/vocab/actor.test.js
CHANGED
@@ -3,19 +3,17 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Application, Group, Organization, Person, Service, __export } from "../
|
6
|
+
import { Application, Group, Organization, Person, Service, __export } from "../lookup-DQRtjvb1.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
9
9
|
import "../assert_instance_of-DHz7EHNU.js";
|
10
|
-
import "../
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import "../
|
16
|
-
import "../
|
17
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
18
|
-
import { esm_default } from "../esm-CwHz8Y8t.js";
|
10
|
+
import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-BXHc5r-q.js";
|
11
|
+
import { test } from "../testing-g4UC4liW.js";
|
12
|
+
import { assertStrictEquals } from "../std__assert-DWivtrGR.js";
|
13
|
+
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
14
|
+
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
15
|
+
import "../assert_not_equals-C80BG-_5.js";
|
16
|
+
import { esm_default } from "../esm-C-Qa1zEM.js";
|
19
17
|
|
20
18
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
|
21
19
|
var PreconditionFailure = class PreconditionFailure extends Error {
|
@@ -3,18 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Collection, Note, Object as Object$1, Person } from "../
|
6
|
+
import { Collection, Note, Object as Object$1, Person, lookupObject, traverseCollection } from "../lookup-DQRtjvb1.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
8
|
import "../assert-MZs1qjMx.js";
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
10
|
-
import {
|
11
|
-
import
|
12
|
-
import "../
|
13
|
-
import
|
14
|
-
import "../
|
15
|
-
import "../
|
16
|
-
import "../assert_throws-BOO88avQ.js";
|
17
|
-
import { esm_default } from "../esm-CwHz8Y8t.js";
|
10
|
+
import { mockDocumentLoader, test } from "../testing-g4UC4liW.js";
|
11
|
+
import "../std__assert-DWivtrGR.js";
|
12
|
+
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
13
|
+
import "../assert_throws-BNXdRGWP.js";
|
14
|
+
import "../assert_not_equals-C80BG-_5.js";
|
15
|
+
import { esm_default } from "../esm-C-Qa1zEM.js";
|
18
16
|
|
19
17
|
//#region src/vocab/lookup.test.ts
|
20
18
|
test("lookupObject()", {
|
package/dist/vocab/mod.cjs
CHANGED
@@ -2,10 +2,9 @@
|
|
2
2
|
const { Temporal } = require("@js-temporal/polyfill");
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
4
4
|
|
5
|
-
require('../
|
6
|
-
const require_actor = require('../actor-
|
7
|
-
require('../
|
8
|
-
const require_vocab = require('../vocab-C5Y-0fGj.cjs');
|
5
|
+
require('../lookup-CfFkONZD.cjs');
|
6
|
+
const require_actor = require('../actor-Ba9Z1eNJ.cjs');
|
7
|
+
const require_vocab = require('../vocab-DFaWWYDn.cjs');
|
9
8
|
|
10
9
|
exports.Accept = require_actor.Accept;
|
11
10
|
exports.Activity = require_actor.Activity;
|
package/dist/vocab/mod.d.cts
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
import "../
|
2
|
-
import "../
|
3
|
-
import {
|
4
|
-
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-D6K058Tb.cjs";
|
5
|
-
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-CxkWO3Mg.cjs";
|
1
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View } from "../vocab-CeDBzu-f.cjs";
|
2
|
+
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-f2NtjyCg.cjs";
|
3
|
+
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-BxRCHTz-.cjs";
|
6
4
|
export { Accept, Activity, Actor, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, FediverseHandle, Flag, Follow, GetActorHandleOptions, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, LookupObjectOptions, Mention, Move, Multikey, NormalizeActorHandleOptions, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Recipient, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
|
package/dist/vocab/mod.d.ts
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import "../
|
4
|
-
import "../
|
5
|
-
import {
|
6
|
-
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-T6RyhRgk.js";
|
7
|
-
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-DlU8ISoa.js";
|
3
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View } from "../vocab-BCWe1Ih5.js";
|
4
|
+
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-DqFajh9s.js";
|
5
|
+
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-BlVovdcy.js";
|
8
6
|
export { Accept, Activity, Actor, ActorTypeName, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, FediverseHandle, Flag, Follow, GetActorHandleOptions, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, LookupObjectOptions, Mention, Move, Multikey, NormalizeActorHandleOptions, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Recipient, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, TraverseCollectionOptions, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
|
package/dist/vocab/mod.js
CHANGED
@@ -2,9 +2,8 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import "../
|
6
|
-
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-
|
7
|
-
import "../
|
8
|
-
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-rWbHpc2J.js";
|
5
|
+
import "../lookup-CHkCVZTU.js";
|
6
|
+
import { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object as Object$1, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, normalizeActorHandle } from "../actor-DzhunPC_.js";
|
7
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-BnR3nIU9.js";
|
9
8
|
|
10
9
|
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, PUBLIC_COLLECTION, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View, getActorClassByTypeName, getActorHandle, getActorTypeName, getTypeId, isActor, isFediverseHandle, lookupObject, normalizeActorHandle, parseFediverseHandle, toAcctUrl, traverseCollection };
|
package/dist/vocab/type.test.js
CHANGED
@@ -3,10 +3,9 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Person, getTypeId } from "../
|
6
|
+
import { Person, getTypeId } from "../lookup-DQRtjvb1.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
|
-
import "../
|
9
|
-
import { test } from "../testing-BnfPB5T-.js";
|
8
|
+
import { test } from "../testing-g4UC4liW.js";
|
10
9
|
|
11
10
|
//#region src/vocab/type.test.ts
|
12
11
|
test("getTypeId()", () => {
|
package/dist/vocab/vocab.test.js
CHANGED
@@ -3,19 +3,18 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag,
|
6
|
+
import { Activity, Announce, Collection, Create, CryptographicKey, Follow, Hashtag, Link, Note, Object as Object$1, OrderedCollectionPage, Person, Place, Question, Source, vocab_exports } from "../lookup-DQRtjvb1.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
|
-
import "../
|
11
|
-
import
|
12
|
-
import "../
|
13
|
-
import {
|
14
|
-
import "../
|
15
|
-
import {
|
16
|
-
import { assertThrows } from "../assert_throws-BOO88avQ.js";
|
17
|
-
import { ed25519PublicKey, rsaPublicKey1 } from "../keys-bZxcrZ9Z.js";
|
10
|
+
import { mockDocumentLoader, test } from "../testing-g4UC4liW.js";
|
11
|
+
import "../std__assert-DWivtrGR.js";
|
12
|
+
import { assertFalse, assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
13
|
+
import { assertThrows } from "../assert_throws-BNXdRGWP.js";
|
14
|
+
import { assertNotEquals } from "../assert_not_equals-C80BG-_5.js";
|
15
|
+
import { ed25519PublicKey, rsaPublicKey1 } from "../keys-DMHs8XNn.js";
|
18
16
|
import { pascalCase } from "es-toolkit";
|
17
|
+
import { LanguageString, decodeMultibase } from "@fedify/vocab-runtime";
|
19
18
|
import { Validator } from "@cfworker/json-schema";
|
20
19
|
import { readFile, readdir } from "node:fs/promises";
|
21
20
|
import { join } from "node:path";
|
@@ -2734,7 +2733,7 @@ test("Activity.fromJsonLd()", async () => {
|
|
2734
2733
|
assertEquals(proofs[0].cryptosuite, "eddsa-jcs-2022");
|
2735
2734
|
assertEquals(proofs[0].verificationMethodId, new URL("https://server.example/users/alice#ed25519-key"));
|
2736
2735
|
assertEquals(proofs[0].proofPurpose, "assertionMethod");
|
2737
|
-
assertEquals(proofs[0].proofValue,
|
2736
|
+
assertEquals(proofs[0].proofValue, decodeMultibase("z3sXaxjKs4M3BRicwWA9peyNPJvJqxtGsDmpt1jjoHCjgeUf71TRFz56osPSfDErszyLp5Ks1EhYSgpDaNM977Rg2"));
|
2738
2737
|
assertEquals(proofs[0].created, Temporal.Instant.from("2023-02-24T23:36:38Z"));
|
2739
2738
|
});
|
2740
2739
|
test({
|
@@ -1,27 +1,8 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import { DocumentLoader } from "./docloader-CxWcuWqQ.js";
|
4
3
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
4
|
+
import { DocumentLoader, LanguageString } from "@fedify/vocab-runtime";
|
5
5
|
|
6
|
-
//#region src/runtime/langstr.d.ts
|
7
|
-
/**
|
8
|
-
* A language-tagged string which corresponds to the `rdf:langString` type.
|
9
|
-
*/
|
10
|
-
declare class LanguageString extends String {
|
11
|
-
/**
|
12
|
-
* The locale of the string.
|
13
|
-
* @since 2.0.0
|
14
|
-
*/
|
15
|
-
readonly locale: Intl.Locale;
|
16
|
-
/**
|
17
|
-
* Constructs a new `LanguageString`.
|
18
|
-
* @param value A string value written in the given language.
|
19
|
-
* @param locale The language of the string. If a string is given, it will
|
20
|
-
* be parsed as a `Intl.Locale` object.
|
21
|
-
*/
|
22
|
-
constructor(value: string, language: Intl.Locale | string);
|
23
|
-
}
|
24
|
-
//#endregion
|
25
6
|
//#region src/vocab/vocab.d.ts
|
26
7
|
/** Describes an object of any kind. The Object type serves as the base type for
|
27
8
|
* most of the other kinds of objects defined in the Activity Vocabulary,
|
@@ -14921,4 +14902,4 @@ declare class View extends Activity {
|
|
14921
14902
|
protected _getCustomInspectProxy(): Record<string, unknown>;
|
14922
14903
|
}
|
14923
14904
|
//#endregion
|
14924
|
-
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join,
|
14905
|
+
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View };
|
@@ -2,11 +2,11 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { deno_default,
|
6
|
-
import { Object as Object$1, getTypeId } from "./actor-
|
7
|
-
import { lookupWebFinger } from "./lookup-cVRa2QM-.js";
|
5
|
+
import { deno_default, lookupWebFinger } from "./lookup-CHkCVZTU.js";
|
6
|
+
import { Object as Object$1, getTypeId } from "./actor-DzhunPC_.js";
|
8
7
|
import { getLogger } from "@logtape/logtape";
|
9
8
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
9
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
10
10
|
import { delay } from "es-toolkit";
|
11
11
|
|
12
12
|
//#region src/vocab/handle.ts
|
@@ -1,25 +1,6 @@
|
|
1
|
-
import { DocumentLoader } from "
|
1
|
+
import { DocumentLoader, LanguageString } from "@fedify/vocab-runtime";
|
2
2
|
import { Span, TracerProvider } from "@opentelemetry/api";
|
3
3
|
|
4
|
-
//#region src/runtime/langstr.d.ts
|
5
|
-
/**
|
6
|
-
* A language-tagged string which corresponds to the `rdf:langString` type.
|
7
|
-
*/
|
8
|
-
declare class LanguageString extends String {
|
9
|
-
/**
|
10
|
-
* The locale of the string.
|
11
|
-
* @since 2.0.0
|
12
|
-
*/
|
13
|
-
readonly locale: Intl.Locale;
|
14
|
-
/**
|
15
|
-
* Constructs a new `LanguageString`.
|
16
|
-
* @param value A string value written in the given language.
|
17
|
-
* @param locale The language of the string. If a string is given, it will
|
18
|
-
* be parsed as a `Intl.Locale` object.
|
19
|
-
*/
|
20
|
-
constructor(value: string, language: Intl.Locale | string);
|
21
|
-
}
|
22
|
-
//#endregion
|
23
4
|
//#region src/vocab/vocab.d.ts
|
24
5
|
/** Describes an object of any kind. The Object type serves as the base type for
|
25
6
|
* most of the other kinds of objects defined in the Activity Vocabulary,
|
@@ -14919,4 +14900,4 @@ declare class View extends Activity {
|
|
14919
14900
|
protected _getCustomInspectProxy(): Record<string, unknown>;
|
14920
14901
|
}
|
14921
14902
|
//#endregion
|
14922
|
-
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join,
|
14903
|
+
export { Accept, Activity, Add, Announce, Application, Arrive, Article, Audio, Block, ChatMessage, Collection, CollectionPage, Create, CryptographicKey, DataIntegrityProof, Delete, DidService, Dislike, Document, Emoji, EmojiReact, Endpoints, Event, Export, Flag, Follow, Group, Hashtag, Ignore, Image, IntransitiveActivity, Invite, Join, Leave, Like, Link, Listen, Mention, Move, Multikey, Note, Object$1 as Object, Offer, OrderedCollection, OrderedCollectionPage, Organization, Page, Person, Place, Profile, PropertyValue, Question, Read, Reject, Relationship, Remove, Service, Source, TentativeAccept, TentativeReject, Tombstone, Travel, Undo, Update, Video, View };
|
@@ -3,11 +3,11 @@
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
4
4
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
|
-
const
|
7
|
-
const require_actor = require('./actor-
|
8
|
-
const require_lookup = require('./lookup-DiV4LFBg.cjs');
|
6
|
+
const require_lookup = require('./lookup-CfFkONZD.cjs');
|
7
|
+
const require_actor = require('./actor-Ba9Z1eNJ.cjs');
|
9
8
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
10
9
|
const __opentelemetry_api = require_chunk.__toESM(require("@opentelemetry/api"));
|
10
|
+
const __fedify_vocab_runtime = require_chunk.__toESM(require("@fedify/vocab-runtime"));
|
11
11
|
const es_toolkit = require_chunk.__toESM(require("es-toolkit"));
|
12
12
|
|
13
13
|
//#region src/vocab/handle.ts
|
@@ -128,7 +128,7 @@ const logger = (0, __logtape_logtape.getLogger)([
|
|
128
128
|
*/
|
129
129
|
async function lookupObject(identifier, options = {}) {
|
130
130
|
const tracerProvider = options.tracerProvider ?? __opentelemetry_api.trace.getTracerProvider();
|
131
|
-
const tracer = tracerProvider.getTracer(
|
131
|
+
const tracer = tracerProvider.getTracer(require_lookup.deno_default.name, require_lookup.deno_default.version);
|
132
132
|
return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => {
|
133
133
|
try {
|
134
134
|
const result = await lookupObjectInternal(identifier, options);
|
@@ -151,7 +151,7 @@ async function lookupObject(identifier, options = {}) {
|
|
151
151
|
});
|
152
152
|
}
|
153
153
|
async function lookupObjectInternal(identifier, options = {}) {
|
154
|
-
const documentLoader = options.documentLoader ??
|
154
|
+
const documentLoader = options.documentLoader ?? (0, __fedify_vocab_runtime.getDocumentLoader)({ userAgent: options.userAgent });
|
155
155
|
if (typeof identifier === "string") identifier = toAcctUrl(identifier) ?? new URL(identifier);
|
156
156
|
let remoteDoc = null;
|
157
157
|
if (identifier.protocol === "http:" || identifier.protocol === "https:") try {
|
@@ -3,35 +3,34 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { Image, Link, Person } from "../
|
6
|
+
import { Image, Link, Person } from "../lookup-DQRtjvb1.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 { createFederation, handleWebFinger } from "../middleware-
|
12
|
-
import "../client-
|
13
|
-
import "../
|
14
|
-
import "../
|
15
|
-
import "../
|
16
|
-
import "../
|
17
|
-
import "../
|
18
|
-
import "../
|
19
|
-
import "../
|
20
|
-
import "../
|
21
|
-
import "../
|
22
|
-
import "../inbox-
|
23
|
-
import "../builder-
|
24
|
-
import "../collection-
|
25
|
-
import "../keycache-
|
26
|
-
import "../negotiation-
|
27
|
-
import "../retry-
|
28
|
-
import "../send-
|
29
|
-
import { createRequestContext, test } from "../testing-
|
30
|
-
import "../std__assert-
|
31
|
-
import "../assert_rejects-
|
32
|
-
import "../
|
33
|
-
import "../assert_not_equals-
|
34
|
-
import "../assert_throws-BOO88avQ.js";
|
11
|
+
import { createFederation, handleWebFinger } from "../middleware-CJlj5Olw.js";
|
12
|
+
import "../client-pY7-3icS.js";
|
13
|
+
import "../types-C2XVl6gj.js";
|
14
|
+
import "../actor-BXHc5r-q.js";
|
15
|
+
import "../key-CxdLUFS6.js";
|
16
|
+
import "../http-D2kIm9la.js";
|
17
|
+
import "../ld-CIhvSCCr.js";
|
18
|
+
import "../owner-Dvh7mBvr.js";
|
19
|
+
import "../proof-Dgy35fzc.js";
|
20
|
+
import "../docloader-CrbAy9Oc.js";
|
21
|
+
import "../kv-cache-DN9pfMBe.js";
|
22
|
+
import "../inbox-HjG5peXY.js";
|
23
|
+
import "../builder-u7usRsT3.js";
|
24
|
+
import "../collection-BzWsN9pB.js";
|
25
|
+
import "../keycache-bU7COwsh.js";
|
26
|
+
import "../negotiation-C4nFufNk.js";
|
27
|
+
import "../retry-CfF8Gn4d.js";
|
28
|
+
import "../send-Drp20VO9.js";
|
29
|
+
import { createRequestContext, test } from "../testing-g4UC4liW.js";
|
30
|
+
import "../std__assert-DWivtrGR.js";
|
31
|
+
import "../assert_rejects-Ce45JcFg.js";
|
32
|
+
import "../assert_throws-BNXdRGWP.js";
|
33
|
+
import "../assert_not_equals-C80BG-_5.js";
|
35
34
|
|
36
35
|
//#region src/webfinger/handler.test.ts
|
37
36
|
test("handleWebFinger()", async (t) => {
|
@@ -3,18 +3,16 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { lookupWebFinger } from "../
|
6
|
+
import { lookupWebFinger } from "../lookup-DQRtjvb1.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
|
-
import "../
|
11
|
-
import
|
12
|
-
import "../
|
13
|
-
import "../
|
14
|
-
import "../
|
15
|
-
import "../
|
16
|
-
import "../assert_throws-BOO88avQ.js";
|
17
|
-
import { esm_default } from "../esm-CwHz8Y8t.js";
|
10
|
+
import { test } from "../testing-g4UC4liW.js";
|
11
|
+
import "../std__assert-DWivtrGR.js";
|
12
|
+
import "../assert_rejects-Ce45JcFg.js";
|
13
|
+
import "../assert_throws-BNXdRGWP.js";
|
14
|
+
import "../assert_not_equals-C80BG-_5.js";
|
15
|
+
import { esm_default } from "../esm-C-Qa1zEM.js";
|
18
16
|
import { withTimeout } from "es-toolkit";
|
19
17
|
|
20
18
|
//#region src/webfinger/lookup.test.ts
|