@fedify/fedify 2.0.0-pr.449.1725 → 2.0.0-pr.451.1731
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-C0gLJq8I.js → actor-CRQwUlsr.js} +190 -677
- package/dist/{actor-T6RyhRgk.d.ts → actor-Cd2CREO0.d.ts} +2 -2
- package/dist/{actor-CsRJa7wV.cjs → actor-Ci-5y3ml.cjs} +922 -1451
- package/dist/{actor-D6K058Tb.d.cts → actor-DDhZuMGl.d.cts} +2 -2
- package/dist/{actor-VrXd7EdX.js → actor-GwnlqPRv.js} +1 -1
- 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-JjsppXTK.js → builder-BflZmL4k.js} +3 -4
- package/dist/{client-bgSdkFa2.d.ts → client-Bkaw0_PR.d.ts} +1 -1
- package/dist/{client-CegPX0Rn.d.cts → client-Cle5j1T1.d.cts} +1 -1
- package/dist/{client-BS-GE3XI.js → client-DylapB-t.js} +1 -1
- package/dist/compat/mod.d.cts +11 -11
- package/dist/compat/mod.d.ts +12 -12
- package/dist/compat/transformers.test.js +20 -20
- package/dist/{context-DYCJXr7J.d.cts → context-BOYzcFSe.d.cts} +10 -10
- package/dist/{context-B1X8-X33.d.ts → context-DqFifMwj.d.ts} +11 -11
- package/dist/{authdocloader-C8LXxsmU.js → docloader-BpcE9hBI.js} +18 -8
- package/dist/{esm-CvUgdJZ_.js → esm-DjbC-dsH.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 +26 -27
- package/dist/federation/mod.cjs +10 -11
- package/dist/federation/mod.d.cts +10 -10
- package/dist/federation/mod.d.ts +12 -12
- package/dist/federation/mod.js +10 -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-D-e6AFwR.d.cts → http-B6SKO6NJ.d.cts} +2 -2
- package/dist/{http-D6Uj2x2y.d.ts → http-BE7aFuqn.d.ts} +2 -2
- package/dist/{http-DVQEn98K.js → http-BzsavjR2.js} +256 -6
- package/dist/{http-DbyMqL2X.js → http-CCUJdi0H.js} +2 -2
- package/dist/{http-D_BI5KHC.cjs → http-DtUGyvkU.cjs} +289 -9
- package/dist/{inbox-DQlf_-Dz.js → inbox-DizLjfhC.js} +1 -1
- package/dist/{key-BSJX6n9o.js → key-De1MJH3k.js} +3 -2
- package/dist/{keycache-CcIfdj0m.js → keycache-D2HiBv4F.js} +1 -1
- package/dist/{keys-DnSaJmvD.js → keys-B4ZjS1Ot.js} +2 -1
- package/dist/{docloader-BdF5STdg.cjs → kv-cache-3VK2-wq_.cjs} +69 -651
- package/dist/kv-cache-DNvS-egZ.js +4236 -0
- package/dist/{docloader-AMdJU291.js → kv-cache-rR-Cnl95.js} +68 -596
- package/dist/{ld-CAJ6Q2od.js → ld-Dux3_Cw2.js} +3 -2
- package/dist/{type-COb6KNlm.js → lookup-Bep-EOgr.js} +588 -5303
- package/dist/{lookup-B2Bsau2g.cjs → lookup-BmGuy-Ps.cjs} +78 -5
- package/dist/{lookup-BGCuyJRy.js → lookup-Bql--V-C.js} +63 -2
- package/dist/{middleware-1oxZY_0z.js → middleware-BBTmHKGh.js} +11 -11
- package/dist/middleware-BUZSGsQH.js +16 -0
- package/dist/middleware-BusTq7Js.cjs +16 -0
- package/dist/{middleware-BDqkoMAQ.js → middleware-D7tP9Tq6.js} +18 -17
- package/dist/{middleware-D0XMPoN8.cjs → middleware-DrpnHeGO.cjs} +31 -31
- package/dist/middleware-tZdLtCWz.js +26 -0
- package/dist/{mod-CxkWO3Mg.d.cts → mod--K7l84wp.d.cts} +3 -2
- package/dist/{mod-DBzN0aCM.d.ts → mod-CB80AlIA.d.ts} +1 -1
- package/dist/mod-CLKu6Uo_.d.cts +107 -0
- package/dist/{mod-Djzcw2ry.d.cts → mod-COlOrmr9.d.cts} +3 -3
- package/dist/{mod-DlU8ISoa.d.ts → mod-CRENK2dd.d.ts} +3 -2
- package/dist/{mod-DcKxhFQ8.d.ts → mod-CaWbCg0N.d.ts} +2 -2
- package/dist/mod-Cm97bAiT.d.ts +109 -0
- package/dist/{mod-twdvV2hR.d.cts → mod-D9XZsft2.d.cts} +2 -2
- package/dist/{mod-BhUKmBJD.d.ts → mod-DLIidI_j.d.ts} +3 -3
- package/dist/{mod-jQ4OODsl.d.cts → mod-DuclhZjh.d.cts} +1 -1
- package/dist/mod.cjs +21 -32
- package/dist/mod.d.cts +14 -14
- package/dist/mod.d.ts +17 -17
- package/dist/mod.js +15 -16
- package/dist/nodeinfo/client.test.js +8 -10
- package/dist/nodeinfo/handler.test.js +24 -25
- package/dist/nodeinfo/mod.cjs +3 -3
- package/dist/nodeinfo/mod.d.cts +2 -3
- package/dist/nodeinfo/mod.d.ts +3 -4
- package/dist/nodeinfo/mod.js +3 -3
- package/dist/nodeinfo/types.test.js +7 -9
- package/dist/{owner-hd9lvQcP.d.ts → owner-CktUdA0h.d.ts} +3 -3
- package/dist/{owner-CaIfLBwg.js → owner-Zq8du9WO.js} +3 -2
- package/dist/{owner-BN_tO3cY.d.cts → owner-dkg5OpSC.d.cts} +3 -3
- package/dist/{proof-AhyVJcNZ.cjs → proof-0PY1LDZY.cjs} +17 -16
- package/dist/{proof-BQwXHakc.js → proof-C5S_3hdJ.js} +2 -2
- package/dist/{proof-CKXppjee.js → proof-aIlK5BTc.js} +5 -4
- package/dist/request-BbHkedIU.d.cts +35 -0
- package/dist/request-Bc5CHBqO.cjs +208 -0
- package/dist/request-C0Ags1gQ.js +184 -0
- package/dist/request-U1t6zZtk.d.ts +39 -0
- package/dist/{send-DQd3R1Oc.js → send-BbVnlsQO.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 +10 -11
- package/dist/sig/mod.d.cts +6 -7
- package/dist/sig/mod.d.ts +6 -7
- package/dist/sig/mod.js +6 -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 +3 -62
- package/dist/testing/mod.js +2 -3
- package/dist/{testing-BljKU-GG.js → testing-BkidWE0N.js} +1 -2
- package/dist/{types-DI0yutHB.cjs → types-BDNYgodm.cjs} +3 -3
- package/dist/{types-CEn4wB51.js → types-CXnyjUdK.js} +1 -1
- package/dist/{runtime/authdocloader.test.js → utils/docloader.test.js} +13 -15
- package/dist/utils/kv-cache.test.js +208 -0
- package/dist/utils/mod.cjs +14 -0
- package/dist/utils/mod.d.cts +6 -0
- package/dist/utils/mod.d.ts +8 -0
- package/dist/utils/mod.js +12 -0
- package/dist/utils/request.test.js +48 -0
- package/dist/utils/url.test.js +41 -0
- package/dist/vocab/actor.test.js +8 -10
- package/dist/vocab/lookup.test.js +7 -9
- package/dist/vocab/mod.cjs +4 -4
- package/dist/vocab/mod.d.cts +4 -5
- package/dist/vocab/mod.d.ts +4 -5
- package/dist/vocab/mod.js +4 -4
- package/dist/vocab/type.test.js +2 -3
- package/dist/vocab/vocab.test.js +9 -10
- package/dist/{vocab-CkWH9P5l.js → vocab-BiKK7m2H.js} +4 -3
- package/dist/{vocab-Dw1-yVGg.d.cts → vocab-DCBw44JZ.d.cts} +2 -21
- package/dist/{vocab-NZXL5Pr-.cjs → vocab-Dapemq3v.cjs} +6 -5
- package/dist/{vocab-BI0Ak5lL.d.ts → vocab-ivDKb439.d.ts} +2 -21
- package/dist/webfinger/handler.test.js +24 -25
- package/dist/webfinger/lookup.test.js +7 -9
- package/dist/webfinger/mod.cjs +3 -3
- package/dist/webfinger/mod.d.cts +2 -3
- package/dist/webfinger/mod.d.ts +2 -3
- package/dist/webfinger/mod.js +3 -3
- package/dist/x/cfworkers.d.cts +1 -1
- package/dist/x/cfworkers.d.ts +2 -2
- package/dist/x/cfworkers.test.js +6 -8
- package/dist/x/hono.d.cts +10 -10
- package/dist/x/hono.d.ts +11 -11
- package/dist/x/sveltekit.d.cts +10 -10
- package/dist/x/sveltekit.d.ts +11 -11
- package/package.json +16 -14
- package/dist/assert_throws-BOO88avQ.js +0 -39
- package/dist/authdocloader-6F9IP-VO.js +0 -52
- package/dist/authdocloader-BkuVo8LL.cjs +0 -58
- package/dist/docloader-CxWcuWqQ.d.ts +0 -221
- package/dist/docloader-D-MrRyHl.d.cts +0 -219
- package/dist/key-BBzfhQGE.js +0 -10
- package/dist/key-BMz_uAnc.cjs +0 -10
- package/dist/key-D-RgWfcf.cjs +0 -290
- package/dist/key-DFefr8X2.js +0 -260
- package/dist/key-DW2DrPGl.js +0 -10
- package/dist/lookup-C3pnuyiD.js +0 -331
- package/dist/middleware-B8WWe8Q2.js +0 -26
- package/dist/middleware-DipQbJmB.js +0 -17
- package/dist/middleware-mLaQeD_Z.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.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.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-DOuZpcAw.cjs} +0 -0
- /package/dist/{federation-D1U8YY9t.js → federation-pZJsapBn.js} +0 -0
- /package/dist/{kv-63Cil1MD.d.cts → kv-BMKIFXNW.d.cts} +0 -0
- /package/dist/{kv-C7sopW2E.d.ts → kv-Dt06smFt.d.ts} +0 -0
- /package/dist/{mod-1pDWKvUL.d.ts → mod-B-ZQqbGe.d.ts} +0 -0
- /package/dist/{mod-g0xFzAP9.d.ts → mod-CjsiSl7_.d.ts} +0 -0
- /package/dist/{mq-CRGm1e_F.d.ts → mq-CPRJk4mZ.d.ts} +0 -0
- /package/dist/{negotiation-5NPJL6zp.js → negotiation-C4nFufNk.js} +0 -0
- /package/dist/{nodeinfo-DfycQ8Wf.js → nodeinfo-B0UefMXO.js} +0 -0
- /package/dist/{nodeinfo-Co9lJrWl.cjs → nodeinfo-ByTd7HpT.cjs} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-CfF8Gn4d.js} +0 -0
- /package/dist/{runtime-C58AJWSv.cjs → sig-DE_NC_VQ.cjs} +0 -0
- /package/dist/{runtime-DPYEDf-o.js → sig-Dx59zAgn.js} +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/{runtime/key.test.d.ts → utils/request.test.d.ts} +0 -0
- /package/dist/{runtime → utils}/url.test.d.ts +0 -0
- /package/dist/{sig-ByHXzqUi.cjs → utils-B6yXfxAQ.cjs} +0 -0
- /package/dist/{sig-Cj3tk-ig.js → utils-BXMGcmqK.js} +0 -0
- /package/dist/{webfinger-BjOEdFPs.cjs → webfinger-C949bxcD.cjs} +0 -0
- /package/dist/{webfinger-De_bU0iE.js → webfinger-qG8R5jc3.js} +0 -0
@@ -3,7 +3,7 @@
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
4
4
|
|
5
5
|
const require_chunk = require('./chunk-DqRYRqnO.cjs');
|
6
|
-
const
|
6
|
+
const require_request = require('./request-Bc5CHBqO.cjs');
|
7
7
|
const __logtape_logtape = require_chunk.__toESM(require("@logtape/logtape"));
|
8
8
|
|
9
9
|
//#region src/nodeinfo/client.ts
|
@@ -19,7 +19,7 @@ async function getNodeInfo(url, options = {}) {
|
|
19
19
|
const wellKnownUrl = new URL("/.well-known/nodeinfo", url);
|
20
20
|
const wellKnownResponse = await fetch(wellKnownUrl, { headers: {
|
21
21
|
Accept: "application/json",
|
22
|
-
"User-Agent": typeof options.userAgent === "string" ? options.userAgent :
|
22
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : require_request.getUserAgent(options.userAgent)
|
23
23
|
} });
|
24
24
|
if (!wellKnownResponse.ok) {
|
25
25
|
logger.error("Failed to fetch {url}: {status} {statusText}", {
|
@@ -42,7 +42,7 @@ async function getNodeInfo(url, options = {}) {
|
|
42
42
|
}
|
43
43
|
const response = await fetch(nodeInfoUrl, { headers: {
|
44
44
|
Accept: "application/json",
|
45
|
-
"User-Agent": typeof options.userAgent === "string" ? options.userAgent :
|
45
|
+
"User-Agent": typeof options.userAgent === "string" ? options.userAgent : require_request.getUserAgent(options.userAgent)
|
46
46
|
} });
|
47
47
|
if (!response.ok) {
|
48
48
|
logger.error("Failed to fetch NodeInfo document from {url}: {status} {statusText}", {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
-
import { getUserAgent } from "./
|
5
|
+
import { getUserAgent } from "./request-C0Ags1gQ.js";
|
6
6
|
import { getLogger } from "@logtape/logtape";
|
7
7
|
|
8
8
|
//#region src/nodeinfo/client.ts
|
@@ -3,25 +3,23 @@
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
globalThis.addEventListener = () => {};
|
5
5
|
|
6
|
-
import { UrlError } from "../
|
6
|
+
import { UrlError } from "../lookup-Bep-EOgr.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 "../
|
17
|
-
import
|
18
|
-
import "../
|
19
|
-
import "../
|
20
|
-
import "../
|
21
|
-
import { rsaPrivateKey2 } from "../keys-DnSaJmvD.js";
|
22
|
-
import { esm_default } from "../esm-CvUgdJZ_.js";
|
10
|
+
import "../actor-GwnlqPRv.js";
|
11
|
+
import "../key-De1MJH3k.js";
|
12
|
+
import { verifyRequest } from "../http-CCUJdi0H.js";
|
13
|
+
import { getAuthenticatedDocumentLoader } from "../docloader-BpcE9hBI.js";
|
14
|
+
import { mockDocumentLoader, test } from "../testing-BkidWE0N.js";
|
15
|
+
import "../std__assert-DWivtrGR.js";
|
16
|
+
import { assertRejects } from "../assert_rejects-Ce45JcFg.js";
|
17
|
+
import "../assert_throws-BNXdRGWP.js";
|
18
|
+
import "../assert_not_equals-C80BG-_5.js";
|
19
|
+
import { rsaPrivateKey2 } from "../keys-B4ZjS1Ot.js";
|
20
|
+
import { esm_default } from "../esm-DjbC-dsH.js";
|
23
21
|
|
24
|
-
//#region src/
|
22
|
+
//#region src/utils/docloader.test.ts
|
25
23
|
test("getAuthenticatedDocumentLoader()", async (t) => {
|
26
24
|
esm_default.spyGlobal();
|
27
25
|
esm_default.get("begin:https://example.com/object", async (cl) => {
|
@@ -0,0 +1,208 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import "../lookup-Bep-EOgr.js";
|
7
|
+
import { MockKvStore, kvCache, preloadedContexts } from "../kv-cache-DNvS-egZ.js";
|
8
|
+
import { mockDocumentLoader, test } from "../testing-BkidWE0N.js";
|
9
|
+
import { deepStrictEqual, throws } from "node:assert";
|
10
|
+
|
11
|
+
//#region src/utils/kv-cache.test.ts
|
12
|
+
test("kvCache()", async (t) => {
|
13
|
+
const kv = new MockKvStore();
|
14
|
+
await t.step("cached", async () => {
|
15
|
+
const loader = kvCache({
|
16
|
+
kv,
|
17
|
+
loader: mockDocumentLoader,
|
18
|
+
rules: [
|
19
|
+
["https://example.org/", Temporal.Duration.from({ days: 1 })],
|
20
|
+
[new URL("https://example.net/"), Temporal.Duration.from({ days: 1 })],
|
21
|
+
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
22
|
+
],
|
23
|
+
prefix: ["_test", "cached"]
|
24
|
+
});
|
25
|
+
const result = await loader("https://example.com/object");
|
26
|
+
deepStrictEqual(result, {
|
27
|
+
contextUrl: null,
|
28
|
+
documentUrl: "https://example.com/object",
|
29
|
+
document: {
|
30
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
31
|
+
id: "https://example.com/object",
|
32
|
+
name: "Fetched object",
|
33
|
+
type: "Object"
|
34
|
+
}
|
35
|
+
});
|
36
|
+
const cache = await kv.get([
|
37
|
+
"_test",
|
38
|
+
"cached",
|
39
|
+
"https://example.com/object"
|
40
|
+
]);
|
41
|
+
deepStrictEqual(cache, result);
|
42
|
+
await kv.set([
|
43
|
+
"_test",
|
44
|
+
"cached",
|
45
|
+
"https://example.org/"
|
46
|
+
], {
|
47
|
+
contextUrl: null,
|
48
|
+
documentUrl: "https://example.org/",
|
49
|
+
document: { "id": "https://example.org/" }
|
50
|
+
});
|
51
|
+
const result2 = await loader("https://example.org/");
|
52
|
+
deepStrictEqual(result2, {
|
53
|
+
contextUrl: null,
|
54
|
+
documentUrl: "https://example.org/",
|
55
|
+
document: { "id": "https://example.org/" }
|
56
|
+
});
|
57
|
+
await kv.set([
|
58
|
+
"_test",
|
59
|
+
"cached",
|
60
|
+
"https://example.net/"
|
61
|
+
], {
|
62
|
+
contextUrl: null,
|
63
|
+
documentUrl: "https://example.net/",
|
64
|
+
document: { "id": "https://example.net/" }
|
65
|
+
});
|
66
|
+
const result3 = await loader("https://example.net/");
|
67
|
+
deepStrictEqual(result3, {
|
68
|
+
contextUrl: null,
|
69
|
+
documentUrl: "https://example.net/",
|
70
|
+
document: { "id": "https://example.net/" }
|
71
|
+
});
|
72
|
+
});
|
73
|
+
await t.step("not cached", async () => {
|
74
|
+
const loader = kvCache({
|
75
|
+
kv,
|
76
|
+
loader: mockDocumentLoader,
|
77
|
+
rules: [],
|
78
|
+
prefix: ["_test", "not cached"]
|
79
|
+
});
|
80
|
+
const result = await loader("https://example.com/object");
|
81
|
+
deepStrictEqual(result, {
|
82
|
+
contextUrl: null,
|
83
|
+
documentUrl: "https://example.com/object",
|
84
|
+
document: {
|
85
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
86
|
+
id: "https://example.com/object",
|
87
|
+
name: "Fetched object",
|
88
|
+
type: "Object"
|
89
|
+
}
|
90
|
+
});
|
91
|
+
const cache = await kv.get([
|
92
|
+
"test2",
|
93
|
+
"not cached",
|
94
|
+
"https://example.com/object"
|
95
|
+
]);
|
96
|
+
deepStrictEqual(cache, void 0);
|
97
|
+
});
|
98
|
+
await t.step("maximum cache duration", () => {
|
99
|
+
throws(() => kvCache({
|
100
|
+
kv,
|
101
|
+
loader: mockDocumentLoader,
|
102
|
+
rules: [["https://example.com/", Temporal.Duration.from({
|
103
|
+
days: 30,
|
104
|
+
seconds: 1
|
105
|
+
})]]
|
106
|
+
}), TypeError, "The maximum cache duration is 30 days");
|
107
|
+
throws(() => kvCache({
|
108
|
+
kv,
|
109
|
+
loader: mockDocumentLoader,
|
110
|
+
rules: [[new URLPattern("https://example.com/*"), Temporal.Duration.from({
|
111
|
+
days: 30,
|
112
|
+
seconds: 1
|
113
|
+
})]]
|
114
|
+
}), TypeError, "The maximum cache duration is 30 days");
|
115
|
+
});
|
116
|
+
await t.step("on kv store exception", async () => {
|
117
|
+
class KvStoreThrowsException {
|
118
|
+
get(_key) {
|
119
|
+
throw new Error("Failed to get key");
|
120
|
+
}
|
121
|
+
set(_key, _value, _options) {
|
122
|
+
throw new Error("Failed to set key");
|
123
|
+
}
|
124
|
+
delete(_key) {
|
125
|
+
throw new Error("Failed to delete key");
|
126
|
+
}
|
127
|
+
}
|
128
|
+
const loader = kvCache({
|
129
|
+
kv: new KvStoreThrowsException(),
|
130
|
+
loader: mockDocumentLoader,
|
131
|
+
rules: [
|
132
|
+
["https://example.org/", Temporal.Duration.from({ days: 1 })],
|
133
|
+
[new URL("https://example.net/"), Temporal.Duration.from({ days: 1 })],
|
134
|
+
[new URLPattern("https://example.com/*"), Temporal.Duration.from({ days: 30 })]
|
135
|
+
],
|
136
|
+
prefix: ["_test", "not cached"]
|
137
|
+
});
|
138
|
+
const result = await loader("https://example.com/object");
|
139
|
+
deepStrictEqual(result, {
|
140
|
+
contextUrl: null,
|
141
|
+
documentUrl: "https://example.com/object",
|
142
|
+
document: {
|
143
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
144
|
+
id: "https://example.com/object",
|
145
|
+
name: "Fetched object",
|
146
|
+
type: "Object"
|
147
|
+
}
|
148
|
+
});
|
149
|
+
});
|
150
|
+
await t.step("preloaded contexts bypass cache", async () => {
|
151
|
+
const kv$1 = new MockKvStore();
|
152
|
+
let loaderCalled = false;
|
153
|
+
const mockLoader = (url) => {
|
154
|
+
loaderCalled = true;
|
155
|
+
return Promise.resolve({
|
156
|
+
contextUrl: null,
|
157
|
+
documentUrl: url,
|
158
|
+
document: { "mock": "document" }
|
159
|
+
});
|
160
|
+
};
|
161
|
+
const loader = kvCache({
|
162
|
+
kv: kv$1,
|
163
|
+
loader: mockLoader,
|
164
|
+
prefix: ["_test", "preloaded"]
|
165
|
+
});
|
166
|
+
const activityStreamsUrl = "https://www.w3.org/ns/activitystreams";
|
167
|
+
loaderCalled = false;
|
168
|
+
const result = await loader(activityStreamsUrl);
|
169
|
+
deepStrictEqual(result, {
|
170
|
+
contextUrl: null,
|
171
|
+
documentUrl: activityStreamsUrl,
|
172
|
+
document: preloadedContexts[activityStreamsUrl]
|
173
|
+
});
|
174
|
+
deepStrictEqual(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
175
|
+
const cachedValue = await kv$1.get([
|
176
|
+
"_test",
|
177
|
+
"preloaded",
|
178
|
+
activityStreamsUrl
|
179
|
+
]);
|
180
|
+
deepStrictEqual(cachedValue, void 0, "Preloaded contexts should not be cached in KV store");
|
181
|
+
const securityUrl = "https://w3id.org/security/v1";
|
182
|
+
loaderCalled = false;
|
183
|
+
const result2 = await loader(securityUrl);
|
184
|
+
deepStrictEqual(result2, {
|
185
|
+
contextUrl: null,
|
186
|
+
documentUrl: securityUrl,
|
187
|
+
document: preloadedContexts[securityUrl]
|
188
|
+
});
|
189
|
+
deepStrictEqual(loaderCalled, false, "Loader should not be called for preloaded contexts");
|
190
|
+
const nonPreloadedUrl = "https://example.com/not-preloaded";
|
191
|
+
loaderCalled = false;
|
192
|
+
const result3 = await loader(nonPreloadedUrl);
|
193
|
+
deepStrictEqual(result3, {
|
194
|
+
contextUrl: null,
|
195
|
+
documentUrl: nonPreloadedUrl,
|
196
|
+
document: { "mock": "document" }
|
197
|
+
});
|
198
|
+
deepStrictEqual(loaderCalled, true, "Loader should be called for non-preloaded URLs");
|
199
|
+
const cachedValue2 = await kv$1.get([
|
200
|
+
"_test",
|
201
|
+
"preloaded",
|
202
|
+
nonPreloadedUrl
|
203
|
+
]);
|
204
|
+
deepStrictEqual(cachedValue2, result3, "Non-preloaded URLs should be cached");
|
205
|
+
});
|
206
|
+
});
|
207
|
+
|
208
|
+
//#endregion
|
@@ -0,0 +1,14 @@
|
|
1
|
+
|
2
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
3
|
+
const { URLPattern } = require("urlpattern-polyfill");
|
4
|
+
|
5
|
+
const require_request = require('../request-Bc5CHBqO.cjs');
|
6
|
+
require('../actor-Ci-5y3ml.cjs');
|
7
|
+
require('../lookup-BmGuy-Ps.cjs');
|
8
|
+
require('../http-DtUGyvkU.cjs');
|
9
|
+
const require_kv_cache = require('../kv-cache-3VK2-wq_.cjs');
|
10
|
+
require('../utils-B6yXfxAQ.cjs');
|
11
|
+
|
12
|
+
exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocumentLoader;
|
13
|
+
exports.getUserAgent = require_request.getUserAgent;
|
14
|
+
exports.kvCache = require_kv_cache.kvCache;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { getUserAgent } from "../request-BbHkedIU.cjs";
|
2
|
+
import "../vocab-DCBw44JZ.cjs";
|
3
|
+
import "../http-B6SKO6NJ.cjs";
|
4
|
+
import "../kv-BMKIFXNW.cjs";
|
5
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-CLKu6Uo_.cjs";
|
6
|
+
export { getAuthenticatedDocumentLoader, getUserAgent, kvCache };
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
2
|
+
import { URLPattern } from "urlpattern-polyfill";
|
3
|
+
import { getUserAgent } from "../request-U1t6zZtk.js";
|
4
|
+
import "../vocab-ivDKb439.js";
|
5
|
+
import "../http-BE7aFuqn.js";
|
6
|
+
import "../kv-Dt06smFt.js";
|
7
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../mod-Cm97bAiT.js";
|
8
|
+
export { getAuthenticatedDocumentLoader, getUserAgent, kvCache };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
|
5
|
+
import { getUserAgent } from "../request-C0Ags1gQ.js";
|
6
|
+
import "../actor-CRQwUlsr.js";
|
7
|
+
import "../lookup-Bql--V-C.js";
|
8
|
+
import "../http-BzsavjR2.js";
|
9
|
+
import { getAuthenticatedDocumentLoader, kvCache } from "../kv-cache-rR-Cnl95.js";
|
10
|
+
import "../utils-BXMGcmqK.js";
|
11
|
+
|
12
|
+
export { getAuthenticatedDocumentLoader, getUserAgent, kvCache };
|
@@ -0,0 +1,48 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import { deno_default, getUserAgent } from "../lookup-Bep-EOgr.js";
|
7
|
+
import { test } from "../testing-BkidWE0N.js";
|
8
|
+
import process from "node:process";
|
9
|
+
import { deepStrictEqual } from "node:assert";
|
10
|
+
|
11
|
+
//#region src/utils/request.test.ts
|
12
|
+
test("getUserAgent()", () => {
|
13
|
+
if ("Deno" in globalThis) {
|
14
|
+
deepStrictEqual(getUserAgent(), `Fedify/${deno_default.version} (Deno/${Deno.version.deno})`);
|
15
|
+
deepStrictEqual(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${deno_default.version}; Deno/${Deno.version.deno})`);
|
16
|
+
deepStrictEqual(getUserAgent({ url: "https://example.com/" }), `Fedify/${deno_default.version} (Deno/${Deno.version.deno}; +https://example.com/)`);
|
17
|
+
deepStrictEqual(getUserAgent({
|
18
|
+
software: "MyApp/1.0.0",
|
19
|
+
url: new URL("https://example.com/")
|
20
|
+
}), `MyApp/1.0.0 (Fedify/${deno_default.version}; Deno/${Deno.version.deno}; +https://example.com/)`);
|
21
|
+
} else if ("Bun" in globalThis) {
|
22
|
+
deepStrictEqual(getUserAgent(), `Fedify/${deno_default.version} (Bun/${Bun.version})`);
|
23
|
+
deepStrictEqual(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${deno_default.version}; Bun/${Bun.version})`);
|
24
|
+
deepStrictEqual(getUserAgent({ url: "https://example.com/" }), `Fedify/${deno_default.version} (Bun/${Bun.version}; +https://example.com/)`);
|
25
|
+
deepStrictEqual(getUserAgent({
|
26
|
+
software: "MyApp/1.0.0",
|
27
|
+
url: new URL("https://example.com/")
|
28
|
+
}), `MyApp/1.0.0 (Fedify/${deno_default.version}; Bun/${Bun.version}; +https://example.com/)`);
|
29
|
+
} else if (navigator.userAgent === "Cloudflare-Workers") {
|
30
|
+
deepStrictEqual(getUserAgent(), `Fedify/${deno_default.version} (Cloudflare-Workers)`);
|
31
|
+
deepStrictEqual(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${deno_default.version}; Cloudflare-Workers)`);
|
32
|
+
deepStrictEqual(getUserAgent({ url: "https://example.com/" }), `Fedify/${deno_default.version} (Cloudflare-Workers; +https://example.com/)`);
|
33
|
+
deepStrictEqual(getUserAgent({
|
34
|
+
software: "MyApp/1.0.0",
|
35
|
+
url: new URL("https://example.com/")
|
36
|
+
}), `MyApp/1.0.0 (Fedify/${deno_default.version}; Cloudflare-Workers; +https://example.com/)`);
|
37
|
+
} else {
|
38
|
+
deepStrictEqual(getUserAgent(), `Fedify/${deno_default.version} (Node.js/${process.versions.node})`);
|
39
|
+
deepStrictEqual(getUserAgent({ software: "MyApp/1.0.0" }), `MyApp/1.0.0 (Fedify/${deno_default.version}; Node.js/${process.versions.node})`);
|
40
|
+
deepStrictEqual(getUserAgent({ url: "https://example.com/" }), `Fedify/${deno_default.version} (Node.js/${process.versions.node}; +https://example.com/)`);
|
41
|
+
deepStrictEqual(getUserAgent({
|
42
|
+
software: "MyApp/1.0.0",
|
43
|
+
url: new URL("https://example.com/")
|
44
|
+
}), `MyApp/1.0.0 (Fedify/${deno_default.version}; Node.js/${process.versions.node}; +https://example.com/)`);
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
//#endregion
|
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
import { Temporal } from "@js-temporal/polyfill";
|
3
|
+
import { URLPattern } from "urlpattern-polyfill";
|
4
|
+
globalThis.addEventListener = () => {};
|
5
|
+
|
6
|
+
import { UrlError, expandIPv6Address, isValidPublicIPv4Address, isValidPublicIPv6Address, validatePublicUrl } from "../lookup-Bep-EOgr.js";
|
7
|
+
import { test } from "../testing-BkidWE0N.js";
|
8
|
+
import { deepStrictEqual, ok, rejects } from "node:assert";
|
9
|
+
|
10
|
+
//#region src/utils/url.test.ts
|
11
|
+
test("validatePublicUrl()", async () => {
|
12
|
+
await rejects(() => validatePublicUrl("ftp://localhost"), UrlError);
|
13
|
+
await rejects(() => validatePublicUrl("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="), UrlError);
|
14
|
+
await rejects(() => validatePublicUrl("https://localhost"), UrlError);
|
15
|
+
await rejects(() => validatePublicUrl("https://127.0.0.1"), UrlError);
|
16
|
+
await rejects(() => validatePublicUrl("https://[::1]"), UrlError);
|
17
|
+
});
|
18
|
+
test("isValidPublicIPv4Address()", () => {
|
19
|
+
ok(isValidPublicIPv4Address("8.8.8.8"));
|
20
|
+
ok(!isValidPublicIPv4Address("192.168.1.1"));
|
21
|
+
ok(!isValidPublicIPv4Address("127.0.0.1"));
|
22
|
+
ok(!isValidPublicIPv4Address("10.0.0.1"));
|
23
|
+
ok(!isValidPublicIPv4Address("127.16.0.1"));
|
24
|
+
ok(!isValidPublicIPv4Address("169.254.0.1"));
|
25
|
+
});
|
26
|
+
test("isValidPublicIPv6Address()", () => {
|
27
|
+
ok(isValidPublicIPv6Address("2001:db8::1"));
|
28
|
+
ok(!isValidPublicIPv6Address("::1"));
|
29
|
+
ok(!isValidPublicIPv6Address("fc00::1"));
|
30
|
+
ok(!isValidPublicIPv6Address("fe80::1"));
|
31
|
+
ok(!isValidPublicIPv6Address("ff00::1"));
|
32
|
+
ok(!isValidPublicIPv6Address("::"));
|
33
|
+
});
|
34
|
+
test("expandIPv6Address()", () => {
|
35
|
+
deepStrictEqual(expandIPv6Address("::"), "0000:0000:0000:0000:0000:0000:0000:0000");
|
36
|
+
deepStrictEqual(expandIPv6Address("::1"), "0000:0000:0000:0000:0000:0000:0000:0001");
|
37
|
+
deepStrictEqual(expandIPv6Address("2001:db8::"), "2001:0db8:0000:0000:0000:0000:0000:0000");
|
38
|
+
deepStrictEqual(expandIPv6Address("2001:db8::1"), "2001:0db8:0000:0000:0000:0000:0000:0001");
|
39
|
+
});
|
40
|
+
|
41
|
+
//#endregion
|
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-Bep-EOgr.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-CvUgdJZ_.js";
|
10
|
+
import { getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-GwnlqPRv.js";
|
11
|
+
import { test } from "../testing-BkidWE0N.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-DjbC-dsH.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-Bep-EOgr.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-CvUgdJZ_.js";
|
10
|
+
import { mockDocumentLoader, test } from "../testing-BkidWE0N.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-DjbC-dsH.js";
|
18
16
|
|
19
17
|
//#region src/vocab/lookup.test.ts
|
20
18
|
test("lookupObject()", {
|
package/dist/vocab/mod.cjs
CHANGED
@@ -2,10 +2,10 @@
|
|
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('../lookup-
|
8
|
-
const require_vocab = require('../vocab-
|
5
|
+
require('../request-Bc5CHBqO.cjs');
|
6
|
+
const require_actor = require('../actor-Ci-5y3ml.cjs');
|
7
|
+
require('../lookup-BmGuy-Ps.cjs');
|
8
|
+
const require_vocab = require('../vocab-Dapemq3v.cjs');
|
9
9
|
|
10
10
|
exports.Accept = require_actor.Accept;
|
11
11
|
exports.Activity = require_actor.Activity;
|
package/dist/vocab/mod.d.cts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import "../
|
2
|
-
import "../
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-CxkWO3Mg.cjs";
|
1
|
+
import "../request-BbHkedIU.cjs";
|
2
|
+
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-DCBw44JZ.cjs";
|
3
|
+
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-DDhZuMGl.cjs";
|
4
|
+
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod--K7l84wp.cjs";
|
6
5
|
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,7 @@
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
3
|
-
import "../
|
4
|
-
import "../
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-DlU8ISoa.js";
|
3
|
+
import "../request-U1t6zZtk.js";
|
4
|
+
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-ivDKb439.js";
|
5
|
+
import { Actor, ActorTypeName, GetActorHandleOptions, NormalizeActorHandleOptions, Recipient, getActorClassByTypeName, getActorHandle, getActorTypeName, isActor, normalizeActorHandle } from "../actor-Cd2CREO0.js";
|
6
|
+
import { FediverseHandle, LookupObjectOptions, PUBLIC_COLLECTION, TraverseCollectionOptions, getTypeId, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../mod-CRENK2dd.js";
|
8
7
|
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,9 @@
|
|
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 "../lookup-
|
8
|
-
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-
|
5
|
+
import "../request-C0Ags1gQ.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-CRQwUlsr.js";
|
7
|
+
import "../lookup-Bql--V-C.js";
|
8
|
+
import { PUBLIC_COLLECTION, isFediverseHandle, lookupObject, parseFediverseHandle, toAcctUrl, traverseCollection } from "../vocab-BiKK7m2H.js";
|
9
9
|
|
10
10
|
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-Bep-EOgr.js";
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
8
|
-
import "../
|
9
|
-
import { test } from "../testing-BljKU-GG.js";
|
8
|
+
import { test } from "../testing-BkidWE0N.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-Bep-EOgr.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-DnSaJmvD.js";
|
10
|
+
import { mockDocumentLoader, test } from "../testing-BkidWE0N.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-B4ZjS1Ot.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({
|
@@ -2,11 +2,12 @@
|
|
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-
|
5
|
+
import { deno_default } from "./request-C0Ags1gQ.js";
|
6
|
+
import { Object as Object$1, getTypeId } from "./actor-CRQwUlsr.js";
|
7
|
+
import { lookupWebFinger } from "./lookup-Bql--V-C.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
10
|
+
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
10
11
|
import { delay } from "es-toolkit";
|
11
12
|
|
12
13
|
//#region src/vocab/handle.ts
|