@fedify/fedify 1.6.1-dev.849 → 1.6.1-dev.856
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/_virtual/rolldown_runtime.js +26 -1
- package/dist/codegen/schema.js +5 -4
- package/dist/deno.js +15 -2
- package/dist/federation/context.d.ts +27 -0
- package/dist/federation/handler.test.js +24 -5
- package/dist/federation/middleware.js +34 -1
- package/dist/federation/middleware.test.js +90 -53
- package/dist/federation/send.test.js +8 -10
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/constants.js +1 -7
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/dirname.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/_common/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/dirname.js +1 -32
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/join.js +1 -32
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/mod.js +0 -2
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/dirname.js +2 -2
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/posix/join.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/from_file_url.js +1 -1
- package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/dirname.js +2 -2
- package/dist/node_modules/.pnpm/@jsr_std__url@1.0.0-rc.3/node_modules/@jsr/std__url/join.js +2 -2
- package/dist/node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js +68 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/CallHistory.js +94 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/FetchMock.js +143 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/IsSubsetOf.js +103 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Matchers.js +195 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/RequestUtils.js +83 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Route.js +137 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/Router.js +181 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/StatusTextMap.js +73 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/TypeDescriptor.js +97 -0
- package/dist/node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/index.js +11 -0
- package/dist/node_modules/.pnpm/glob-to-regexp@0.4.1/node_modules/glob-to-regexp/index.js +87 -0
- package/dist/node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.js +37 -0
- package/dist/runtime/authdocloader.test.js +5 -5
- package/dist/runtime/docloader.js +1 -1
- package/dist/runtime/docloader.test.js +8 -0
- package/dist/sig/key.js +7 -2
- package/dist/testing/context.js +14 -2
- package/dist/testing/docloader.js +34 -15
- package/dist/testing/fixtures/example.com/{hong-gildong → hong-gildong.json} +1 -1
- package/dist/testing/fixtures/example.com/{object → object.json} +1 -1
- package/dist/testing/fixtures/example.com/person.js +29 -0
- package/dist/testing/fixtures/example.com/person2.js +48 -0
- package/dist/testing/fixtures/example.com/{test → test.json} +1 -1
- package/dist/testing/fixtures/w3id.org/security/data-integrity/{v1 → v1.json} +1 -1
- package/dist/testing/fixtures/w3id.org/security/{v1 → v1.json} +9 -9
- package/dist/testing/mod.d.ts +11 -0
- package/dist/testing/mod.js +44 -38
- package/dist/vocab/lookup.test.js +30 -35
- package/dist/vocab/vocab.js +176 -176
- package/dist/vocab/vocab.test.js +2 -2
- package/package.json +8 -3
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/_util.js +0 -19
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/dirname.js +0 -75
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/join.js +0 -54
- package/dist/node_modules/.pnpm/@jsr_std__path@1.0.9/node_modules/@jsr/std__path/windows/normalize.js +0 -87
- /package/dist/testing/fixtures/activitypub.academy/users/{brauca_darradiul → brauca_darradiul.json} +0 -0
- /package/dist/testing/fixtures/example.com/{announce → announce.json} +0 -0
- /package/dist/testing/fixtures/example.com/{collection → collection.json} +0 -0
- /package/dist/testing/fixtures/example.com/{create → create.json} +0 -0
- /package/dist/testing/fixtures/example.com/{cross-origin-actor → cross-origin-actor.json} +0 -0
- /package/dist/testing/fixtures/example.com/{invite → invite.json} +0 -0
- /package/dist/testing/fixtures/example.com/{key → key.json} +0 -0
- /package/dist/testing/fixtures/example.com/{key2 → key2.json} +0 -0
- /package/dist/testing/fixtures/example.com/{orderedcollectionpage → orderedcollectionpage.json} +0 -0
- /package/dist/testing/fixtures/example.com/paged/{a → a.json} +0 -0
- /package/dist/testing/fixtures/example.com/paged/{b → b.json} +0 -0
- /package/dist/testing/fixtures/example.com/{paged-collection → paged-collection.json} +0 -0
- /package/dist/testing/fixtures/example.com/{person → person.json} +0 -0
- /package/dist/testing/fixtures/example.com/{person2 → person2.json} +0 -0
- /package/dist/testing/fixtures/example.com/users/{handle → handle.json} +0 -0
- /package/dist/testing/fixtures/example.com/{wrong-type → wrong-type.json} +0 -0
- /package/dist/testing/fixtures/remote.domain/users/{bob → bob.json} +0 -0
- /package/dist/testing/fixtures/server.example/users/{alice → alice.json} +0 -0
- /package/dist/testing/fixtures/w3id.org/identity/{v1 → v1.json} +0 -0
- /package/dist/testing/fixtures/w3id.org/security/multikey/{v1 → v1.json} +0 -0
- /package/dist/testing/fixtures/wizard.casa/users/{hongminhee → hongminhee.json} +0 -0
- /package/dist/testing/fixtures/www.w3.org/ns/{activitystreams → activitystreams.json} +0 -0
- /package/dist/testing/fixtures/www.w3.org/ns/did/{v1 → v1.json} +0 -0
package/dist/testing/mod.js
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
4
4
|
|
5
|
+
import { __require } from "../_virtual/rolldown_runtime.js";
|
5
6
|
import { configure, getConsoleSink, reset } from "@logtape/logtape";
|
6
|
-
import { test } from "node:test";
|
7
7
|
|
8
8
|
//#region testing/mod.ts
|
9
|
-
|
9
|
+
const testDefinitions = [];
|
10
|
+
function test(name, options, fn) {
|
10
11
|
const def = typeof name === "string" ? typeof options === "function" ? {
|
11
12
|
name,
|
12
13
|
fn: options
|
@@ -15,37 +16,39 @@ function test$1(name, options, fn) {
|
|
15
16
|
...options,
|
16
17
|
fn
|
17
18
|
} : name;
|
18
|
-
|
19
|
-
if ("Deno" in globalThis)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
testDefinitions.push(def);
|
20
|
+
if ("Deno" in globalThis) {
|
21
|
+
const func = def.fn;
|
22
|
+
Deno.test({
|
23
|
+
...def,
|
24
|
+
async fn(t) {
|
25
|
+
const records = [];
|
26
|
+
await configure({
|
27
|
+
sinks: {
|
28
|
+
buffer(record) {
|
29
|
+
if (record.category.length > 1 && record.category[0] === "logtape" && record.category[1] === "meta") return;
|
30
|
+
records.push(record);
|
31
|
+
},
|
32
|
+
console: getConsoleSink()
|
28
33
|
},
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
await reset();
|
34
|
+
filters: {},
|
35
|
+
loggers: [{
|
36
|
+
category: [],
|
37
|
+
sinks: [Deno.env.get("LOG") === "always" ? "console" : "buffer"]
|
38
|
+
}]
|
39
|
+
});
|
40
|
+
try {
|
41
|
+
await func(t);
|
42
|
+
} catch (e) {
|
43
|
+
const consoleSink = getConsoleSink();
|
44
|
+
for (const record of records) consoleSink(record);
|
45
|
+
throw e;
|
46
|
+
} finally {
|
47
|
+
await reset();
|
48
|
+
}
|
45
49
|
}
|
46
|
-
}
|
47
|
-
})
|
48
|
-
else if ("Bun" in globalThis) {
|
50
|
+
});
|
51
|
+
} else if ("Bun" in globalThis) {
|
49
52
|
let failed = void 0;
|
50
53
|
async function step(defOrNameOrFn, fn$2) {
|
51
54
|
let def$1;
|
@@ -84,12 +87,15 @@ function test$1(name, options, fn) {
|
|
84
87
|
if (def.ignore) bunTest.skip(def.name, fn$1);
|
85
88
|
else if (def.only) bunTest.only(def.name, fn$1);
|
86
89
|
else bunTest(def.name, fn$1);
|
87
|
-
} else
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
} else try {
|
91
|
+
const { test: nodeTest } = __require("node:test");
|
92
|
+
nodeTest(def.name, {
|
93
|
+
only: def.only,
|
94
|
+
skip: def.ignore
|
95
|
+
}, async (t) => {
|
96
|
+
await def.fn(intoDenoTestContext(def.name, t));
|
97
|
+
});
|
98
|
+
} catch {}
|
93
99
|
}
|
94
100
|
function intoDenoTestContext(name, ctx) {
|
95
101
|
async function step(defOrNameOrFn, fn) {
|
@@ -133,4 +139,4 @@ function caller() {
|
|
133
139
|
}
|
134
140
|
|
135
141
|
//#endregion
|
136
|
-
export { test
|
142
|
+
export { test, testDefinitions };
|
@@ -8,33 +8,30 @@ import { assertEquals } from "../node_modules/.pnpm/@jsr_std__assert@0.226.0/nod
|
|
8
8
|
import { assertInstanceOf } from "../node_modules/.pnpm/@jsr_std__assert@0.226.0/node_modules/@jsr/std__assert/assert_instance_of.js";
|
9
9
|
import { test } from "../testing/mod.js";
|
10
10
|
import { mockDocumentLoader } from "../testing/docloader.js";
|
11
|
-
import {
|
11
|
+
import { esm_default } from "../node_modules/.pnpm/fetch-mock@12.5.2/node_modules/fetch-mock/dist/esm/index.js";
|
12
12
|
|
13
13
|
//#region vocab/lookup.test.ts
|
14
14
|
test("lookupObject()", async (t) => {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
]
|
37
|
-
}));
|
15
|
+
esm_default.spyGlobal();
|
16
|
+
esm_default.get("begin:https://example.com/.well-known/webfinger", {
|
17
|
+
subject: "acct:johndoe@example.com",
|
18
|
+
links: [
|
19
|
+
{
|
20
|
+
rel: "alternate",
|
21
|
+
href: "https://example.com/object",
|
22
|
+
type: "application/activity+json"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
rel: "self",
|
26
|
+
href: "https://example.com/html/person",
|
27
|
+
type: "text/html"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
rel: "self",
|
31
|
+
href: "https://example.com/person",
|
32
|
+
type: "application/activity+json"
|
33
|
+
}
|
34
|
+
]
|
38
35
|
});
|
39
36
|
const options = {
|
40
37
|
documentLoader: mockDocumentLoader,
|
@@ -64,22 +61,20 @@ test("lookupObject()", async (t) => {
|
|
64
61
|
name: "Hong Gildong"
|
65
62
|
}));
|
66
63
|
});
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
}]
|
76
|
-
}));
|
64
|
+
esm_default.removeRoutes();
|
65
|
+
esm_default.get("begin:https://example.com/.well-known/webfinger", {
|
66
|
+
subject: "acct:janedoe@example.com",
|
67
|
+
links: [{
|
68
|
+
rel: "self",
|
69
|
+
href: "https://example.com/404",
|
70
|
+
type: "application/activity+json"
|
71
|
+
}]
|
77
72
|
});
|
78
73
|
await t.step("not found", async () => {
|
79
74
|
assertEquals(await lookupObject("janedoe@example.com", options), null);
|
80
75
|
assertEquals(await lookupObject("https://example.com/404", options), null);
|
81
76
|
});
|
82
|
-
|
77
|
+
esm_default.hardReset();
|
83
78
|
});
|
84
79
|
test("traverseCollection()", async () => {
|
85
80
|
const options = {
|