@fedify/vocab-runtime 2.0.25-dev.1852 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-runtime",
3
- "version": "2.0.25-dev.1852+67dc0ece",
3
+ "version": "2.0.25-dev.1855+e105cb5b",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts",
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#",
@@ -4277,6 +4287,7 @@ const preloadedContexts = {
4277
4287
  "@type": "@id"
4278
4288
  }
4279
4289
  } },
4290
+ "https://w3id.org/fep/ef61": fep_ef61_default,
4280
4291
  "https://join-lemmy.org/context.json": join_lemmy_default,
4281
4292
  "http://joinmastodon.org/ns": { "@context": {
4282
4293
  "toot": "http://joinmastodon.org/ns#",
@@ -4309,7 +4320,7 @@ const preloadedContexts = {
4309
4320
  //#endregion
4310
4321
  //#region deno.json
4311
4322
  var name = "@fedify/vocab-runtime";
4312
- var version = "2.0.25-dev.1852+67dc0ece";
4323
+ var version = "2.0.25-dev.1855+e105cb5b";
4313
4324
  //#endregion
4314
4325
  //#region src/link.ts
4315
4326
  const parametersNeedLowerCase = ["rel", "type"];
@@ -4871,6 +4882,7 @@ async function getRemoteDocument(url, response, fetch) {
4871
4882
  * - <https://w3id.org/security/data-integrity/v1>
4872
4883
  * - <https://www.w3.org/ns/did/v1>
4873
4884
  * - <https://w3id.org/security/multikey/v1>
4885
+ * - <https://w3id.org/fep/ef61>
4874
4886
  * - <https://purl.archive.org/socialweb/webfinger>
4875
4887
  * - <http://schema.org/>
4876
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#",
@@ -4273,6 +4283,7 @@ const preloadedContexts = {
4273
4283
  "@type": "@id"
4274
4284
  }
4275
4285
  } },
4286
+ "https://w3id.org/fep/ef61": fep_ef61_default,
4276
4287
  "https://join-lemmy.org/context.json": join_lemmy_default,
4277
4288
  "http://joinmastodon.org/ns": { "@context": {
4278
4289
  "toot": "http://joinmastodon.org/ns#",
@@ -4305,7 +4316,7 @@ const preloadedContexts = {
4305
4316
  //#endregion
4306
4317
  //#region deno.json
4307
4318
  var name = "@fedify/vocab-runtime";
4308
- var version = "2.0.25-dev.1852+67dc0ece";
4319
+ var version = "2.0.25-dev.1855+e105cb5b";
4309
4320
  //#endregion
4310
4321
  //#region src/link.ts
4311
4322
  const parametersNeedLowerCase = ["rel", "type"];
@@ -4867,6 +4878,7 @@ async function getRemoteDocument(url, response, fetch) {
4867
4878
  * - <https://w3id.org/security/data-integrity/v1>
4868
4879
  * - <https://www.w3.org/ns/did/v1>
4869
4880
  * - <https://w3id.org/security/multikey/v1>
4881
+ * - <https://w3id.org/fep/ef61>
4870
4882
  * - <https://purl.archive.org/socialweb/webfinger>
4871
4883
  * - <http://schema.org/>
4872
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-C1qdHAIE.cjs");
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#",
@@ -5470,6 +5480,7 @@ const preloadedContexts = {
5470
5480
  "@type": "@id"
5471
5481
  }
5472
5482
  } },
5483
+ "https://w3id.org/fep/ef61": fep_ef61_default,
5473
5484
  "https://join-lemmy.org/context.json": join_lemmy_default,
5474
5485
  "http://joinmastodon.org/ns": { "@context": {
5475
5486
  "toot": "http://joinmastodon.org/ns#",
@@ -5615,6 +5626,7 @@ async function getRemoteDocument(url, response, fetch) {
5615
5626
  * - <https://w3id.org/security/data-integrity/v1>
5616
5627
  * - <https://www.w3.org/ns/did/v1>
5617
5628
  * - <https://w3id.org/security/multikey/v1>
5629
+ * - <https://w3id.org/fep/ef61>
5618
5630
  * - <https://purl.archive.org/socialweb/webfinger>
5619
5631
  * - <http://schema.org/>
5620
5632
  * @param options Options for the document loader.
@@ -5916,6 +5928,22 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
5916
5928
  document
5917
5929
  });
5918
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
+ });
5919
5947
  await t.test("deny non-HTTP/HTTPS", async () => {
5920
5948
  await (0, node_assert.rejects)(() => fetchDocumentLoader("ftp://localhost"), require_url.UrlError);
5921
5949
  });
@@ -1,4 +1,4 @@
1
- import { a as name, i as logRequest, n as createActivityPubRequest, o as version, t as FetchError } from "./request-DVdb_5sz.mjs";
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#",
@@ -5489,6 +5499,7 @@ const preloadedContexts = {
5489
5499
  "@type": "@id"
5490
5500
  }
5491
5501
  } },
5502
+ "https://w3id.org/fep/ef61": fep_ef61_default,
5492
5503
  "https://join-lemmy.org/context.json": join_lemmy_default,
5493
5504
  "http://joinmastodon.org/ns": { "@context": {
5494
5505
  "toot": "http://joinmastodon.org/ns#",
@@ -5634,6 +5645,7 @@ async function getRemoteDocument(url, response, fetch) {
5634
5645
  * - <https://w3id.org/security/data-integrity/v1>
5635
5646
  * - <https://www.w3.org/ns/did/v1>
5636
5647
  * - <https://w3id.org/security/multikey/v1>
5648
+ * - <https://w3id.org/fep/ef61>
5637
5649
  * - <https://purl.archive.org/socialweb/webfinger>
5638
5650
  * - <http://schema.org/>
5639
5651
  * @param options Options for the document loader.
@@ -5935,6 +5947,22 @@ test("getDocumentLoader()", async (t) => {
5935
5947
  document
5936
5948
  });
5937
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
+ });
5938
5966
  await t.test("deny non-HTTP/HTTPS", async () => {
5939
5967
  await rejects(() => fetchDocumentLoader("ftp://localhost"), UrlError);
5940
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.1852+67dc0ece";
6
+ var version = "2.0.25-dev.1855+e105cb5b";
7
7
  //#endregion
8
8
  //#region src/request.ts
9
9
  /**
@@ -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.0.25-dev.1852+67dc0ece";
4
+ var version = "2.0.25-dev.1855+e105cb5b";
5
5
  //#endregion
6
6
  //#region src/request.ts
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Do9eywBl.cjs");
2
- const require_request = require("./request-C1qdHAIE.cjs");
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-DVdb_5sz.mjs";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/vocab-runtime",
3
- "version": "2.0.25-dev.1852+67dc0ece",
3
+ "version": "2.0.25-dev.1855+e105cb5b",
4
4
  "homepage": "https://fedify.dev/",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,10 @@
1
+ {
2
+ "@context": {
3
+ "gateways": {
4
+ "@id": "https://w3id.org/fep/ef61/gateways",
5
+ "@type": "@id",
6
+ "@container": "@list"
7
+ },
8
+ "digestMultibase": "https://www.w3.org/ns/credentials/v2#digestMultibase"
9
+ }
10
+ }
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
@@ -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.