@fedify/vocab-runtime 2.3.5 → 2.3.7

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.
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require("./chunk-C2EiDwsr.cjs");
2
- const require_docloader = require("./docloader-tdU-3Xzs.cjs");
3
- const require_request = require("./request-CjvsZ9kT.cjs");
2
+ const require_docloader = require("./docloader-hPeotBri.cjs");
3
+ const require_request = require("./request-Cj1FlU8G.cjs");
4
4
  const require_url = require("./url-BF_Nb_Cu.cjs");
5
5
  let node_assert = require("node:assert");
6
6
  let node_test = require("node:test");
@@ -1431,6 +1431,15 @@ var esm_default = new class FetchMock {
1431
1431
  document
1432
1432
  });
1433
1433
  });
1434
+ esm_default.get("https://www.w3.org/ns/cid/v1", { status: 503 });
1435
+ await t.test("preloaded CID v1 context", async () => {
1436
+ const url = "https://www.w3.org/ns/cid/v1";
1437
+ (0, node_assert.deepStrictEqual)(await fetchDocumentLoader(url), {
1438
+ contextUrl: null,
1439
+ documentUrl: url,
1440
+ document: require_docloader.cid_v1_default
1441
+ });
1442
+ });
1434
1443
  await t.test("preloaded FEP-ef61 context", async () => {
1435
1444
  const url = "https://w3id.org/fep/ef61";
1436
1445
  (0, node_assert.ok)(url in require_docloader.preloadedContexts);
@@ -1,5 +1,5 @@
1
- import { n as preloadedContexts, t as getDocumentLoader } from "./docloader-bcolBlfC.mjs";
2
- import { t as FetchError } from "./request-ObdjC6Ss.mjs";
1
+ import { n as preloadedContexts, r as cid_v1_default, t as getDocumentLoader } from "./docloader-DI-3ZVtd.mjs";
2
+ import { t as FetchError } from "./request-BMbeYb8u.mjs";
3
3
  import { t as UrlError } from "./url-o0e-aXQY.mjs";
4
4
  import { deepStrictEqual, ok, rejects } from "node:assert";
5
5
  import { test } from "node:test";
@@ -1450,6 +1450,15 @@ test("getDocumentLoader()", async (t) => {
1450
1450
  document
1451
1451
  });
1452
1452
  });
1453
+ esm_default.get("https://www.w3.org/ns/cid/v1", { status: 503 });
1454
+ await t.test("preloaded CID v1 context", async () => {
1455
+ const url = "https://www.w3.org/ns/cid/v1";
1456
+ deepStrictEqual(await fetchDocumentLoader(url), {
1457
+ contextUrl: null,
1458
+ documentUrl: url,
1459
+ document: cid_v1_default
1460
+ });
1461
+ });
1453
1462
  await t.test("preloaded FEP-ef61 context", async () => {
1454
1463
  const url = "https://w3id.org/fep/ef61";
1455
1464
  ok(url in preloadedContexts);
@@ -1,7 +1,7 @@
1
1
  import process from "node:process";
2
2
  //#region deno.json
3
3
  var name = "@fedify/vocab-runtime";
4
- var version = "2.3.5";
4
+ var version = "2.3.7";
5
5
  //#endregion
6
6
  //#region src/request.ts
7
7
  /**
@@ -3,7 +3,7 @@ let node_process = require("node:process");
3
3
  node_process = require_chunk.__toESM(node_process, 1);
4
4
  //#region deno.json
5
5
  var name = "@fedify/vocab-runtime";
6
- var version = "2.3.5";
6
+ var version = "2.3.7";
7
7
  //#endregion
8
8
  //#region src/request.ts
9
9
  /**
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-C2EiDwsr.cjs");
2
- const require_request = require("./request-CjvsZ9kT.cjs");
2
+ const require_request = require("./request-Cj1FlU8G.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-ObdjC6Ss.mjs";
1
+ import { o as version, r as getUserAgent } from "./request-BMbeYb8u.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-runtime",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "homepage": "https://fedify.dev/",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 fepEf61 from "./contexts/fep-ef61.json" with { type: "json" };
@@ -38,6 +39,14 @@ const preloadedContexts: Record<string, unknown> = {
38
39
  "https://gotosocial.org/ns": gotosocial,
39
40
  "https://w3id.org/fep/5711": fep5711,
40
41
 
42
+ // Controlled Identifiers v1.0 requires JSON-LD processors to treat this
43
+ // context URL as already resolved. We ship the official W3C context so that
44
+ // controlled identifier documents can be processed without depending on the
45
+ // availability of the remote context server.
46
+ // See: https://www.w3.org/TR/cid-1.0/#json-ld-context
47
+ // https://github.com/fedify-dev/fedify/issues/932
48
+ "https://www.w3.org/ns/cid/v1": cidV1Context,
49
+
41
50
  // The FEP-ef61 context. The w3id.org URL redirects to Codeberg Pages, which
42
51
  // suffers recurring outages; while it is unreachable, every document
43
52
  // referencing this URL fails JSON-LD expansion before application handlers
@@ -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 } from "./docloader.ts";
6
7
  import { FetchError } from "./request.ts";
7
8
  import { UrlError } from "./url.ts";
@@ -293,6 +294,21 @@ test("getDocumentLoader()", async (t) => {
293
294
  }
294
295
  });
295
296
 
297
+ // Controlled Identifiers v1.0 requires JSON-LD processors to treat this
298
+ // context URL as already resolved. A temporary W3C outage must not prevent
299
+ // an otherwise valid document from being processed.
300
+ // See: https://www.w3.org/TR/cid-1.0/#json-ld-context
301
+ // https://github.com/fedify-dev/fedify/issues/932
302
+ fetchMock.get("https://www.w3.org/ns/cid/v1", { status: 503 });
303
+ await t.test("preloaded CID v1 context", async () => {
304
+ const url = "https://www.w3.org/ns/cid/v1";
305
+ deepStrictEqual(await fetchDocumentLoader(url), {
306
+ contextUrl: null,
307
+ documentUrl: url,
308
+ document: cidV1Context,
309
+ });
310
+ });
311
+
296
312
  // The <https://w3id.org/fep/ef61> URL redirects to a Codeberg Pages host
297
313
  // which suffers recurring outages; while it is unreachable, expanding any
298
314
  // document referencing it fails before application handlers run. It has to
package/src/docloader.ts CHANGED
@@ -284,6 +284,7 @@ export interface GetDocumentLoaderOptions extends DocumentLoaderFactoryOptions {
284
284
  * - <https://w3id.org/security/v1>
285
285
  * - <https://w3id.org/security/data-integrity/v1>
286
286
  * - <https://www.w3.org/ns/did/v1>
287
+ * - <https://www.w3.org/ns/cid/v1>
287
288
  * - <https://w3id.org/security/multikey/v1>
288
289
  * - <https://w3id.org/fep/ef61>
289
290
  * - <https://purl.archive.org/socialweb/webfinger>