@fedify/vocab-runtime 2.0.25-dev.1847 → 2.0.25-dev.1855
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/deno.json +1 -1
- package/dist/mod.cjs +15 -9
- package/dist/mod.d.cts +1 -0
- package/dist/mod.d.ts +1 -0
- package/dist/mod.js +15 -9
- package/dist/tests/docloader.test.cjs +31 -9
- package/dist/tests/docloader.test.mjs +31 -9
- package/dist/tests/{request-By1x0wjX.cjs → request-BXKk60To.cjs} +1 -1
- package/dist/tests/{request-c5GQcKTT.mjs → request-Dpu30Xt8.mjs} +1 -1
- package/dist/tests/request.test.cjs +1 -1
- package/dist/tests/request.test.mjs +1 -1
- package/package.json +1 -1
- package/src/contexts/fep-ef61.json +10 -0
- package/src/contexts/miscellany.json +2 -4
- package/src/contexts.ts +10 -0
- package/src/docloader.test.ts +25 -0
- package/src/docloader.ts +1 -0
package/deno.json
CHANGED
package/dist/mod.cjs
CHANGED
|
@@ -14,6 +14,16 @@ let node_crypto = require("node:crypto");
|
|
|
14
14
|
let pkijs = require("pkijs");
|
|
15
15
|
let _multiformats_base_x = require("@multiformats/base-x");
|
|
16
16
|
_multiformats_base_x = require_chunk.__toESM(_multiformats_base_x);
|
|
17
|
+
//#region src/contexts/fep-ef61.json
|
|
18
|
+
var fep_ef61_default = { "@context": {
|
|
19
|
+
"gateways": {
|
|
20
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
21
|
+
"@type": "@id",
|
|
22
|
+
"@container": "@list"
|
|
23
|
+
},
|
|
24
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
25
|
+
} };
|
|
26
|
+
//#endregion
|
|
17
27
|
//#region src/contexts/join-lemmy.json
|
|
18
28
|
var join_lemmy_default = { "@context": ["https://w3id.org/security/v1", {
|
|
19
29
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
@@ -49,18 +59,12 @@ var miscellany_default = { "@context": {
|
|
|
49
59
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
50
60
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
51
61
|
"Hashtag": "as:Hashtag",
|
|
52
|
-
"manuallyApprovesFollowers": {
|
|
53
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
54
|
-
"@type": "xsd:boolean"
|
|
55
|
-
},
|
|
62
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
56
63
|
"movedTo": {
|
|
57
64
|
"@id": "as:movedTo",
|
|
58
65
|
"@type": "@id"
|
|
59
66
|
},
|
|
60
|
-
"sensitive": {
|
|
61
|
-
"@id": "as:sensitive",
|
|
62
|
-
"@type": "xsd:boolean"
|
|
63
|
-
}
|
|
67
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
64
68
|
} };
|
|
65
69
|
//#endregion
|
|
66
70
|
//#region src/contexts.ts
|
|
@@ -4283,6 +4287,7 @@ const preloadedContexts = {
|
|
|
4283
4287
|
"@type": "@id"
|
|
4284
4288
|
}
|
|
4285
4289
|
} },
|
|
4290
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
4286
4291
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
4287
4292
|
"http://joinmastodon.org/ns": { "@context": {
|
|
4288
4293
|
"toot": "http://joinmastodon.org/ns#",
|
|
@@ -4315,7 +4320,7 @@ const preloadedContexts = {
|
|
|
4315
4320
|
//#endregion
|
|
4316
4321
|
//#region deno.json
|
|
4317
4322
|
var name = "@fedify/vocab-runtime";
|
|
4318
|
-
var version = "2.0.25-dev.
|
|
4323
|
+
var version = "2.0.25-dev.1855+e105cb5b";
|
|
4319
4324
|
//#endregion
|
|
4320
4325
|
//#region src/link.ts
|
|
4321
4326
|
const parametersNeedLowerCase = ["rel", "type"];
|
|
@@ -4877,6 +4882,7 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
4877
4882
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
4878
4883
|
* - <https://www.w3.org/ns/did/v1>
|
|
4879
4884
|
* - <https://w3id.org/security/multikey/v1>
|
|
4885
|
+
* - <https://w3id.org/fep/ef61>
|
|
4880
4886
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
4881
4887
|
* - <http://schema.org/>
|
|
4882
4888
|
* @param options Options for the document loader.
|
package/dist/mod.d.cts
CHANGED
|
@@ -178,6 +178,7 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
178
178
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
179
179
|
* - <https://www.w3.org/ns/did/v1>
|
|
180
180
|
* - <https://w3id.org/security/multikey/v1>
|
|
181
|
+
* - <https://w3id.org/fep/ef61>
|
|
181
182
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
182
183
|
* - <http://schema.org/>
|
|
183
184
|
* @param options Options for the document loader.
|
package/dist/mod.d.ts
CHANGED
|
@@ -177,6 +177,7 @@ interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
177
177
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
178
178
|
* - <https://www.w3.org/ns/did/v1>
|
|
179
179
|
* - <https://w3id.org/security/multikey/v1>
|
|
180
|
+
* - <https://w3id.org/fep/ef61>
|
|
180
181
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
181
182
|
* - <http://schema.org/>
|
|
182
183
|
* @param options Options for the document loader.
|
package/dist/mod.js
CHANGED
|
@@ -10,6 +10,16 @@ import { decodeBase64Url } from "byte-encodings/base64url";
|
|
|
10
10
|
import { createPublicKey } from "node:crypto";
|
|
11
11
|
import { PublicKeyInfo } from "pkijs";
|
|
12
12
|
import baseX from "@multiformats/base-x";
|
|
13
|
+
//#region src/contexts/fep-ef61.json
|
|
14
|
+
var fep_ef61_default = { "@context": {
|
|
15
|
+
"gateways": {
|
|
16
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
17
|
+
"@type": "@id",
|
|
18
|
+
"@container": "@list"
|
|
19
|
+
},
|
|
20
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
21
|
+
} };
|
|
22
|
+
//#endregion
|
|
13
23
|
//#region src/contexts/join-lemmy.json
|
|
14
24
|
var join_lemmy_default = { "@context": ["https://w3id.org/security/v1", {
|
|
15
25
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
@@ -45,18 +55,12 @@ var miscellany_default = { "@context": {
|
|
|
45
55
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
46
56
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
47
57
|
"Hashtag": "as:Hashtag",
|
|
48
|
-
"manuallyApprovesFollowers": {
|
|
49
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
50
|
-
"@type": "xsd:boolean"
|
|
51
|
-
},
|
|
58
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
52
59
|
"movedTo": {
|
|
53
60
|
"@id": "as:movedTo",
|
|
54
61
|
"@type": "@id"
|
|
55
62
|
},
|
|
56
|
-
"sensitive": {
|
|
57
|
-
"@id": "as:sensitive",
|
|
58
|
-
"@type": "xsd:boolean"
|
|
59
|
-
}
|
|
63
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
60
64
|
} };
|
|
61
65
|
//#endregion
|
|
62
66
|
//#region src/contexts.ts
|
|
@@ -4279,6 +4283,7 @@ const preloadedContexts = {
|
|
|
4279
4283
|
"@type": "@id"
|
|
4280
4284
|
}
|
|
4281
4285
|
} },
|
|
4286
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
4282
4287
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
4283
4288
|
"http://joinmastodon.org/ns": { "@context": {
|
|
4284
4289
|
"toot": "http://joinmastodon.org/ns#",
|
|
@@ -4311,7 +4316,7 @@ const preloadedContexts = {
|
|
|
4311
4316
|
//#endregion
|
|
4312
4317
|
//#region deno.json
|
|
4313
4318
|
var name = "@fedify/vocab-runtime";
|
|
4314
|
-
var version = "2.0.25-dev.
|
|
4319
|
+
var version = "2.0.25-dev.1855+e105cb5b";
|
|
4315
4320
|
//#endregion
|
|
4316
4321
|
//#region src/link.ts
|
|
4317
4322
|
const parametersNeedLowerCase = ["rel", "type"];
|
|
@@ -4873,6 +4878,7 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
4873
4878
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
4874
4879
|
* - <https://www.w3.org/ns/did/v1>
|
|
4875
4880
|
* - <https://w3id.org/security/multikey/v1>
|
|
4881
|
+
* - <https://w3id.org/fep/ef61>
|
|
4876
4882
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
4877
4883
|
* - <http://schema.org/>
|
|
4878
4884
|
* @param options Options for the document loader.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Do9eywBl.cjs");
|
|
2
|
-
const require_request = require("./request-
|
|
2
|
+
const require_request = require("./request-BXKk60To.cjs");
|
|
3
3
|
const require_link = require("./link-B6ZWBZhf.cjs");
|
|
4
4
|
const require_url = require("./url-CqwkmczT.cjs");
|
|
5
5
|
let node_assert = require("node:assert");
|
|
@@ -1207,6 +1207,16 @@ var esm_default = new class FetchMock {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
}({ ...defaultFetchMockConfig });
|
|
1209
1209
|
//#endregion
|
|
1210
|
+
//#region src/contexts/fep-ef61.json
|
|
1211
|
+
var fep_ef61_default = { "@context": {
|
|
1212
|
+
"gateways": {
|
|
1213
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
1214
|
+
"@type": "@id",
|
|
1215
|
+
"@container": "@list"
|
|
1216
|
+
},
|
|
1217
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
1218
|
+
} };
|
|
1219
|
+
//#endregion
|
|
1210
1220
|
//#region src/contexts/join-lemmy.json
|
|
1211
1221
|
var join_lemmy_default = { "@context": ["https://w3id.org/security/v1", {
|
|
1212
1222
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
@@ -1242,18 +1252,12 @@ var miscellany_default = { "@context": {
|
|
|
1242
1252
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
1243
1253
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
1244
1254
|
"Hashtag": "as:Hashtag",
|
|
1245
|
-
"manuallyApprovesFollowers": {
|
|
1246
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
1247
|
-
"@type": "xsd:boolean"
|
|
1248
|
-
},
|
|
1255
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
1249
1256
|
"movedTo": {
|
|
1250
1257
|
"@id": "as:movedTo",
|
|
1251
1258
|
"@type": "@id"
|
|
1252
1259
|
},
|
|
1253
|
-
"sensitive": {
|
|
1254
|
-
"@id": "as:sensitive",
|
|
1255
|
-
"@type": "xsd:boolean"
|
|
1256
|
-
}
|
|
1260
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
1257
1261
|
} };
|
|
1258
1262
|
//#endregion
|
|
1259
1263
|
//#region src/contexts.ts
|
|
@@ -5476,6 +5480,7 @@ const preloadedContexts = {
|
|
|
5476
5480
|
"@type": "@id"
|
|
5477
5481
|
}
|
|
5478
5482
|
} },
|
|
5483
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
5479
5484
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
5480
5485
|
"http://joinmastodon.org/ns": { "@context": {
|
|
5481
5486
|
"toot": "http://joinmastodon.org/ns#",
|
|
@@ -5621,6 +5626,7 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
5621
5626
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
5622
5627
|
* - <https://www.w3.org/ns/did/v1>
|
|
5623
5628
|
* - <https://w3id.org/security/multikey/v1>
|
|
5629
|
+
* - <https://w3id.org/fep/ef61>
|
|
5624
5630
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
5625
5631
|
* - <http://schema.org/>
|
|
5626
5632
|
* @param options Options for the document loader.
|
|
@@ -5922,6 +5928,22 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
|
|
|
5922
5928
|
document
|
|
5923
5929
|
});
|
|
5924
5930
|
});
|
|
5931
|
+
await t.test("preloaded FEP-ef61 context", async () => {
|
|
5932
|
+
const url = "https://w3id.org/fep/ef61";
|
|
5933
|
+
(0, node_assert.ok)(url in preloadedContexts);
|
|
5934
|
+
(0, node_assert.deepStrictEqual)(await fetchDocumentLoader(url), {
|
|
5935
|
+
contextUrl: null,
|
|
5936
|
+
documentUrl: url,
|
|
5937
|
+
document: { "@context": {
|
|
5938
|
+
gateways: {
|
|
5939
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
5940
|
+
"@type": "@id",
|
|
5941
|
+
"@container": "@list"
|
|
5942
|
+
},
|
|
5943
|
+
digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
5944
|
+
} }
|
|
5945
|
+
});
|
|
5946
|
+
});
|
|
5925
5947
|
await t.test("deny non-HTTP/HTTPS", async () => {
|
|
5926
5948
|
await (0, node_assert.rejects)(() => fetchDocumentLoader("ftp://localhost"), require_url.UrlError);
|
|
5927
5949
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-
|
|
1
|
+
import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-Dpu30Xt8.mjs";
|
|
2
2
|
import { t as HttpHeaderLink } from "./link-B8JGXSS2.mjs";
|
|
3
3
|
import { o as validatePublicUrl, t as UrlError } from "./url-BulORwtj.mjs";
|
|
4
4
|
import { deepStrictEqual, ok, rejects } from "node:assert";
|
|
@@ -1226,6 +1226,16 @@ var esm_default = new class FetchMock {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
}({ ...defaultFetchMockConfig });
|
|
1228
1228
|
//#endregion
|
|
1229
|
+
//#region src/contexts/fep-ef61.json
|
|
1230
|
+
var fep_ef61_default = { "@context": {
|
|
1231
|
+
"gateways": {
|
|
1232
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
1233
|
+
"@type": "@id",
|
|
1234
|
+
"@container": "@list"
|
|
1235
|
+
},
|
|
1236
|
+
"digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
1237
|
+
} };
|
|
1238
|
+
//#endregion
|
|
1229
1239
|
//#region src/contexts/join-lemmy.json
|
|
1230
1240
|
var join_lemmy_default = { "@context": ["https://w3id.org/security/v1", {
|
|
1231
1241
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
@@ -1261,18 +1271,12 @@ var miscellany_default = { "@context": {
|
|
|
1261
1271
|
"as": "https://www.w3.org/ns/activitystreams#",
|
|
1262
1272
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
1263
1273
|
"Hashtag": "as:Hashtag",
|
|
1264
|
-
"manuallyApprovesFollowers": {
|
|
1265
|
-
"@id": "as:manuallyApprovesFollowers",
|
|
1266
|
-
"@type": "xsd:boolean"
|
|
1267
|
-
},
|
|
1274
|
+
"manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers" },
|
|
1268
1275
|
"movedTo": {
|
|
1269
1276
|
"@id": "as:movedTo",
|
|
1270
1277
|
"@type": "@id"
|
|
1271
1278
|
},
|
|
1272
|
-
"sensitive": {
|
|
1273
|
-
"@id": "as:sensitive",
|
|
1274
|
-
"@type": "xsd:boolean"
|
|
1275
|
-
}
|
|
1279
|
+
"sensitive": { "@id": "as:sensitive" }
|
|
1276
1280
|
} };
|
|
1277
1281
|
//#endregion
|
|
1278
1282
|
//#region src/contexts.ts
|
|
@@ -5495,6 +5499,7 @@ const preloadedContexts = {
|
|
|
5495
5499
|
"@type": "@id"
|
|
5496
5500
|
}
|
|
5497
5501
|
} },
|
|
5502
|
+
"https://w3id.org/fep/ef61": fep_ef61_default,
|
|
5498
5503
|
"https://join-lemmy.org/context.json": join_lemmy_default,
|
|
5499
5504
|
"http://joinmastodon.org/ns": { "@context": {
|
|
5500
5505
|
"toot": "http://joinmastodon.org/ns#",
|
|
@@ -5640,6 +5645,7 @@ async function getRemoteDocument(url, response, fetch) {
|
|
|
5640
5645
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
5641
5646
|
* - <https://www.w3.org/ns/did/v1>
|
|
5642
5647
|
* - <https://w3id.org/security/multikey/v1>
|
|
5648
|
+
* - <https://w3id.org/fep/ef61>
|
|
5643
5649
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
5644
5650
|
* - <http://schema.org/>
|
|
5645
5651
|
* @param options Options for the document loader.
|
|
@@ -5941,6 +5947,22 @@ test("getDocumentLoader()", async (t) => {
|
|
|
5941
5947
|
document
|
|
5942
5948
|
});
|
|
5943
5949
|
});
|
|
5950
|
+
await t.test("preloaded FEP-ef61 context", async () => {
|
|
5951
|
+
const url = "https://w3id.org/fep/ef61";
|
|
5952
|
+
ok(url in preloadedContexts);
|
|
5953
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
5954
|
+
contextUrl: null,
|
|
5955
|
+
documentUrl: url,
|
|
5956
|
+
document: { "@context": {
|
|
5957
|
+
gateways: {
|
|
5958
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
5959
|
+
"@type": "@id",
|
|
5960
|
+
"@container": "@list"
|
|
5961
|
+
},
|
|
5962
|
+
digestMultibase: "https://www.w3.org/ns/credentials/v2#digestMultibase"
|
|
5963
|
+
} }
|
|
5964
|
+
});
|
|
5965
|
+
});
|
|
5944
5966
|
await t.test("deny non-HTTP/HTTPS", async () => {
|
|
5945
5967
|
await rejects(() => fetchDocumentLoader("ftp://localhost"), UrlError);
|
|
5946
5968
|
});
|
|
@@ -3,7 +3,7 @@ let node_process = require("node:process");
|
|
|
3
3
|
node_process = require_chunk.__toESM(node_process);
|
|
4
4
|
//#region deno.json
|
|
5
5
|
var name = "@fedify/vocab-runtime";
|
|
6
|
-
var version = "2.0.25-dev.
|
|
6
|
+
var version = "2.0.25-dev.1855+e105cb5b";
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/request.ts
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Do9eywBl.cjs");
|
|
2
|
-
const require_request = require("./request-
|
|
2
|
+
const require_request = require("./request-BXKk60To.cjs");
|
|
3
3
|
let node_assert = require("node:assert");
|
|
4
4
|
let node_test = require("node:test");
|
|
5
5
|
let node_process = require("node:process");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as version, r as getUserAgent } from "./request-
|
|
1
|
+
import { o as version, r as getUserAgent } from "./request-Dpu30Xt8.mjs";
|
|
2
2
|
import { deepStrictEqual } from "node:assert";
|
|
3
3
|
import { test } from "node:test";
|
|
4
4
|
import process from "node:process";
|
package/package.json
CHANGED
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
"xsd": "http://www.w3.org/2001/XMLSchema#",
|
|
5
5
|
"Hashtag": "as:Hashtag",
|
|
6
6
|
"manuallyApprovesFollowers": {
|
|
7
|
-
"@id": "as:manuallyApprovesFollowers"
|
|
8
|
-
"@type": "xsd:boolean"
|
|
7
|
+
"@id": "as:manuallyApprovesFollowers"
|
|
9
8
|
},
|
|
10
9
|
"movedTo": {
|
|
11
10
|
"@id": "as:movedTo",
|
|
12
11
|
"@type": "@id"
|
|
13
12
|
},
|
|
14
13
|
"sensitive": {
|
|
15
|
-
"@id": "as:sensitive"
|
|
16
|
-
"@type": "xsd:boolean"
|
|
14
|
+
"@id": "as:sensitive"
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
}
|
package/src/contexts.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// https://github.com/fedify-dev/fedify/issues/74
|
|
3
3
|
// cSpell: disable
|
|
4
4
|
|
|
5
|
+
import fepEf61 from "./contexts/fep-ef61.json" with { type: "json" };
|
|
5
6
|
import joinLemmyContext from "./contexts/join-lemmy.json" with { type: "json" };
|
|
6
7
|
import miscellany from "./contexts/miscellany.json" with { type: "json" };
|
|
7
8
|
|
|
@@ -4318,6 +4319,15 @@ const preloadedContexts: Record<string, unknown> = {
|
|
|
4318
4319
|
},
|
|
4319
4320
|
},
|
|
4320
4321
|
|
|
4322
|
+
// The FEP-ef61 context. The w3id.org URL redirects to Codeberg Pages, which
|
|
4323
|
+
// suffers recurring outages; while it is unreachable, every document
|
|
4324
|
+
// referencing this URL fails JSON-LD expansion before application handlers
|
|
4325
|
+
// run. We ship a built-in copy so that portable objects can be processed
|
|
4326
|
+
// without depending on the availability of the remote context server.
|
|
4327
|
+
// See: https://w3id.org/fep/ef61
|
|
4328
|
+
// https://github.com/fedify-dev/fedify/issues/982
|
|
4329
|
+
"https://w3id.org/fep/ef61": fepEf61,
|
|
4330
|
+
|
|
4321
4331
|
// Lemmy's context document is served as application/json without the JSON-LD
|
|
4322
4332
|
// context Link header. The default document loader treats that as a regular
|
|
4323
4333
|
// JSON response instead of a JSON-LD context, so every Lemmy activity that
|
package/src/docloader.test.ts
CHANGED
|
@@ -285,6 +285,31 @@ test("getDocumentLoader()", async (t) => {
|
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
|
|
288
|
+
// The <https://w3id.org/fep/ef61> URL redirects to a Codeberg Pages host
|
|
289
|
+
// which suffers recurring outages; while it is unreachable, expanding any
|
|
290
|
+
// document referencing it fails before application handlers run. It has to
|
|
291
|
+
// be resolved from the built-in copy rather than over the network.
|
|
292
|
+
// See: https://github.com/fedify-dev/fedify/issues/982
|
|
293
|
+
await t.test("preloaded FEP-ef61 context", async () => {
|
|
294
|
+
const url = "https://w3id.org/fep/ef61";
|
|
295
|
+
ok(url in preloadedContexts);
|
|
296
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
297
|
+
contextUrl: null,
|
|
298
|
+
documentUrl: url,
|
|
299
|
+
document: {
|
|
300
|
+
"@context": {
|
|
301
|
+
gateways: {
|
|
302
|
+
"@id": "https://w3id.org/fep/ef61/gateways",
|
|
303
|
+
"@type": "@id",
|
|
304
|
+
"@container": "@list",
|
|
305
|
+
},
|
|
306
|
+
digestMultibase:
|
|
307
|
+
"https://www.w3.org/ns/credentials/v2#digestMultibase",
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
|
|
288
313
|
await t.test("deny non-HTTP/HTTPS", async () => {
|
|
289
314
|
await rejects(
|
|
290
315
|
() => fetchDocumentLoader("ftp://localhost"),
|
package/src/docloader.ts
CHANGED
|
@@ -277,6 +277,7 @@ export interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
277
277
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
278
278
|
* - <https://www.w3.org/ns/did/v1>
|
|
279
279
|
* - <https://w3id.org/security/multikey/v1>
|
|
280
|
+
* - <https://w3id.org/fep/ef61>
|
|
280
281
|
* - <https://purl.archive.org/socialweb/webfinger>
|
|
281
282
|
* - <http://schema.org/>
|
|
282
283
|
* @param options Options for the document loader.
|