@fedify/vocab 2.4.0-dev.2253 → 2.4.0-dev.2259
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 +16 -16
- package/dist/mod.js +17 -17
- package/dist-tests/{actor-DCIUFb1g.mjs → actor-D-QhsWL6.mjs} +2 -2
- package/dist-tests/actor.test.mjs +3 -3
- package/dist-tests/{esm-DV51XH1a.mjs → esm-CS5DInHn.mjs} +1 -1
- package/dist-tests/gateway.test.mjs +3 -3
- package/dist-tests/{lookup-M2tD6NRg.mjs → lookup-DrPGhvJ6.mjs} +2 -2
- package/dist-tests/lookup.test.mjs +3 -3
- package/dist-tests/portable-lookup.test.mjs +4 -4
- package/dist-tests/signed-representation.test.mjs +1 -1
- package/dist-tests/translation.test.mjs +3 -3
- package/dist-tests/type.test.mjs +1 -1
- package/dist-tests/{vocab-TRdTohG6.mjs → vocab-qCLWHa7T.mjs} +16 -16
- package/dist-tests/vocab.test.mjs +100 -5
- package/package.json +4 -4
- package/src/vocab.test.ts +111 -3
package/deno.json
CHANGED
package/dist/mod.cjs
CHANGED
|
@@ -36,7 +36,7 @@ let _fedify_vocab_runtime_temporal = require("@fedify/vocab-runtime/temporal");
|
|
|
36
36
|
let es_toolkit = require("es-toolkit");
|
|
37
37
|
//#region deno.json
|
|
38
38
|
var name = "@fedify/vocab";
|
|
39
|
-
var version = "2.4.0-dev.
|
|
39
|
+
var version = "2.4.0-dev.2259+d9c843fc";
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/type.ts
|
|
42
42
|
function getTypeId(object) {
|
|
@@ -39468,7 +39468,7 @@ var Application = class Application extends Object$1 {
|
|
|
39468
39468
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
39469
39469
|
compactItems = [];
|
|
39470
39470
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
39471
|
-
const item =
|
|
39471
|
+
const item = v.origin;
|
|
39472
39472
|
compactItems.push(item);
|
|
39473
39473
|
}
|
|
39474
39474
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -39777,7 +39777,7 @@ var Application = class Application extends Object$1 {
|
|
|
39777
39777
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
39778
39778
|
array = [];
|
|
39779
39779
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
39780
|
-
let element = { "@id":
|
|
39780
|
+
let element = { "@id": v.origin };
|
|
39781
39781
|
if (Array.isArray(element)) {
|
|
39782
39782
|
if (element.length < 1) continue;
|
|
39783
39783
|
if (element.length == 1) element = element[0];
|
|
@@ -40208,7 +40208,7 @@ var Application = class Application extends Object$1 {
|
|
|
40208
40208
|
}
|
|
40209
40209
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
40210
40210
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
40211
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
40211
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = (0, _fedify_vocab_runtime_internal_jsonld_cache.getPortableActorGateways)(values);
|
|
40212
40212
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
40213
40213
|
if (v == null) continue;
|
|
40214
40214
|
const decoded = (0, _fedify_vocab_runtime.parseGatewayUrl)(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -50092,7 +50092,7 @@ var Group = class Group extends Object$1 {
|
|
|
50092
50092
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
50093
50093
|
compactItems = [];
|
|
50094
50094
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
50095
|
-
const item =
|
|
50095
|
+
const item = v.origin;
|
|
50096
50096
|
compactItems.push(item);
|
|
50097
50097
|
}
|
|
50098
50098
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -50401,7 +50401,7 @@ var Group = class Group extends Object$1 {
|
|
|
50401
50401
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
50402
50402
|
array = [];
|
|
50403
50403
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
50404
|
-
let element = { "@id":
|
|
50404
|
+
let element = { "@id": v.origin };
|
|
50405
50405
|
if (Array.isArray(element)) {
|
|
50406
50406
|
if (element.length < 1) continue;
|
|
50407
50407
|
if (element.length == 1) element = element[0];
|
|
@@ -50832,7 +50832,7 @@ var Group = class Group extends Object$1 {
|
|
|
50832
50832
|
}
|
|
50833
50833
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
50834
50834
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
50835
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
50835
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = (0, _fedify_vocab_runtime_internal_jsonld_cache.getPortableActorGateways)(values);
|
|
50836
50836
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
50837
50837
|
if (v == null) continue;
|
|
50838
50838
|
const decoded = (0, _fedify_vocab_runtime.parseGatewayUrl)(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -60141,7 +60141,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
60141
60141
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
60142
60142
|
compactItems = [];
|
|
60143
60143
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
60144
|
-
const item =
|
|
60144
|
+
const item = v.origin;
|
|
60145
60145
|
compactItems.push(item);
|
|
60146
60146
|
}
|
|
60147
60147
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -60450,7 +60450,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
60450
60450
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
60451
60451
|
array = [];
|
|
60452
60452
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
60453
|
-
let element = { "@id":
|
|
60453
|
+
let element = { "@id": v.origin };
|
|
60454
60454
|
if (Array.isArray(element)) {
|
|
60455
60455
|
if (element.length < 1) continue;
|
|
60456
60456
|
if (element.length == 1) element = element[0];
|
|
@@ -60881,7 +60881,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
60881
60881
|
}
|
|
60882
60882
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
60883
60883
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
60884
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
60884
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = (0, _fedify_vocab_runtime_internal_jsonld_cache.getPortableActorGateways)(values);
|
|
60885
60885
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
60886
60886
|
if (v == null) continue;
|
|
60887
60887
|
const decoded = (0, _fedify_vocab_runtime.parseGatewayUrl)(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -65776,7 +65776,7 @@ var Person = class Person extends Object$1 {
|
|
|
65776
65776
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
65777
65777
|
compactItems = [];
|
|
65778
65778
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
65779
|
-
const item =
|
|
65779
|
+
const item = v.origin;
|
|
65780
65780
|
compactItems.push(item);
|
|
65781
65781
|
}
|
|
65782
65782
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -66085,7 +66085,7 @@ var Person = class Person extends Object$1 {
|
|
|
66085
66085
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
66086
66086
|
array = [];
|
|
66087
66087
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
66088
|
-
let element = { "@id":
|
|
66088
|
+
let element = { "@id": v.origin };
|
|
66089
66089
|
if (Array.isArray(element)) {
|
|
66090
66090
|
if (element.length < 1) continue;
|
|
66091
66091
|
if (element.length == 1) element = element[0];
|
|
@@ -66516,7 +66516,7 @@ var Person = class Person extends Object$1 {
|
|
|
66516
66516
|
}
|
|
66517
66517
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
66518
66518
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
66519
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
66519
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = (0, _fedify_vocab_runtime_internal_jsonld_cache.getPortableActorGateways)(values);
|
|
66520
66520
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
66521
66521
|
if (v == null) continue;
|
|
66522
66522
|
const decoded = (0, _fedify_vocab_runtime.parseGatewayUrl)(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -75541,7 +75541,7 @@ var Service = class Service extends Object$1 {
|
|
|
75541
75541
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
75542
75542
|
compactItems = [];
|
|
75543
75543
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
75544
|
-
const item =
|
|
75544
|
+
const item = v.origin;
|
|
75545
75545
|
compactItems.push(item);
|
|
75546
75546
|
}
|
|
75547
75547
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -75850,7 +75850,7 @@ var Service = class Service extends Object$1 {
|
|
|
75850
75850
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
75851
75851
|
array = [];
|
|
75852
75852
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
75853
|
-
let element = { "@id":
|
|
75853
|
+
let element = { "@id": v.origin };
|
|
75854
75854
|
if (Array.isArray(element)) {
|
|
75855
75855
|
if (element.length < 1) continue;
|
|
75856
75856
|
if (element.length == 1) element = element[0];
|
|
@@ -76281,7 +76281,7 @@ var Service = class Service extends Object$1 {
|
|
|
76281
76281
|
}
|
|
76282
76282
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
76283
76283
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
76284
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
76284
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = (0, _fedify_vocab_runtime_internal_jsonld_cache.getPortableActorGateways)(values);
|
|
76285
76285
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
76286
76286
|
if (v == null) continue;
|
|
76287
76287
|
const decoded = (0, _fedify_vocab_runtime.parseGatewayUrl)(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
package/dist/mod.js
CHANGED
|
@@ -5,14 +5,14 @@ import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
|
5
5
|
import { domainToASCII, domainToUnicode } from "node:url";
|
|
6
6
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
|
-
import { compactJsonLdCache, createScopedContextLoader, isTrustedIriOrigin, normalizeJsonLdIris } from "@fedify/vocab-runtime/internal/jsonld-cache";
|
|
8
|
+
import { compactJsonLdCache, createScopedContextLoader, getPortableActorGateways, isTrustedIriOrigin, normalizeJsonLdIris } from "@fedify/vocab-runtime/internal/jsonld-cache";
|
|
9
9
|
import { PortableObjectRejectedError, copyPortableProvenance, createSnapshotContextLoader, dereferencePortableIri, getPortableGatewayCandidates, getPortableResponseClaim, isPortableIri, isPortableMode, isUnsecuredPortableObject, isUnverifiedPortableClaim, markUnverifiedPortableClaim, mustDereferencePortableObject, parseCompatibleEf61Reference, recordPortableReferrer, rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from "@fedify/vocab-runtime/internal/portable-dereference";
|
|
10
10
|
import { enterSignedValueScope, resolveSignedValues, retainedSignedValueRef } from "@fedify/vocab-runtime/internal/signed-representation";
|
|
11
11
|
import { isTemporalDuration, isTemporalInstant } from "@fedify/vocab-runtime/temporal";
|
|
12
12
|
import { delay } from "es-toolkit";
|
|
13
13
|
//#region deno.json
|
|
14
14
|
var name = "@fedify/vocab";
|
|
15
|
-
var version = "2.4.0-dev.
|
|
15
|
+
var version = "2.4.0-dev.2259+d9c843fc";
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/type.ts
|
|
18
18
|
function getTypeId(object) {
|
|
@@ -35879,7 +35879,7 @@ var Application = class Application extends Object$1 {
|
|
|
35879
35879
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
35880
35880
|
compactItems = [];
|
|
35881
35881
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
35882
|
-
const item =
|
|
35882
|
+
const item = v.origin;
|
|
35883
35883
|
compactItems.push(item);
|
|
35884
35884
|
}
|
|
35885
35885
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -36188,7 +36188,7 @@ var Application = class Application extends Object$1 {
|
|
|
36188
36188
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
36189
36189
|
array = [];
|
|
36190
36190
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
36191
|
-
let element = { "@id":
|
|
36191
|
+
let element = { "@id": v.origin };
|
|
36192
36192
|
if (Array.isArray(element)) {
|
|
36193
36193
|
if (element.length < 1) continue;
|
|
36194
36194
|
if (element.length == 1) element = element[0];
|
|
@@ -36619,7 +36619,7 @@ var Application = class Application extends Object$1 {
|
|
|
36619
36619
|
}
|
|
36620
36620
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
36621
36621
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
36622
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
36622
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
36623
36623
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
36624
36624
|
if (v == null) continue;
|
|
36625
36625
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -46503,7 +46503,7 @@ var Group = class Group extends Object$1 {
|
|
|
46503
46503
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
46504
46504
|
compactItems = [];
|
|
46505
46505
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
46506
|
-
const item =
|
|
46506
|
+
const item = v.origin;
|
|
46507
46507
|
compactItems.push(item);
|
|
46508
46508
|
}
|
|
46509
46509
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -46812,7 +46812,7 @@ var Group = class Group extends Object$1 {
|
|
|
46812
46812
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
46813
46813
|
array = [];
|
|
46814
46814
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
46815
|
-
let element = { "@id":
|
|
46815
|
+
let element = { "@id": v.origin };
|
|
46816
46816
|
if (Array.isArray(element)) {
|
|
46817
46817
|
if (element.length < 1) continue;
|
|
46818
46818
|
if (element.length == 1) element = element[0];
|
|
@@ -47243,7 +47243,7 @@ var Group = class Group extends Object$1 {
|
|
|
47243
47243
|
}
|
|
47244
47244
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
47245
47245
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
47246
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
47246
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
47247
47247
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
47248
47248
|
if (v == null) continue;
|
|
47249
47249
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -56552,7 +56552,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
56552
56552
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
56553
56553
|
compactItems = [];
|
|
56554
56554
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
56555
|
-
const item =
|
|
56555
|
+
const item = v.origin;
|
|
56556
56556
|
compactItems.push(item);
|
|
56557
56557
|
}
|
|
56558
56558
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -56861,7 +56861,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
56861
56861
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
56862
56862
|
array = [];
|
|
56863
56863
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
56864
|
-
let element = { "@id":
|
|
56864
|
+
let element = { "@id": v.origin };
|
|
56865
56865
|
if (Array.isArray(element)) {
|
|
56866
56866
|
if (element.length < 1) continue;
|
|
56867
56867
|
if (element.length == 1) element = element[0];
|
|
@@ -57292,7 +57292,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
57292
57292
|
}
|
|
57293
57293
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
57294
57294
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
57295
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
57295
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
57296
57296
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
57297
57297
|
if (v == null) continue;
|
|
57298
57298
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -62187,7 +62187,7 @@ var Person = class Person extends Object$1 {
|
|
|
62187
62187
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
62188
62188
|
compactItems = [];
|
|
62189
62189
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
62190
|
-
const item =
|
|
62190
|
+
const item = v.origin;
|
|
62191
62191
|
compactItems.push(item);
|
|
62192
62192
|
}
|
|
62193
62193
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -62496,7 +62496,7 @@ var Person = class Person extends Object$1 {
|
|
|
62496
62496
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
62497
62497
|
array = [];
|
|
62498
62498
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
62499
|
-
let element = { "@id":
|
|
62499
|
+
let element = { "@id": v.origin };
|
|
62500
62500
|
if (Array.isArray(element)) {
|
|
62501
62501
|
if (element.length < 1) continue;
|
|
62502
62502
|
if (element.length == 1) element = element[0];
|
|
@@ -62927,7 +62927,7 @@ var Person = class Person extends Object$1 {
|
|
|
62927
62927
|
}
|
|
62928
62928
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
62929
62929
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
62930
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
62930
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
62931
62931
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
62932
62932
|
if (v == null) continue;
|
|
62933
62933
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -71952,7 +71952,7 @@ var Service = class Service extends Object$1 {
|
|
|
71952
71952
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
71953
71953
|
compactItems = [];
|
|
71954
71954
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
71955
|
-
const item =
|
|
71955
|
+
const item = v.origin;
|
|
71956
71956
|
compactItems.push(item);
|
|
71957
71957
|
}
|
|
71958
71958
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -72261,7 +72261,7 @@ var Service = class Service extends Object$1 {
|
|
|
72261
72261
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
72262
72262
|
array = [];
|
|
72263
72263
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
72264
|
-
let element = { "@id":
|
|
72264
|
+
let element = { "@id": v.origin };
|
|
72265
72265
|
if (Array.isArray(element)) {
|
|
72266
72266
|
if (element.length < 1) continue;
|
|
72267
72267
|
if (element.length == 1) element = element[0];
|
|
@@ -72692,7 +72692,7 @@ var Service = class Service extends Object$1 {
|
|
|
72692
72692
|
}
|
|
72693
72693
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
72694
72694
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
72695
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
72695
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
72696
72696
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
72697
72697
|
if (v == null) continue;
|
|
72698
72698
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { F as Person, P as Organization, U as Service, a as Application, b as Group } from "./vocab-
|
|
3
|
+
import { F as Person, P as Organization, U as Service, a as Application, b as Group } from "./vocab-qCLWHa7T.mjs";
|
|
4
4
|
import { t as getTypeId } from "./type-BMdjm4Eg.mjs";
|
|
5
5
|
import { canonicalizePortableUri, formatIri, fromCompatibleEf61Id, isGatewayUrl } from "@fedify/vocab-runtime";
|
|
6
6
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
@@ -8,7 +8,7 @@ import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
|
8
8
|
import { domainToASCII, domainToUnicode } from "node:url";
|
|
9
9
|
//#region deno.json
|
|
10
10
|
var name = "@fedify/vocab";
|
|
11
|
-
var version = "2.4.0-dev.
|
|
11
|
+
var version = "2.4.0-dev.2259+d9c843fc";
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/actor.ts
|
|
14
14
|
const ACTOR_DISCOVERY_HISTOGRAM_BUCKETS = [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { F as Person, P as Organization, Q as __exportAll, U as Service, a as Application, b as Group } from "./vocab-
|
|
4
|
-
import { t as esm_default } from "./esm-
|
|
5
|
-
import { a as normalizeActorHandle, i as isActor, n as getActorHandle, r as getActorTypeName, t as getActorClassByTypeName } from "./actor-
|
|
3
|
+
import { F as Person, P as Organization, Q as __exportAll, U as Service, a as Application, b as Group } from "./vocab-qCLWHa7T.mjs";
|
|
4
|
+
import { t as esm_default } from "./esm-CS5DInHn.mjs";
|
|
5
|
+
import { a as normalizeActorHandle, i as isActor, n as getActorHandle, r as getActorTypeName, t as getActorClassByTypeName } from "./actor-D-QhsWL6.mjs";
|
|
6
6
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
7
7
|
import { deepStrictEqual, ok, rejects, strictEqual, throws } from "node:assert/strict";
|
|
8
8
|
//#region ../../node_modules/.pnpm/fast-check@3.23.2/node_modules/fast-check/lib/esm/check/precondition/PreconditionFailure.js
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { $ as __toESM, Z as __commonJSMin } from "./vocab-
|
|
3
|
+
import { $ as __toESM, Z as __commonJSMin } from "./vocab-qCLWHa7T.mjs";
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region ../../node_modules/.pnpm/regexparam@3.0.0/node_modules/regexparam/dist/index.mjs
|
|
6
6
|
var import_glob_to_regexp = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { F as Person, M as OrderedCollection, S as Image, c as CollectionPage, k as Note, s as Collection, u as Create } from "./vocab-
|
|
4
|
-
import { t as esm_default } from "./esm-
|
|
5
|
-
import { n as traverseCollection, t as lookupObject } from "./lookup-
|
|
3
|
+
import { F as Person, M as OrderedCollection, S as Image, c as CollectionPage, k as Note, s as Collection, u as Create } from "./vocab-qCLWHa7T.mjs";
|
|
4
|
+
import { t as esm_default } from "./esm-CS5DInHn.mjs";
|
|
5
|
+
import { n as traverseCollection, t as lookupObject } from "./lookup-DrPGhvJ6.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "./utils-Df2odC27.mjs";
|
|
7
7
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
8
8
|
import { deepStrictEqual, ok, rejects } from "node:assert/strict";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { A as Object$1 } from "./vocab-
|
|
4
|
-
import { i as isActor, o as name, s as version } from "./actor-
|
|
3
|
+
import { A as Object$1 } from "./vocab-qCLWHa7T.mjs";
|
|
4
|
+
import { i as isActor, o as name, s as version } from "./actor-D-QhsWL6.mjs";
|
|
5
5
|
import { t as getTypeId } from "./type-BMdjm4Eg.mjs";
|
|
6
6
|
import { canonicalizePortableUri, formatIri, getDocumentLoader, haveSameFe34Origin, haveSameIriOrigin, parseIri } from "@fedify/vocab-runtime";
|
|
7
7
|
import { lookupWebFinger } from "@fedify/webfinger";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { A as Object$1, F as Person, k as Note, s as Collection } from "./vocab-
|
|
4
|
-
import { t as esm_default } from "./esm-
|
|
5
|
-
import { n as traverseCollection, t as lookupObject } from "./lookup-
|
|
3
|
+
import { A as Object$1, F as Person, k as Note, s as Collection } from "./vocab-qCLWHa7T.mjs";
|
|
4
|
+
import { t as esm_default } from "./esm-CS5DInHn.mjs";
|
|
5
|
+
import { n as traverseCollection, t as lookupObject } from "./lookup-DrPGhvJ6.mjs";
|
|
6
6
|
import { t as assertInstanceOf } from "./utils-Df2odC27.mjs";
|
|
7
7
|
import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
8
8
|
import { deepStrictEqual, equal, ok, rejects } from "node:assert/strict";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { F as Person } from "./vocab-
|
|
4
|
-
import { t as esm_default } from "./esm-
|
|
5
|
-
import { n as getActorHandle } from "./actor-
|
|
6
|
-
import { t as lookupObject } from "./lookup-
|
|
3
|
+
import { F as Person } from "./vocab-qCLWHa7T.mjs";
|
|
4
|
+
import { t as esm_default } from "./esm-CS5DInHn.mjs";
|
|
5
|
+
import { n as getActorHandle } from "./actor-D-QhsWL6.mjs";
|
|
6
|
+
import { t as lookupObject } from "./lookup-DrPGhvJ6.mjs";
|
|
7
7
|
import { t as assertInstanceOf } from "./utils-Df2odC27.mjs";
|
|
8
8
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
9
9
|
import { deepStrictEqual, equal, rejects } from "node:assert/strict";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { M as OrderedCollection, X as vocab_exports, i as Announce, k as Note, u as Create, z as Question } from "./vocab-
|
|
3
|
+
import { M as OrderedCollection, X as vocab_exports, i as Announce, k as Note, u as Create, z as Question } from "./vocab-qCLWHa7T.mjs";
|
|
4
4
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
5
5
|
import { deepStrictEqual, ok } from "node:assert/strict";
|
|
6
6
|
import { isMarkerSafeContext, retainSignedRepresentation } from "@fedify/vocab-runtime/internal/signed-representation";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { A as Object$1, E as Link, F as Person, K as Translation, L as PropertyValue, P as Organization, U as Service, a as Application, b as Group, k as Note, o as Article, q as Update, s as Collection, u as Create } from "./vocab-
|
|
4
|
-
import "./actor-
|
|
5
|
-
import "./lookup-
|
|
3
|
+
import { A as Object$1, E as Link, F as Person, K as Translation, L as PropertyValue, P as Organization, U as Service, a as Application, b as Group, k as Note, o as Article, q as Update, s as Collection, u as Create } from "./vocab-qCLWHa7T.mjs";
|
|
4
|
+
import "./actor-D-QhsWL6.mjs";
|
|
5
|
+
import "./lookup-DrPGhvJ6.mjs";
|
|
6
6
|
import { test } from "@fedify/fixture";
|
|
7
7
|
import { deepStrictEqual, ok, rejects } from "node:assert/strict";
|
|
8
8
|
import { LanguageString as LanguageString$1, getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
|
package/dist-tests/type.test.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { E as Link, F as Person, J as getEntityTypeById, Y as isEntityType } from "./vocab-
|
|
3
|
+
import { E as Link, F as Person, J as getEntityTypeById, Y as isEntityType } from "./vocab-qCLWHa7T.mjs";
|
|
4
4
|
import { t as getTypeId } from "./type-BMdjm4Eg.mjs";
|
|
5
5
|
import { test } from "@fedify/fixture";
|
|
6
6
|
import { deepStrictEqual } from "node:assert/strict";
|
|
@@ -5,7 +5,7 @@ import { LanguageString, decodeMultibase, encodeMultibase, exportMultibaseKey, e
|
|
|
5
5
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
6
6
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
7
7
|
import { getLogger } from "@logtape/logtape";
|
|
8
|
-
import { compactJsonLdCache, createScopedContextLoader, isTrustedIriOrigin, normalizeJsonLdIris } from "@fedify/vocab-runtime/internal/jsonld-cache";
|
|
8
|
+
import { compactJsonLdCache, createScopedContextLoader, getPortableActorGateways, isTrustedIriOrigin, normalizeJsonLdIris } from "@fedify/vocab-runtime/internal/jsonld-cache";
|
|
9
9
|
import { copyPortableProvenance, createSnapshotContextLoader, dereferencePortableIri, getPortableResponseClaim, isPortableIri, isPortableMode, isUnsecuredPortableObject, isUnverifiedPortableClaim, markUnverifiedPortableClaim, mustDereferencePortableObject, parseCompatibleEf61Reference, recordPortableReferrer, rejectMalformedCompatibleReference, warnUnverifiableEmbeddedObject } from "@fedify/vocab-runtime/internal/portable-dereference";
|
|
10
10
|
import { enterSignedValueScope, resolveSignedValues, retainedSignedValueRef } from "@fedify/vocab-runtime/internal/signed-representation";
|
|
11
11
|
import { isTemporalDuration, isTemporalInstant } from "@fedify/vocab-runtime/temporal";
|
|
@@ -35990,7 +35990,7 @@ var Application = class Application extends Object$1 {
|
|
|
35990
35990
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
35991
35991
|
compactItems = [];
|
|
35992
35992
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
35993
|
-
const item =
|
|
35993
|
+
const item = v.origin;
|
|
35994
35994
|
compactItems.push(item);
|
|
35995
35995
|
}
|
|
35996
35996
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -36299,7 +36299,7 @@ var Application = class Application extends Object$1 {
|
|
|
36299
36299
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
36300
36300
|
array = [];
|
|
36301
36301
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
36302
|
-
let element = { "@id":
|
|
36302
|
+
let element = { "@id": v.origin };
|
|
36303
36303
|
if (Array.isArray(element)) {
|
|
36304
36304
|
if (element.length < 1) continue;
|
|
36305
36305
|
if (element.length == 1) element = element[0];
|
|
@@ -36730,7 +36730,7 @@ var Application = class Application extends Object$1 {
|
|
|
36730
36730
|
}
|
|
36731
36731
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
36732
36732
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
36733
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
36733
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
36734
36734
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
36735
36735
|
if (v == null) continue;
|
|
36736
36736
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -46614,7 +46614,7 @@ var Group = class Group extends Object$1 {
|
|
|
46614
46614
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
46615
46615
|
compactItems = [];
|
|
46616
46616
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
46617
|
-
const item =
|
|
46617
|
+
const item = v.origin;
|
|
46618
46618
|
compactItems.push(item);
|
|
46619
46619
|
}
|
|
46620
46620
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -46923,7 +46923,7 @@ var Group = class Group extends Object$1 {
|
|
|
46923
46923
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
46924
46924
|
array = [];
|
|
46925
46925
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
46926
|
-
let element = { "@id":
|
|
46926
|
+
let element = { "@id": v.origin };
|
|
46927
46927
|
if (Array.isArray(element)) {
|
|
46928
46928
|
if (element.length < 1) continue;
|
|
46929
46929
|
if (element.length == 1) element = element[0];
|
|
@@ -47354,7 +47354,7 @@ var Group = class Group extends Object$1 {
|
|
|
47354
47354
|
}
|
|
47355
47355
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
47356
47356
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
47357
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
47357
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
47358
47358
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
47359
47359
|
if (v == null) continue;
|
|
47360
47360
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -56663,7 +56663,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
56663
56663
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
56664
56664
|
compactItems = [];
|
|
56665
56665
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
56666
|
-
const item =
|
|
56666
|
+
const item = v.origin;
|
|
56667
56667
|
compactItems.push(item);
|
|
56668
56668
|
}
|
|
56669
56669
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -56972,7 +56972,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
56972
56972
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
56973
56973
|
array = [];
|
|
56974
56974
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
56975
|
-
let element = { "@id":
|
|
56975
|
+
let element = { "@id": v.origin };
|
|
56976
56976
|
if (Array.isArray(element)) {
|
|
56977
56977
|
if (element.length < 1) continue;
|
|
56978
56978
|
if (element.length == 1) element = element[0];
|
|
@@ -57403,7 +57403,7 @@ var Organization = class Organization extends Object$1 {
|
|
|
57403
57403
|
}
|
|
57404
57404
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
57405
57405
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
57406
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
57406
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
57407
57407
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
57408
57408
|
if (v == null) continue;
|
|
57409
57409
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -62298,7 +62298,7 @@ var Person = class Person extends Object$1 {
|
|
|
62298
62298
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
62299
62299
|
compactItems = [];
|
|
62300
62300
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
62301
|
-
const item =
|
|
62301
|
+
const item = v.origin;
|
|
62302
62302
|
compactItems.push(item);
|
|
62303
62303
|
}
|
|
62304
62304
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -62607,7 +62607,7 @@ var Person = class Person extends Object$1 {
|
|
|
62607
62607
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
62608
62608
|
array = [];
|
|
62609
62609
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
62610
|
-
let element = { "@id":
|
|
62610
|
+
let element = { "@id": v.origin };
|
|
62611
62611
|
if (Array.isArray(element)) {
|
|
62612
62612
|
if (element.length < 1) continue;
|
|
62613
62613
|
if (element.length == 1) element = element[0];
|
|
@@ -63038,7 +63038,7 @@ var Person = class Person extends Object$1 {
|
|
|
63038
63038
|
}
|
|
63039
63039
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
63040
63040
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
63041
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
63041
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
63042
63042
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
63043
63043
|
if (v == null) continue;
|
|
63044
63044
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -72063,7 +72063,7 @@ var Service = class Service extends Object$1 {
|
|
|
72063
72063
|
if (compactItems.length > 0) result["assertionMethod"] = compactItems.length > 1 ? compactItems : compactItems[0];
|
|
72064
72064
|
compactItems = [];
|
|
72065
72065
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
72066
|
-
const item =
|
|
72066
|
+
const item = v.origin;
|
|
72067
72067
|
compactItems.push(item);
|
|
72068
72068
|
}
|
|
72069
72069
|
if (compactItems.length > 0) result["gateways"] = compactItems;
|
|
@@ -72372,7 +72372,7 @@ var Service = class Service extends Object$1 {
|
|
|
72372
72372
|
if (array.length > 0) values["https://w3id.org/security#assertionMethod"] = array;
|
|
72373
72373
|
array = [];
|
|
72374
72374
|
for (const v of this.#_hQiaHhZP8hqxckxTBrpsGNs57E3) {
|
|
72375
|
-
let element = { "@id":
|
|
72375
|
+
let element = { "@id": v.origin };
|
|
72376
72376
|
if (Array.isArray(element)) {
|
|
72377
72377
|
if (element.length < 1) continue;
|
|
72378
72378
|
if (element.length == 1) element = element[0];
|
|
@@ -72803,7 +72803,7 @@ var Service = class Service extends Object$1 {
|
|
|
72803
72803
|
}
|
|
72804
72804
|
instance.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod = _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod;
|
|
72805
72805
|
const _hQiaHhZP8hqxckxTBrpsGNs57E3 = [];
|
|
72806
|
-
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = values
|
|
72806
|
+
let _hQiaHhZP8hqxckxTBrpsGNs57E3__array = getPortableActorGateways(values);
|
|
72807
72807
|
for (const v of _hQiaHhZP8hqxckxTBrpsGNs57E3__array == null ? [] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array.length === 1 && "@list" in _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0] ? _hQiaHhZP8hqxckxTBrpsGNs57E3__array[0]["@list"] : _hQiaHhZP8hqxckxTBrpsGNs57E3__array) {
|
|
72808
72808
|
if (v == null) continue;
|
|
72809
72809
|
const decoded = parseGatewayUrl(typeof v["@id"] === "string" ? v["@id"] : v["@value"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
globalThis.addEventListener = () => {};
|
|
3
|
-
import { A as Object$1, B as QuoteAuthorization, C as Intent, D as Measure, E as Link, F as Person, G as Tombstone, H as Reject, I as Place, L as PropertyValue, N as OrderedCollectionPage, O as Multikey, P as Organization, R as Proposal, S as Image, T as InteractionRule, U as Service, V as QuoteRequest, W as Source, X as vocab_exports, _ as FeaturedCollection, a as Application, b as Group, d as CryptographicKey, f as Delete, g as FeatureRequest, h as FeatureAuthorization, i as Announce, j as Offer, k as Note, l as Commitment, m as Endpoints, n as Activity, p as Document, r as Agreement, s as Collection, t as Accept, u as Create, v as FeaturedItem, w as InteractionPolicy, x as Hashtag, y as Follow, z as Question } from "./vocab-
|
|
4
|
-
import { t as esm_default } from "./esm-
|
|
3
|
+
import { A as Object$1, B as QuoteAuthorization, C as Intent, D as Measure, E as Link, F as Person, G as Tombstone, H as Reject, I as Place, L as PropertyValue, N as OrderedCollectionPage, O as Multikey, P as Organization, R as Proposal, S as Image, T as InteractionRule, U as Service, V as QuoteRequest, W as Source, X as vocab_exports, _ as FeaturedCollection, a as Application, b as Group, d as CryptographicKey, f as Delete, g as FeatureRequest, h as FeatureAuthorization, i as Announce, j as Offer, k as Note, l as Commitment, m as Endpoints, n as Activity, p as Document, r as Agreement, s as Collection, t as Accept, u as Create, v as FeaturedItem, w as InteractionPolicy, x as Hashtag, y as Follow, z as Question } from "./vocab-qCLWHa7T.mjs";
|
|
4
|
+
import { t as esm_default } from "./esm-CS5DInHn.mjs";
|
|
5
5
|
import { t as assertInstanceOf } from "./utils-Df2odC27.mjs";
|
|
6
6
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
7
7
|
import { deepStrictEqual, notDeepStrictEqual, ok, rejects, throws } from "node:assert/strict";
|
|
@@ -445,17 +445,112 @@ test("FEP-ef61: actor gateways round-trip as an ordered URI list", async () => {
|
|
|
445
445
|
gateways: gateways.map((gateway) => gateway.href)
|
|
446
446
|
});
|
|
447
447
|
deepStrictEqual(actor.gateways, gateways);
|
|
448
|
-
const jsonLd = await actor.toJsonLd();
|
|
448
|
+
const jsonLd = await actor.toJsonLd({ format: "compact" });
|
|
449
449
|
deepStrictEqual(jsonLd.type, ActorClass.name);
|
|
450
|
-
deepStrictEqual(jsonLd.gateways, gateways.map((gateway) => gateway.
|
|
450
|
+
deepStrictEqual(jsonLd.gateways, gateways.map((gateway) => gateway.origin));
|
|
451
451
|
deepStrictEqual((await ActorClass.fromJsonLd(jsonLd)).gateways, gateways);
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
|
+
test("FEP-ef61: actor gateways serialize as origins", async () => {
|
|
455
|
+
const actorClasses = [
|
|
456
|
+
Application,
|
|
457
|
+
Group,
|
|
458
|
+
Organization,
|
|
459
|
+
Person,
|
|
460
|
+
Service
|
|
461
|
+
];
|
|
462
|
+
const gateways = [
|
|
463
|
+
new URL("https://first.example:443/"),
|
|
464
|
+
new URL("http://second.example:80/"),
|
|
465
|
+
new URL("https://third.example:8443/"),
|
|
466
|
+
new URL("http://fourth.example:8080/")
|
|
467
|
+
];
|
|
468
|
+
const origins = [
|
|
469
|
+
"https://first.example",
|
|
470
|
+
"http://second.example",
|
|
471
|
+
"https://third.example:8443",
|
|
472
|
+
"http://fourth.example:8080"
|
|
473
|
+
];
|
|
474
|
+
for (const ActorClass of actorClasses) {
|
|
475
|
+
const actor = new ActorClass({
|
|
476
|
+
id: parseIri("ap://did:key:z6Mkabc/actor"),
|
|
477
|
+
gateways
|
|
478
|
+
});
|
|
479
|
+
const compact = await actor.toJsonLd();
|
|
480
|
+
deepStrictEqual(compact.gateways, origins);
|
|
481
|
+
const expanded = await actor.toJsonLd({ format: "expand" });
|
|
482
|
+
deepStrictEqual(expanded[0]["https://w3id.org/fep/ef61/gateways"], [{ "@list": origins.map((origin) => ({ "@id": origin })) }]);
|
|
483
|
+
deepStrictEqual(actor.gateways, gateways);
|
|
484
|
+
deepStrictEqual(actor.gateways.map((gateway) => gateway.href), origins.map((origin) => `${origin}/`));
|
|
485
|
+
deepStrictEqual((await ActorClass.fromJsonLd(compact)).gateways, gateways);
|
|
486
|
+
deepStrictEqual((await ActorClass.fromJsonLd(expanded)).gateways, gateways);
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
test("FEP-ef61: portable actors parse unmapped gateway lists", async () => {
|
|
490
|
+
const actorClasses = [
|
|
491
|
+
Application,
|
|
492
|
+
Group,
|
|
493
|
+
Organization,
|
|
494
|
+
Person,
|
|
495
|
+
Service
|
|
496
|
+
];
|
|
497
|
+
const gateways = ["https://first.example", "https://second.example"];
|
|
498
|
+
const ids = ["ap://did:key:z6Mkabc/actor", "https://first.example/.well-known/apgateway/did:key:z6Mkabc/actor"];
|
|
499
|
+
for (const ActorClass of actorClasses) for (const id of ids) deepStrictEqual((await ActorClass.fromJsonLd({
|
|
500
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
501
|
+
type: ActorClass.name,
|
|
502
|
+
id,
|
|
503
|
+
inbox: `${id}/inbox`,
|
|
504
|
+
outbox: `${id}/outbox`,
|
|
505
|
+
gateways
|
|
506
|
+
})).gateways, gateways.map((g) => new URL(g)));
|
|
507
|
+
});
|
|
508
|
+
test("FEP-ef61: unmapped gateways retain their context meaning", async () => {
|
|
509
|
+
const actorClasses = [
|
|
510
|
+
Application,
|
|
511
|
+
Group,
|
|
512
|
+
Organization,
|
|
513
|
+
Person,
|
|
514
|
+
Service
|
|
515
|
+
];
|
|
516
|
+
const id = "ap://did:key:z6Mkabc/actor";
|
|
517
|
+
for (const ActorClass of actorClasses) {
|
|
518
|
+
const document = {
|
|
519
|
+
type: ActorClass.name,
|
|
520
|
+
id,
|
|
521
|
+
inbox: `${id}/inbox`,
|
|
522
|
+
outbox: `${id}/outbox`,
|
|
523
|
+
gateways: ["https://unmapped.example"]
|
|
524
|
+
};
|
|
525
|
+
for (const context of [
|
|
526
|
+
{ gateways: "https://example.com/unrelated" },
|
|
527
|
+
{ gateways: null },
|
|
528
|
+
{ "@vocab": "https://example.com/" },
|
|
529
|
+
{ [ActorClass.name]: {
|
|
530
|
+
"@id": `https://www.w3.org/ns/activitystreams#${ActorClass.name}`,
|
|
531
|
+
"@context": { gateways: "https://example.com/scoped" }
|
|
532
|
+
} }
|
|
533
|
+
]) deepStrictEqual((await ActorClass.fromJsonLd({
|
|
534
|
+
"@context": ["https://www.w3.org/ns/activitystreams", context],
|
|
535
|
+
...document
|
|
536
|
+
})).gateways, []);
|
|
537
|
+
deepStrictEqual((await ActorClass.fromJsonLd({
|
|
538
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
539
|
+
...document,
|
|
540
|
+
id: "https://ordinary.example/actor"
|
|
541
|
+
})).gateways, []);
|
|
542
|
+
deepStrictEqual((await ActorClass.fromJsonLd({
|
|
543
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
544
|
+
...document,
|
|
545
|
+
"https://w3id.org/fep/ef61/gateways": { "@list": [{ "@id": "https://canonical.example" }] }
|
|
546
|
+
})).gateways, [new URL("https://canonical.example")]);
|
|
547
|
+
}
|
|
548
|
+
});
|
|
454
549
|
test("FEP-ef61: actor gateways preserve single, empty, and invalid cases", async () => {
|
|
455
550
|
deepStrictEqual((await new Person({
|
|
456
551
|
id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"),
|
|
457
552
|
gateways: [new URL("https://server.example/")]
|
|
458
|
-
}).toJsonLd()).gateways, ["https://server.example
|
|
553
|
+
}).toJsonLd()).gateways, ["https://server.example"]);
|
|
459
554
|
ok(!("gateways" in await new Person({
|
|
460
555
|
id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"),
|
|
461
556
|
gateways: []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/vocab",
|
|
3
|
-
"version": "2.4.0-dev.
|
|
3
|
+
"version": "2.4.0-dev.2259+d9c843fc",
|
|
4
4
|
"homepage": "https://fedify.dev/",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"jsonld": "^9.0.0",
|
|
44
44
|
"pkijs": "^3.3.3",
|
|
45
45
|
"temporal-polyfill": "^1.0.1",
|
|
46
|
-
"@fedify/
|
|
47
|
-
"@fedify/
|
|
48
|
-
"@fedify/vocab-runtime": "2.4.0-dev.
|
|
46
|
+
"@fedify/vocab-tools": "2.4.0-dev.2259+d9c843fc",
|
|
47
|
+
"@fedify/webfinger": "2.4.0-dev.2259+d9c843fc",
|
|
48
|
+
"@fedify/vocab-runtime": "2.4.0-dev.2259+d9c843fc"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^24.12.2",
|
package/src/vocab.test.ts
CHANGED
|
@@ -713,15 +713,123 @@ test("FEP-ef61: actor gateways round-trip as an ordered URI list", async () => {
|
|
|
713
713
|
});
|
|
714
714
|
deepStrictEqual(actor.gateways, gateways);
|
|
715
715
|
|
|
716
|
-
const jsonLd = await actor.toJsonLd(
|
|
716
|
+
const jsonLd = await actor.toJsonLd({
|
|
717
|
+
format: "compact",
|
|
718
|
+
}) as Record<string, unknown>;
|
|
717
719
|
deepStrictEqual(jsonLd.type, ActorClass.name);
|
|
718
|
-
deepStrictEqual(jsonLd.gateways, gateways.map((gateway) => gateway.
|
|
720
|
+
deepStrictEqual(jsonLd.gateways, gateways.map((gateway) => gateway.origin));
|
|
719
721
|
|
|
720
722
|
const restored = await ActorClass.fromJsonLd(jsonLd);
|
|
721
723
|
deepStrictEqual(restored.gateways, gateways);
|
|
722
724
|
}
|
|
723
725
|
});
|
|
724
726
|
|
|
727
|
+
test("FEP-ef61: actor gateways serialize as origins", async () => {
|
|
728
|
+
const actorClasses = [Application, Group, Organization, Person, Service];
|
|
729
|
+
const gateways = [
|
|
730
|
+
new URL("https://first.example:443/"),
|
|
731
|
+
new URL("http://second.example:80/"),
|
|
732
|
+
new URL("https://third.example:8443/"),
|
|
733
|
+
new URL("http://fourth.example:8080/"),
|
|
734
|
+
];
|
|
735
|
+
const origins = [
|
|
736
|
+
"https://first.example",
|
|
737
|
+
"http://second.example",
|
|
738
|
+
"https://third.example:8443",
|
|
739
|
+
"http://fourth.example:8080",
|
|
740
|
+
];
|
|
741
|
+
for (const ActorClass of actorClasses) {
|
|
742
|
+
const actor = new ActorClass({
|
|
743
|
+
id: parseIri("ap://did:key:z6Mkabc/actor"),
|
|
744
|
+
gateways,
|
|
745
|
+
});
|
|
746
|
+
const compact = await actor.toJsonLd() as Record<string, unknown>;
|
|
747
|
+
deepStrictEqual(compact.gateways, origins);
|
|
748
|
+
const expanded = await actor.toJsonLd({
|
|
749
|
+
format: "expand",
|
|
750
|
+
}) as Record<string, unknown>[];
|
|
751
|
+
deepStrictEqual(expanded[0]["https://w3id.org/fep/ef61/gateways"], [
|
|
752
|
+
{ "@list": origins.map((origin) => ({ "@id": origin })) },
|
|
753
|
+
]);
|
|
754
|
+
deepStrictEqual(actor.gateways, gateways);
|
|
755
|
+
deepStrictEqual(
|
|
756
|
+
actor.gateways.map((gateway) => gateway.href),
|
|
757
|
+
origins.map((origin) => `${origin}/`),
|
|
758
|
+
);
|
|
759
|
+
deepStrictEqual((await ActorClass.fromJsonLd(compact)).gateways, gateways);
|
|
760
|
+
deepStrictEqual((await ActorClass.fromJsonLd(expanded)).gateways, gateways);
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
test("FEP-ef61: portable actors parse unmapped gateway lists", async () => {
|
|
765
|
+
const actorClasses = [Application, Group, Organization, Person, Service];
|
|
766
|
+
const gateways = ["https://first.example", "https://second.example"];
|
|
767
|
+
const ids = [
|
|
768
|
+
"ap://did:key:z6Mkabc/actor",
|
|
769
|
+
"https://first.example/.well-known/apgateway/did:key:z6Mkabc/actor",
|
|
770
|
+
];
|
|
771
|
+
for (const ActorClass of actorClasses) {
|
|
772
|
+
for (const id of ids) {
|
|
773
|
+
const actor = await ActorClass.fromJsonLd({
|
|
774
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
775
|
+
type: ActorClass.name,
|
|
776
|
+
id,
|
|
777
|
+
inbox: `${id}/inbox`,
|
|
778
|
+
outbox: `${id}/outbox`,
|
|
779
|
+
gateways,
|
|
780
|
+
});
|
|
781
|
+
deepStrictEqual(actor.gateways, gateways.map((g) => new URL(g)));
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
test("FEP-ef61: unmapped gateways retain their context meaning", async () => {
|
|
787
|
+
const actorClasses = [Application, Group, Organization, Person, Service];
|
|
788
|
+
const id = "ap://did:key:z6Mkabc/actor";
|
|
789
|
+
for (const ActorClass of actorClasses) {
|
|
790
|
+
const document = {
|
|
791
|
+
type: ActorClass.name,
|
|
792
|
+
id,
|
|
793
|
+
inbox: `${id}/inbox`,
|
|
794
|
+
outbox: `${id}/outbox`,
|
|
795
|
+
gateways: ["https://unmapped.example"],
|
|
796
|
+
};
|
|
797
|
+
for (
|
|
798
|
+
const context of [
|
|
799
|
+
{ gateways: "https://example.com/unrelated" },
|
|
800
|
+
{ gateways: null },
|
|
801
|
+
{ "@vocab": "https://example.com/" },
|
|
802
|
+
{
|
|
803
|
+
[ActorClass.name]: {
|
|
804
|
+
"@id": `https://www.w3.org/ns/activitystreams#${ActorClass.name}`,
|
|
805
|
+
"@context": { gateways: "https://example.com/scoped" },
|
|
806
|
+
},
|
|
807
|
+
},
|
|
808
|
+
]
|
|
809
|
+
) {
|
|
810
|
+
const actor = await ActorClass.fromJsonLd({
|
|
811
|
+
"@context": ["https://www.w3.org/ns/activitystreams", context],
|
|
812
|
+
...document,
|
|
813
|
+
});
|
|
814
|
+
deepStrictEqual(actor.gateways, []);
|
|
815
|
+
}
|
|
816
|
+
const ordinary = await ActorClass.fromJsonLd({
|
|
817
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
818
|
+
...document,
|
|
819
|
+
id: "https://ordinary.example/actor",
|
|
820
|
+
});
|
|
821
|
+
deepStrictEqual(ordinary.gateways, []);
|
|
822
|
+
const canonical = await ActorClass.fromJsonLd({
|
|
823
|
+
"@context": "https://www.w3.org/ns/activitystreams",
|
|
824
|
+
...document,
|
|
825
|
+
"https://w3id.org/fep/ef61/gateways": {
|
|
826
|
+
"@list": [{ "@id": "https://canonical.example" }],
|
|
827
|
+
},
|
|
828
|
+
});
|
|
829
|
+
deepStrictEqual(canonical.gateways, [new URL("https://canonical.example")]);
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
|
|
725
833
|
test("FEP-ef61: actor gateways preserve single, empty, and invalid cases", async () => {
|
|
726
834
|
const singleGateway = new Person({
|
|
727
835
|
id: new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"),
|
|
@@ -729,7 +837,7 @@ test("FEP-ef61: actor gateways preserve single, empty, and invalid cases", async
|
|
|
729
837
|
});
|
|
730
838
|
deepStrictEqual(
|
|
731
839
|
(await singleGateway.toJsonLd() as Record<string, unknown>).gateways,
|
|
732
|
-
["https://server.example
|
|
840
|
+
["https://server.example"],
|
|
733
841
|
);
|
|
734
842
|
|
|
735
843
|
const noGateways = new Person({
|