@fedify/vocab-runtime 2.4.0-dev.1867 → 2.4.0-dev.1881
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/{docloader-BK627tQQ.d.cts → docloader-Dr8wEkif.d.cts} +1 -0
- package/dist/{docloader-BK627tQQ.d.ts → docloader-Dr8wEkif.d.ts} +1 -0
- package/dist/internal/jsonld-cache.d.cts +1 -1
- package/dist/internal/jsonld-cache.d.ts +1 -1
- package/dist/mod.cjs +113 -1
- package/dist/mod.d.cts +1 -1
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +113 -1
- package/dist/tests/decimal.test.cjs +1 -1
- package/dist/tests/decimal.test.mjs +1 -1
- package/dist/tests/{docloader-BLb7n2Ee.mjs → docloader-B_n1Fvv6.mjs} +496 -379
- package/dist/tests/{docloader-BWFjg4zU.cjs → docloader-y_0ATxGw.cjs} +501 -378
- package/dist/tests/docloader.test.cjs +11 -2
- package/dist/tests/docloader.test.mjs +11 -2
- package/dist/tests/{request-C49So-sz.cjs → request-CBsvHmNG.cjs} +1 -1
- package/dist/tests/{request-DUm2bK6k.mjs → request-DtrJ65EW.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/cid-v1.json +114 -0
- package/src/contexts.ts +9 -0
- package/src/docloader.test.ts +16 -0
- package/src/docloader.ts +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs");
|
|
2
|
-
const require_docloader = require("./docloader-
|
|
3
|
-
const require_request = require("./request-
|
|
2
|
+
const require_docloader = require("./docloader-y_0ATxGw.cjs");
|
|
3
|
+
const require_request = require("./request-CBsvHmNG.cjs");
|
|
4
4
|
const require_url = require("./url-CPfMatUL.cjs");
|
|
5
5
|
let node_assert = require("node:assert");
|
|
6
6
|
let node_test = require("node:test");
|
|
@@ -1490,6 +1490,15 @@ var esm_default = new class FetchMock {
|
|
|
1490
1490
|
document
|
|
1491
1491
|
});
|
|
1492
1492
|
});
|
|
1493
|
+
esm_default.get("https://www.w3.org/ns/cid/v1", { status: 503 });
|
|
1494
|
+
await t.test("preloaded CID v1 context", async () => {
|
|
1495
|
+
const url = "https://www.w3.org/ns/cid/v1";
|
|
1496
|
+
(0, node_assert.deepStrictEqual)(await fetchDocumentLoader(url), {
|
|
1497
|
+
contextUrl: null,
|
|
1498
|
+
documentUrl: url,
|
|
1499
|
+
document: require_docloader.cid_v1_default
|
|
1500
|
+
});
|
|
1501
|
+
});
|
|
1493
1502
|
await t.test("preloaded FEP-ef61 context", async () => {
|
|
1494
1503
|
const url = "https://w3id.org/fep/ef61";
|
|
1495
1504
|
(0, node_assert.ok)(url in require_docloader.preloadedContexts);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as getRemoteDocument, r as preloadedContexts, t as getDocumentLoader } from "./docloader-
|
|
2
|
-
import { t as FetchError } from "./request-
|
|
1
|
+
import { i as cid_v1_default, n as getRemoteDocument, r as preloadedContexts, t as getDocumentLoader } from "./docloader-B_n1Fvv6.mjs";
|
|
2
|
+
import { t as FetchError } from "./request-DtrJ65EW.mjs";
|
|
3
3
|
import { t as UrlError } from "./url-Basm1L_c.mjs";
|
|
4
4
|
import { deepStrictEqual, ok, rejects } from "node:assert";
|
|
5
5
|
import { test } from "node:test";
|
|
@@ -1509,6 +1509,15 @@ test("getDocumentLoader()", async (t) => {
|
|
|
1509
1509
|
document
|
|
1510
1510
|
});
|
|
1511
1511
|
});
|
|
1512
|
+
esm_default.get("https://www.w3.org/ns/cid/v1", { status: 503 });
|
|
1513
|
+
await t.test("preloaded CID v1 context", async () => {
|
|
1514
|
+
const url = "https://www.w3.org/ns/cid/v1";
|
|
1515
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
1516
|
+
contextUrl: null,
|
|
1517
|
+
documentUrl: url,
|
|
1518
|
+
document: cid_v1_default
|
|
1519
|
+
});
|
|
1520
|
+
});
|
|
1512
1521
|
await t.test("preloaded FEP-ef61 context", async () => {
|
|
1513
1522
|
const url = "https://w3id.org/fep/ef61";
|
|
1514
1523
|
ok(url in preloadedContexts);
|
|
@@ -3,7 +3,7 @@ let node_process = require("node:process");
|
|
|
3
3
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
4
4
|
//#region deno.json
|
|
5
5
|
var name = "@fedify/vocab-runtime";
|
|
6
|
-
var version = "2.4.0-dev.
|
|
6
|
+
var version = "2.4.0-dev.1881+17358f2e";
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/request.ts
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.cjs");
|
|
2
|
-
const require_request = require("./request-
|
|
2
|
+
const require_request = require("./request-CBsvHmNG.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-DtrJ65EW.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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": {
|
|
3
|
+
"@protected": true,
|
|
4
|
+
"id": "@id",
|
|
5
|
+
"type": "@type",
|
|
6
|
+
|
|
7
|
+
"alsoKnownAs": {
|
|
8
|
+
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
|
|
9
|
+
"@type": "@id"
|
|
10
|
+
},
|
|
11
|
+
"assertionMethod": {
|
|
12
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
13
|
+
"@type": "@id",
|
|
14
|
+
"@container": "@set"
|
|
15
|
+
},
|
|
16
|
+
"authentication": {
|
|
17
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
18
|
+
"@type": "@id",
|
|
19
|
+
"@container": "@set"
|
|
20
|
+
},
|
|
21
|
+
"capabilityDelegation": {
|
|
22
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
23
|
+
"@type": "@id",
|
|
24
|
+
"@container": "@set"
|
|
25
|
+
},
|
|
26
|
+
"capabilityInvocation": {
|
|
27
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
28
|
+
"@type": "@id",
|
|
29
|
+
"@container": "@set"
|
|
30
|
+
},
|
|
31
|
+
"controller": {
|
|
32
|
+
"@id": "https://w3id.org/security#controller",
|
|
33
|
+
"@type": "@id"
|
|
34
|
+
},
|
|
35
|
+
"keyAgreement": {
|
|
36
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
37
|
+
"@type": "@id",
|
|
38
|
+
"@container": "@set"
|
|
39
|
+
},
|
|
40
|
+
"service": {
|
|
41
|
+
"@id": "https://www.w3.org/ns/did#service",
|
|
42
|
+
"@type": "@id",
|
|
43
|
+
"@context": {
|
|
44
|
+
"@protected": true,
|
|
45
|
+
"id": "@id",
|
|
46
|
+
"type": "@type",
|
|
47
|
+
"serviceEndpoint": {
|
|
48
|
+
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
|
|
49
|
+
"@type": "@id"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"verificationMethod": {
|
|
54
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
55
|
+
"@type": "@id"
|
|
56
|
+
},
|
|
57
|
+
"Multikey": {
|
|
58
|
+
"@id": "https://w3id.org/security#Multikey",
|
|
59
|
+
"@context": {
|
|
60
|
+
"@protected": true,
|
|
61
|
+
"id": "@id",
|
|
62
|
+
"type": "@type",
|
|
63
|
+
"controller": {
|
|
64
|
+
"@id": "https://w3id.org/security#controller",
|
|
65
|
+
"@type": "@id"
|
|
66
|
+
},
|
|
67
|
+
"revoked": {
|
|
68
|
+
"@id": "https://w3id.org/security#revoked",
|
|
69
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
70
|
+
},
|
|
71
|
+
"expires": {
|
|
72
|
+
"@id": "https://w3id.org/security#expiration",
|
|
73
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
74
|
+
},
|
|
75
|
+
"publicKeyMultibase": {
|
|
76
|
+
"@id": "https://w3id.org/security#publicKeyMultibase",
|
|
77
|
+
"@type": "https://w3id.org/security#multibase"
|
|
78
|
+
},
|
|
79
|
+
"secretKeyMultibase": {
|
|
80
|
+
"@id": "https://w3id.org/security#secretKeyMultibase",
|
|
81
|
+
"@type": "https://w3id.org/security#multibase"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"JsonWebKey": {
|
|
86
|
+
"@id": "https://w3id.org/security#JsonWebKey",
|
|
87
|
+
"@context": {
|
|
88
|
+
"@protected": true,
|
|
89
|
+
"id": "@id",
|
|
90
|
+
"type": "@type",
|
|
91
|
+
"controller": {
|
|
92
|
+
"@id": "https://w3id.org/security#controller",
|
|
93
|
+
"@type": "@id"
|
|
94
|
+
},
|
|
95
|
+
"revoked": {
|
|
96
|
+
"@id": "https://w3id.org/security#revoked",
|
|
97
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
98
|
+
},
|
|
99
|
+
"expires": {
|
|
100
|
+
"@id": "https://w3id.org/security#expiration",
|
|
101
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
102
|
+
},
|
|
103
|
+
"publicKeyJwk": {
|
|
104
|
+
"@id": "https://w3id.org/security#publicKeyJwk",
|
|
105
|
+
"@type": "@json"
|
|
106
|
+
},
|
|
107
|
+
"secretKeyJwk": {
|
|
108
|
+
"@id": "https://w3id.org/security#secretKeyJwk",
|
|
109
|
+
"@type": "@json"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
package/src/contexts.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import activitystreams from "./contexts/activitystreams.json" with {
|
|
6
6
|
type: "json",
|
|
7
7
|
};
|
|
8
|
+
import cidV1Context from "./contexts/cid-v1.json" with { type: "json" };
|
|
8
9
|
import didV1 from "./contexts/did-v1.json" with { type: "json" };
|
|
9
10
|
import fep5711 from "./contexts/fep-5711.json" with { type: "json" };
|
|
10
11
|
import fep7aa9 from "./contexts/fep-7aa9.json" with { type: "json" };
|
|
@@ -40,6 +41,14 @@ const preloadedContexts: Record<string, unknown> = {
|
|
|
40
41
|
"https://w3id.org/fep/5711": fep5711,
|
|
41
42
|
"https://w3id.org/fep/7aa9": fep7aa9,
|
|
42
43
|
|
|
44
|
+
// Controlled Identifiers v1.0 requires JSON-LD processors to treat this
|
|
45
|
+
// context URL as already resolved. We ship the official W3C context so that
|
|
46
|
+
// controlled identifier documents can be processed without depending on the
|
|
47
|
+
// availability of the remote context server.
|
|
48
|
+
// See: https://www.w3.org/TR/cid-1.0/#json-ld-context
|
|
49
|
+
// https://github.com/fedify-dev/fedify/issues/932
|
|
50
|
+
"https://www.w3.org/ns/cid/v1": cidV1Context,
|
|
51
|
+
|
|
43
52
|
// The FEP-ef61 context. The w3id.org URL redirects to Codeberg Pages, which
|
|
44
53
|
// suffers recurring outages; while it is unreachable, every document
|
|
45
54
|
// referencing this URL fails JSON-LD expansion before application handlers
|
package/src/docloader.test.ts
CHANGED
|
@@ -2,6 +2,7 @@ import fetchMock from "fetch-mock";
|
|
|
2
2
|
import { deepStrictEqual, ok, rejects } from "node:assert";
|
|
3
3
|
import { test } from "node:test";
|
|
4
4
|
import preloadedContexts from "./contexts.ts";
|
|
5
|
+
import cidV1Context from "./contexts/cid-v1.json" with { type: "json" };
|
|
5
6
|
import { getDocumentLoader, getRemoteDocument } from "./docloader.ts";
|
|
6
7
|
import { FetchError } from "./request.ts";
|
|
7
8
|
import { UrlError } from "./url.ts";
|
|
@@ -389,6 +390,21 @@ test("getDocumentLoader()", async (t) => {
|
|
|
389
390
|
}
|
|
390
391
|
});
|
|
391
392
|
|
|
393
|
+
// Controlled Identifiers v1.0 requires JSON-LD processors to treat this
|
|
394
|
+
// context URL as already resolved. A temporary W3C outage must not prevent
|
|
395
|
+
// an otherwise valid document from being processed.
|
|
396
|
+
// See: https://www.w3.org/TR/cid-1.0/#json-ld-context
|
|
397
|
+
// https://github.com/fedify-dev/fedify/issues/932
|
|
398
|
+
fetchMock.get("https://www.w3.org/ns/cid/v1", { status: 503 });
|
|
399
|
+
await t.test("preloaded CID v1 context", async () => {
|
|
400
|
+
const url = "https://www.w3.org/ns/cid/v1";
|
|
401
|
+
deepStrictEqual(await fetchDocumentLoader(url), {
|
|
402
|
+
contextUrl: null,
|
|
403
|
+
documentUrl: url,
|
|
404
|
+
document: cidV1Context,
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
|
|
392
408
|
// The <https://w3id.org/fep/ef61> URL redirects to a Codeberg Pages host
|
|
393
409
|
// which suffers recurring outages; while it is unreachable, expanding any
|
|
394
410
|
// document referencing it fails before application handlers run. It has to
|
package/src/docloader.ts
CHANGED
|
@@ -353,6 +353,7 @@ export interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
|
|
|
353
353
|
* - <https://w3id.org/security/data-integrity/v1>
|
|
354
354
|
* - <https://w3id.org/security/data-integrity/v2>
|
|
355
355
|
* - <https://www.w3.org/ns/did/v1>
|
|
356
|
+
* - <https://www.w3.org/ns/cid/v1>
|
|
356
357
|
* - <https://w3id.org/security/multikey/v1>
|
|
357
358
|
* - <https://w3id.org/fep/ef61>
|
|
358
359
|
* - <https://purl.archive.org/socialweb/webfinger>
|