@fedify/fedify 1.1.0-dev.446 → 1.1.0
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/CHANGES.md +39 -1
- package/esm/federation/middleware.js +1 -1
- package/esm/sig/http.js +2 -1
- package/esm/vocab/application.yaml +20 -0
- package/esm/vocab/group.yaml +20 -0
- package/esm/vocab/organization.yaml +20 -0
- package/esm/vocab/person.yaml +20 -0
- package/esm/vocab/service.yaml +20 -0
- package/esm/vocab/vocab.js +1258 -73
- package/package.json +1 -1
- package/types/federation/handler.d.ts +1 -1
- package/types/federation/handler.d.ts.map +1 -1
- package/types/federation/middleware.d.ts +4 -4
- package/types/federation/middleware.d.ts.map +1 -1
- package/types/sig/http.d.ts +2 -2
- package/types/sig/http.d.ts.map +1 -1
- package/types/vocab/vocab.d.ts +75 -0
- package/types/vocab/vocab.d.ts.map +1 -1
package/esm/vocab/vocab.js
CHANGED
@@ -10390,6 +10390,7 @@ export class Application extends Object {
|
|
10390
10390
|
#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = [];
|
10391
10391
|
#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = [];
|
10392
10392
|
#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = [];
|
10393
|
+
#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
10393
10394
|
#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
10394
10395
|
#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [];
|
10395
10396
|
#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = [];
|
@@ -10637,6 +10638,20 @@ export class Application extends Object {
|
|
10637
10638
|
"boolean" + ".");
|
10638
10639
|
}
|
10639
10640
|
}
|
10641
|
+
if ("successor" in values && values.successor != null) {
|
10642
|
+
if (values.successor instanceof _b ||
|
10643
|
+
values.successor instanceof Group ||
|
10644
|
+
values.successor instanceof Organization ||
|
10645
|
+
values.successor instanceof Person ||
|
10646
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
10647
|
+
// @ts-ignore: type is checked above.
|
10648
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
10649
|
+
}
|
10650
|
+
else {
|
10651
|
+
throw new TypeError("The successor must be of type " +
|
10652
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
10653
|
+
}
|
10654
|
+
}
|
10640
10655
|
if ("alias" in values && values.alias != null) {
|
10641
10656
|
if (values.alias instanceof _b || values.alias instanceof Group ||
|
10642
10657
|
values.alias instanceof Organization ||
|
@@ -10986,6 +11001,22 @@ export class Application extends Object {
|
|
10986
11001
|
"boolean" + ".");
|
10987
11002
|
}
|
10988
11003
|
}
|
11004
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
11005
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
11006
|
+
if ("successor" in values && values.successor != null) {
|
11007
|
+
if (values.successor instanceof _b ||
|
11008
|
+
values.successor instanceof Group ||
|
11009
|
+
values.successor instanceof Organization ||
|
11010
|
+
values.successor instanceof Person ||
|
11011
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
11012
|
+
// @ts-ignore: type is checked above.
|
11013
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
11014
|
+
}
|
11015
|
+
else {
|
11016
|
+
throw new TypeError("The successor must be of type " +
|
11017
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
11018
|
+
}
|
11019
|
+
}
|
10989
11020
|
clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs =
|
10990
11021
|
this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs;
|
10991
11022
|
if ("alias" in values && values.alias != null) {
|
@@ -11780,6 +11811,95 @@ export class Application extends Object {
|
|
11780
11811
|
return null;
|
11781
11812
|
return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
11782
11813
|
}
|
11814
|
+
async #fetchSuccessor(url, options = {}) {
|
11815
|
+
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
11816
|
+
fetchDocumentLoader;
|
11817
|
+
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
11818
|
+
fetchDocumentLoader;
|
11819
|
+
let fetchResult;
|
11820
|
+
try {
|
11821
|
+
fetchResult = await documentLoader(url.href);
|
11822
|
+
}
|
11823
|
+
catch (error) {
|
11824
|
+
if (options.suppressError) {
|
11825
|
+
getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
|
11826
|
+
return null;
|
11827
|
+
}
|
11828
|
+
throw error;
|
11829
|
+
}
|
11830
|
+
const { document } = fetchResult;
|
11831
|
+
try {
|
11832
|
+
return await _b.fromJsonLd(document, { documentLoader, contextLoader });
|
11833
|
+
}
|
11834
|
+
catch (e) {
|
11835
|
+
if (!(e instanceof TypeError))
|
11836
|
+
throw e;
|
11837
|
+
}
|
11838
|
+
try {
|
11839
|
+
return await Group.fromJsonLd(document, { documentLoader, contextLoader });
|
11840
|
+
}
|
11841
|
+
catch (e) {
|
11842
|
+
if (!(e instanceof TypeError))
|
11843
|
+
throw e;
|
11844
|
+
}
|
11845
|
+
try {
|
11846
|
+
return await Organization.fromJsonLd(document, { documentLoader, contextLoader });
|
11847
|
+
}
|
11848
|
+
catch (e) {
|
11849
|
+
if (!(e instanceof TypeError))
|
11850
|
+
throw e;
|
11851
|
+
}
|
11852
|
+
try {
|
11853
|
+
return await Person.fromJsonLd(document, { documentLoader, contextLoader });
|
11854
|
+
}
|
11855
|
+
catch (e) {
|
11856
|
+
if (!(e instanceof TypeError))
|
11857
|
+
throw e;
|
11858
|
+
}
|
11859
|
+
try {
|
11860
|
+
return await Service.fromJsonLd(document, { documentLoader, contextLoader });
|
11861
|
+
}
|
11862
|
+
catch (e) {
|
11863
|
+
if (!(e instanceof TypeError))
|
11864
|
+
throw e;
|
11865
|
+
}
|
11866
|
+
throw new TypeError("Expected an object of any type of: " +
|
11867
|
+
[
|
11868
|
+
"https://www.w3.org/ns/activitystreams#Application",
|
11869
|
+
"https://www.w3.org/ns/activitystreams#Group",
|
11870
|
+
"https://www.w3.org/ns/activitystreams#Organization",
|
11871
|
+
"https://www.w3.org/ns/activitystreams#Person",
|
11872
|
+
"https://www.w3.org/ns/activitystreams#Service",
|
11873
|
+
].join(", "));
|
11874
|
+
}
|
11875
|
+
/**
|
11876
|
+
* Similar to
|
11877
|
+
* {@link Application.getSuccessor},
|
11878
|
+
* but returns its `@id` URL instead of the object itself.
|
11879
|
+
*/
|
11880
|
+
get successorId() {
|
11881
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
11882
|
+
return null;
|
11883
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
11884
|
+
if (v instanceof URL)
|
11885
|
+
return v;
|
11886
|
+
return v.id;
|
11887
|
+
}
|
11888
|
+
/** Signifies that an actor has been moved to a different ID. Used in Mastodon-style data portability with the {@link Move} activity; see [ActivityPub Data Portability/Move Action](https://swicg.github.io/activitypub-data-portability/#move-action) for more details.
|
11889
|
+
*/
|
11890
|
+
async getSuccessor(options = {}) {
|
11891
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
11892
|
+
return null;
|
11893
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
11894
|
+
if (v instanceof URL) {
|
11895
|
+
const fetched = await this.#fetchSuccessor(v, options);
|
11896
|
+
if (fetched == null)
|
11897
|
+
return null;
|
11898
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0] = fetched;
|
11899
|
+
return fetched;
|
11900
|
+
}
|
11901
|
+
return v;
|
11902
|
+
}
|
11783
11903
|
async #fetchAlias(url, options = {}) {
|
11784
11904
|
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
11785
11905
|
fetchDocumentLoader;
|
@@ -12244,6 +12364,46 @@ export class Application extends Object {
|
|
12244
12364
|
: compactItems[0];
|
12245
12365
|
}
|
12246
12366
|
compactItems = [];
|
12367
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
12368
|
+
const item = v instanceof URL
|
12369
|
+
? v.href
|
12370
|
+
: v instanceof _b
|
12371
|
+
? await v.toJsonLd({
|
12372
|
+
...options,
|
12373
|
+
format: undefined,
|
12374
|
+
context: undefined,
|
12375
|
+
})
|
12376
|
+
: v instanceof Group
|
12377
|
+
? await v.toJsonLd({
|
12378
|
+
...options,
|
12379
|
+
format: undefined,
|
12380
|
+
context: undefined,
|
12381
|
+
})
|
12382
|
+
: v instanceof Organization
|
12383
|
+
? await v.toJsonLd({
|
12384
|
+
...options,
|
12385
|
+
format: undefined,
|
12386
|
+
context: undefined,
|
12387
|
+
})
|
12388
|
+
: v instanceof Person
|
12389
|
+
? await v.toJsonLd({
|
12390
|
+
...options,
|
12391
|
+
format: undefined,
|
12392
|
+
context: undefined,
|
12393
|
+
})
|
12394
|
+
: await v.toJsonLd({
|
12395
|
+
...options,
|
12396
|
+
format: undefined,
|
12397
|
+
context: undefined,
|
12398
|
+
});
|
12399
|
+
compactItems.push(item);
|
12400
|
+
}
|
12401
|
+
if (compactItems.length > 0) {
|
12402
|
+
result["movedTo"] = compactItems.length > 1
|
12403
|
+
? compactItems
|
12404
|
+
: compactItems[0];
|
12405
|
+
}
|
12406
|
+
compactItems = [];
|
12247
12407
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
12248
12408
|
const item = v instanceof URL
|
12249
12409
|
? v.href
|
@@ -12319,6 +12479,7 @@ export class Application extends Object {
|
|
12319
12479
|
{
|
12320
12480
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
12321
12481
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
12482
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
12322
12483
|
"toot": "http://joinmastodon.org/ns#",
|
12323
12484
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
12324
12485
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -12521,6 +12682,25 @@ export class Application extends Object {
|
|
12521
12682
|
values["http://joinmastodon.org/ns#indexable"] = propValue;
|
12522
12683
|
}
|
12523
12684
|
array = [];
|
12685
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
12686
|
+
const element = v instanceof URL
|
12687
|
+
? { "@id": v.href }
|
12688
|
+
: v instanceof _b
|
12689
|
+
? await v.toJsonLd(options)
|
12690
|
+
: v instanceof Group
|
12691
|
+
? await v.toJsonLd(options)
|
12692
|
+
: v instanceof Organization
|
12693
|
+
? await v.toJsonLd(options)
|
12694
|
+
: v instanceof Person
|
12695
|
+
? await v.toJsonLd(options)
|
12696
|
+
: await v.toJsonLd(options);
|
12697
|
+
array.push(element);
|
12698
|
+
}
|
12699
|
+
if (array.length > 0) {
|
12700
|
+
const propValue = array;
|
12701
|
+
values["https://www.w3.org/ns/activitystreams#movedTo"] = propValue;
|
12702
|
+
}
|
12703
|
+
array = [];
|
12524
12704
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
12525
12705
|
const element = v instanceof URL
|
12526
12706
|
? { "@id": v.href }
|
@@ -12575,6 +12755,7 @@ export class Application extends Object {
|
|
12575
12755
|
{
|
12576
12756
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
12577
12757
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
12758
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
12578
12759
|
"toot": "http://joinmastodon.org/ns#",
|
12579
12760
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
12580
12761
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -12981,6 +13162,50 @@ export class Application extends Object {
|
|
12981
13162
|
}
|
12982
13163
|
instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable =
|
12983
13164
|
_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable;
|
13165
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
13166
|
+
let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"];
|
13167
|
+
for (const v of _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array == null
|
13168
|
+
? []
|
13169
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array.length === 1 &&
|
13170
|
+
"@list" in _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]
|
13171
|
+
? _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]["@list"]
|
13172
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array) {
|
13173
|
+
if (v == null)
|
13174
|
+
continue;
|
13175
|
+
if (typeof v === "object" && "@id" in v && !("@type" in v) &&
|
13176
|
+
globalThis.Object.keys(v).length === 1) {
|
13177
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(!URL.canParse(v["@id"]) && v["@id"].startsWith("at://")
|
13178
|
+
? new URL("at://" + encodeURIComponent(v["@id"].substring(5)))
|
13179
|
+
: new URL(v["@id"]));
|
13180
|
+
continue;
|
13181
|
+
}
|
13182
|
+
const decoded = typeof v === "object" && "@type" in v &&
|
13183
|
+
Array.isArray(v["@type"]) &&
|
13184
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Application")
|
13185
|
+
? await _b.fromJsonLd(v, options)
|
13186
|
+
: typeof v === "object" && "@type" in v &&
|
13187
|
+
Array.isArray(v["@type"]) &&
|
13188
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Group")
|
13189
|
+
? await Group.fromJsonLd(v, options)
|
13190
|
+
: typeof v === "object" && "@type" in v &&
|
13191
|
+
Array.isArray(v["@type"]) &&
|
13192
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization")
|
13193
|
+
? await Organization.fromJsonLd(v, options)
|
13194
|
+
: typeof v === "object" && "@type" in v &&
|
13195
|
+
Array.isArray(v["@type"]) &&
|
13196
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Person")
|
13197
|
+
? await Person.fromJsonLd(v, options)
|
13198
|
+
: typeof v === "object" && "@type" in v &&
|
13199
|
+
Array.isArray(v["@type"]) &&
|
13200
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Service")
|
13201
|
+
? await Service.fromJsonLd(v, options)
|
13202
|
+
: undefined;
|
13203
|
+
if (typeof decoded === "undefined")
|
13204
|
+
continue;
|
13205
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(decoded);
|
13206
|
+
}
|
13207
|
+
instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
13208
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
12984
13209
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
12985
13210
|
let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"];
|
12986
13211
|
for (const v of _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array == null
|
@@ -13296,6 +13521,18 @@ export class Application extends Object {
|
|
13296
13521
|
if (_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length == 1) {
|
13297
13522
|
proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
13298
13523
|
}
|
13524
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this
|
13525
|
+
.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo
|
13526
|
+
// deno-lint-ignore no-explicit-any
|
13527
|
+
.map((v) => v instanceof URL
|
13528
|
+
? {
|
13529
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
13530
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
|
13531
|
+
}
|
13532
|
+
: v);
|
13533
|
+
if (_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length == 1) {
|
13534
|
+
proxy.successor = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
13535
|
+
}
|
13299
13536
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this
|
13300
13537
|
.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs
|
13301
13538
|
// deno-lint-ignore no-explicit-any
|
@@ -18057,6 +18294,7 @@ export class Group extends Object {
|
|
18057
18294
|
#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = [];
|
18058
18295
|
#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = [];
|
18059
18296
|
#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = [];
|
18297
|
+
#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
18060
18298
|
#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
18061
18299
|
#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [];
|
18062
18300
|
#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = [];
|
@@ -18304,6 +18542,20 @@ export class Group extends Object {
|
|
18304
18542
|
"boolean" + ".");
|
18305
18543
|
}
|
18306
18544
|
}
|
18545
|
+
if ("successor" in values && values.successor != null) {
|
18546
|
+
if (values.successor instanceof Application ||
|
18547
|
+
values.successor instanceof _d ||
|
18548
|
+
values.successor instanceof Organization ||
|
18549
|
+
values.successor instanceof Person ||
|
18550
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
18551
|
+
// @ts-ignore: type is checked above.
|
18552
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
18553
|
+
}
|
18554
|
+
else {
|
18555
|
+
throw new TypeError("The successor must be of type " +
|
18556
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
18557
|
+
}
|
18558
|
+
}
|
18307
18559
|
if ("alias" in values && values.alias != null) {
|
18308
18560
|
if (values.alias instanceof Application || values.alias instanceof _d ||
|
18309
18561
|
values.alias instanceof Organization ||
|
@@ -18653,6 +18905,22 @@ export class Group extends Object {
|
|
18653
18905
|
"boolean" + ".");
|
18654
18906
|
}
|
18655
18907
|
}
|
18908
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
18909
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
18910
|
+
if ("successor" in values && values.successor != null) {
|
18911
|
+
if (values.successor instanceof Application ||
|
18912
|
+
values.successor instanceof _d ||
|
18913
|
+
values.successor instanceof Organization ||
|
18914
|
+
values.successor instanceof Person ||
|
18915
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
18916
|
+
// @ts-ignore: type is checked above.
|
18917
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
18918
|
+
}
|
18919
|
+
else {
|
18920
|
+
throw new TypeError("The successor must be of type " +
|
18921
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
18922
|
+
}
|
18923
|
+
}
|
18656
18924
|
clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs =
|
18657
18925
|
this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs;
|
18658
18926
|
if ("alias" in values && values.alias != null) {
|
@@ -19447,7 +19715,7 @@ export class Group extends Object {
|
|
19447
19715
|
return null;
|
19448
19716
|
return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
19449
19717
|
}
|
19450
|
-
async #
|
19718
|
+
async #fetchSuccessor(url, options = {}) {
|
19451
19719
|
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
19452
19720
|
fetchDocumentLoader;
|
19453
19721
|
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
@@ -19510,64 +19778,33 @@ export class Group extends Object {
|
|
19510
19778
|
}
|
19511
19779
|
/**
|
19512
19780
|
* Similar to
|
19513
|
-
* {@link Group.
|
19781
|
+
* {@link Group.getSuccessor},
|
19514
19782
|
* but returns its `@id` URL instead of the object itself.
|
19515
19783
|
*/
|
19516
|
-
get
|
19517
|
-
if (this.#
|
19784
|
+
get successorId() {
|
19785
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
19518
19786
|
return null;
|
19519
|
-
const v = this.#
|
19787
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
19520
19788
|
if (v instanceof URL)
|
19521
19789
|
return v;
|
19522
19790
|
return v.id;
|
19523
19791
|
}
|
19524
|
-
/**
|
19525
|
-
* or aliases for an entity. It can be used to provide additional identifiers
|
19526
|
-
* or labels for an entity, which can be useful in scenarios where an entity
|
19527
|
-
* may have multiple names or aliases.
|
19792
|
+
/** Signifies that an actor has been moved to a different ID. Used in Mastodon-style data portability with the {@link Move} activity; see [ActivityPub Data Portability/Move Action](https://swicg.github.io/activitypub-data-portability/#move-action) for more details.
|
19528
19793
|
*/
|
19529
|
-
async
|
19530
|
-
if (this.#
|
19794
|
+
async getSuccessor(options = {}) {
|
19795
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
19531
19796
|
return null;
|
19532
|
-
const v = this.#
|
19797
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
19533
19798
|
if (v instanceof URL) {
|
19534
|
-
const fetched = await this.#
|
19799
|
+
const fetched = await this.#fetchSuccessor(v, options);
|
19535
19800
|
if (fetched == null)
|
19536
19801
|
return null;
|
19537
|
-
this.#
|
19802
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0] = fetched;
|
19538
19803
|
return fetched;
|
19539
19804
|
}
|
19540
19805
|
return v;
|
19541
19806
|
}
|
19542
|
-
|
19543
|
-
* Similar to
|
19544
|
-
* {@link Group.getAliases},
|
19545
|
-
* but returns their `@id`s instead of the objects themselves.
|
19546
|
-
*/
|
19547
|
-
get aliasIds() {
|
19548
|
-
return this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.map((v) => v instanceof URL ? v : v.id).filter((id) => id !== null);
|
19549
|
-
}
|
19550
|
-
/** The `aliases` (`alsoKnownAs`) property is used to specify alternative names
|
19551
|
-
* or aliases for an entity. It can be used to provide additional identifiers
|
19552
|
-
* or labels for an entity, which can be useful in scenarios where an entity
|
19553
|
-
* may have multiple names or aliases.
|
19554
|
-
*/
|
19555
|
-
async *getAliases(options = {}) {
|
19556
|
-
const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs;
|
19557
|
-
for (let i = 0; i < vs.length; i++) {
|
19558
|
-
const v = vs[i];
|
19559
|
-
if (v instanceof URL) {
|
19560
|
-
const fetched = await this.#fetchAlias(v, options);
|
19561
|
-
if (fetched == null)
|
19562
|
-
continue;
|
19563
|
-
vs[i] = fetched;
|
19564
|
-
yield fetched;
|
19565
|
-
continue;
|
19566
|
-
}
|
19567
|
-
yield v;
|
19568
|
-
}
|
19569
|
-
}
|
19570
|
-
async #fetchService(url, options = {}) {
|
19807
|
+
async #fetchAlias(url, options = {}) {
|
19571
19808
|
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
19572
19809
|
fetchDocumentLoader;
|
19573
19810
|
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
@@ -19585,24 +19822,144 @@ export class Group extends Object {
|
|
19585
19822
|
}
|
19586
19823
|
const { document } = fetchResult;
|
19587
19824
|
try {
|
19588
|
-
return await
|
19825
|
+
return await Application.fromJsonLd(document, { documentLoader, contextLoader });
|
19589
19826
|
}
|
19590
19827
|
catch (e) {
|
19591
19828
|
if (!(e instanceof TypeError))
|
19592
19829
|
throw e;
|
19593
19830
|
}
|
19594
|
-
|
19595
|
-
|
19596
|
-
|
19597
|
-
|
19598
|
-
|
19599
|
-
|
19600
|
-
|
19601
|
-
|
19602
|
-
|
19603
|
-
|
19604
|
-
|
19605
|
-
|
19831
|
+
try {
|
19832
|
+
return await _d.fromJsonLd(document, { documentLoader, contextLoader });
|
19833
|
+
}
|
19834
|
+
catch (e) {
|
19835
|
+
if (!(e instanceof TypeError))
|
19836
|
+
throw e;
|
19837
|
+
}
|
19838
|
+
try {
|
19839
|
+
return await Organization.fromJsonLd(document, { documentLoader, contextLoader });
|
19840
|
+
}
|
19841
|
+
catch (e) {
|
19842
|
+
if (!(e instanceof TypeError))
|
19843
|
+
throw e;
|
19844
|
+
}
|
19845
|
+
try {
|
19846
|
+
return await Person.fromJsonLd(document, { documentLoader, contextLoader });
|
19847
|
+
}
|
19848
|
+
catch (e) {
|
19849
|
+
if (!(e instanceof TypeError))
|
19850
|
+
throw e;
|
19851
|
+
}
|
19852
|
+
try {
|
19853
|
+
return await Service.fromJsonLd(document, { documentLoader, contextLoader });
|
19854
|
+
}
|
19855
|
+
catch (e) {
|
19856
|
+
if (!(e instanceof TypeError))
|
19857
|
+
throw e;
|
19858
|
+
}
|
19859
|
+
throw new TypeError("Expected an object of any type of: " +
|
19860
|
+
[
|
19861
|
+
"https://www.w3.org/ns/activitystreams#Application",
|
19862
|
+
"https://www.w3.org/ns/activitystreams#Group",
|
19863
|
+
"https://www.w3.org/ns/activitystreams#Organization",
|
19864
|
+
"https://www.w3.org/ns/activitystreams#Person",
|
19865
|
+
"https://www.w3.org/ns/activitystreams#Service",
|
19866
|
+
].join(", "));
|
19867
|
+
}
|
19868
|
+
/**
|
19869
|
+
* Similar to
|
19870
|
+
* {@link Group.getAlias},
|
19871
|
+
* but returns its `@id` URL instead of the object itself.
|
19872
|
+
*/
|
19873
|
+
get aliasId() {
|
19874
|
+
if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1)
|
19875
|
+
return null;
|
19876
|
+
const v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0];
|
19877
|
+
if (v instanceof URL)
|
19878
|
+
return v;
|
19879
|
+
return v.id;
|
19880
|
+
}
|
19881
|
+
/** The `aliases` (`alsoKnownAs`) property is used to specify alternative names
|
19882
|
+
* or aliases for an entity. It can be used to provide additional identifiers
|
19883
|
+
* or labels for an entity, which can be useful in scenarios where an entity
|
19884
|
+
* may have multiple names or aliases.
|
19885
|
+
*/
|
19886
|
+
async getAlias(options = {}) {
|
19887
|
+
if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1)
|
19888
|
+
return null;
|
19889
|
+
const v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0];
|
19890
|
+
if (v instanceof URL) {
|
19891
|
+
const fetched = await this.#fetchAlias(v, options);
|
19892
|
+
if (fetched == null)
|
19893
|
+
return null;
|
19894
|
+
this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0] = fetched;
|
19895
|
+
return fetched;
|
19896
|
+
}
|
19897
|
+
return v;
|
19898
|
+
}
|
19899
|
+
/**
|
19900
|
+
* Similar to
|
19901
|
+
* {@link Group.getAliases},
|
19902
|
+
* but returns their `@id`s instead of the objects themselves.
|
19903
|
+
*/
|
19904
|
+
get aliasIds() {
|
19905
|
+
return this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.map((v) => v instanceof URL ? v : v.id).filter((id) => id !== null);
|
19906
|
+
}
|
19907
|
+
/** The `aliases` (`alsoKnownAs`) property is used to specify alternative names
|
19908
|
+
* or aliases for an entity. It can be used to provide additional identifiers
|
19909
|
+
* or labels for an entity, which can be useful in scenarios where an entity
|
19910
|
+
* may have multiple names or aliases.
|
19911
|
+
*/
|
19912
|
+
async *getAliases(options = {}) {
|
19913
|
+
const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs;
|
19914
|
+
for (let i = 0; i < vs.length; i++) {
|
19915
|
+
const v = vs[i];
|
19916
|
+
if (v instanceof URL) {
|
19917
|
+
const fetched = await this.#fetchAlias(v, options);
|
19918
|
+
if (fetched == null)
|
19919
|
+
continue;
|
19920
|
+
vs[i] = fetched;
|
19921
|
+
yield fetched;
|
19922
|
+
continue;
|
19923
|
+
}
|
19924
|
+
yield v;
|
19925
|
+
}
|
19926
|
+
}
|
19927
|
+
async #fetchService(url, options = {}) {
|
19928
|
+
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
19929
|
+
fetchDocumentLoader;
|
19930
|
+
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
19931
|
+
fetchDocumentLoader;
|
19932
|
+
let fetchResult;
|
19933
|
+
try {
|
19934
|
+
fetchResult = await documentLoader(url.href);
|
19935
|
+
}
|
19936
|
+
catch (error) {
|
19937
|
+
if (options.suppressError) {
|
19938
|
+
getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
|
19939
|
+
return null;
|
19940
|
+
}
|
19941
|
+
throw error;
|
19942
|
+
}
|
19943
|
+
const { document } = fetchResult;
|
19944
|
+
try {
|
19945
|
+
return await DidService.fromJsonLd(document, { documentLoader, contextLoader });
|
19946
|
+
}
|
19947
|
+
catch (e) {
|
19948
|
+
if (!(e instanceof TypeError))
|
19949
|
+
throw e;
|
19950
|
+
}
|
19951
|
+
throw new TypeError("Expected an object of any type of: " +
|
19952
|
+
["https://www.w3.org/ns/did#Service"].join(", "));
|
19953
|
+
}
|
19954
|
+
/**
|
19955
|
+
* Similar to
|
19956
|
+
* {@link Group.getService},
|
19957
|
+
* but returns its `@id` URL instead of the object itself.
|
19958
|
+
*/
|
19959
|
+
get serviceId() {
|
19960
|
+
if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1)
|
19961
|
+
return null;
|
19962
|
+
const v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0];
|
19606
19963
|
if (v instanceof URL)
|
19607
19964
|
return v;
|
19608
19965
|
return v.id;
|
@@ -19911,6 +20268,46 @@ export class Group extends Object {
|
|
19911
20268
|
: compactItems[0];
|
19912
20269
|
}
|
19913
20270
|
compactItems = [];
|
20271
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
20272
|
+
const item = v instanceof URL
|
20273
|
+
? v.href
|
20274
|
+
: v instanceof Application
|
20275
|
+
? await v.toJsonLd({
|
20276
|
+
...options,
|
20277
|
+
format: undefined,
|
20278
|
+
context: undefined,
|
20279
|
+
})
|
20280
|
+
: v instanceof _d
|
20281
|
+
? await v.toJsonLd({
|
20282
|
+
...options,
|
20283
|
+
format: undefined,
|
20284
|
+
context: undefined,
|
20285
|
+
})
|
20286
|
+
: v instanceof Organization
|
20287
|
+
? await v.toJsonLd({
|
20288
|
+
...options,
|
20289
|
+
format: undefined,
|
20290
|
+
context: undefined,
|
20291
|
+
})
|
20292
|
+
: v instanceof Person
|
20293
|
+
? await v.toJsonLd({
|
20294
|
+
...options,
|
20295
|
+
format: undefined,
|
20296
|
+
context: undefined,
|
20297
|
+
})
|
20298
|
+
: await v.toJsonLd({
|
20299
|
+
...options,
|
20300
|
+
format: undefined,
|
20301
|
+
context: undefined,
|
20302
|
+
});
|
20303
|
+
compactItems.push(item);
|
20304
|
+
}
|
20305
|
+
if (compactItems.length > 0) {
|
20306
|
+
result["movedTo"] = compactItems.length > 1
|
20307
|
+
? compactItems
|
20308
|
+
: compactItems[0];
|
20309
|
+
}
|
20310
|
+
compactItems = [];
|
19914
20311
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
19915
20312
|
const item = v instanceof URL
|
19916
20313
|
? v.href
|
@@ -19986,6 +20383,7 @@ export class Group extends Object {
|
|
19986
20383
|
{
|
19987
20384
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
19988
20385
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
20386
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
19989
20387
|
"toot": "http://joinmastodon.org/ns#",
|
19990
20388
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
19991
20389
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -20188,6 +20586,25 @@ export class Group extends Object {
|
|
20188
20586
|
values["http://joinmastodon.org/ns#indexable"] = propValue;
|
20189
20587
|
}
|
20190
20588
|
array = [];
|
20589
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
20590
|
+
const element = v instanceof URL
|
20591
|
+
? { "@id": v.href }
|
20592
|
+
: v instanceof Application
|
20593
|
+
? await v.toJsonLd(options)
|
20594
|
+
: v instanceof _d
|
20595
|
+
? await v.toJsonLd(options)
|
20596
|
+
: v instanceof Organization
|
20597
|
+
? await v.toJsonLd(options)
|
20598
|
+
: v instanceof Person
|
20599
|
+
? await v.toJsonLd(options)
|
20600
|
+
: await v.toJsonLd(options);
|
20601
|
+
array.push(element);
|
20602
|
+
}
|
20603
|
+
if (array.length > 0) {
|
20604
|
+
const propValue = array;
|
20605
|
+
values["https://www.w3.org/ns/activitystreams#movedTo"] = propValue;
|
20606
|
+
}
|
20607
|
+
array = [];
|
20191
20608
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
20192
20609
|
const element = v instanceof URL
|
20193
20610
|
? { "@id": v.href }
|
@@ -20242,6 +20659,7 @@ export class Group extends Object {
|
|
20242
20659
|
{
|
20243
20660
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
20244
20661
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
20662
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
20245
20663
|
"toot": "http://joinmastodon.org/ns#",
|
20246
20664
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
20247
20665
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -20648,6 +21066,50 @@ export class Group extends Object {
|
|
20648
21066
|
}
|
20649
21067
|
instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable =
|
20650
21068
|
_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable;
|
21069
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
21070
|
+
let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"];
|
21071
|
+
for (const v of _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array == null
|
21072
|
+
? []
|
21073
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array.length === 1 &&
|
21074
|
+
"@list" in _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]
|
21075
|
+
? _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]["@list"]
|
21076
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array) {
|
21077
|
+
if (v == null)
|
21078
|
+
continue;
|
21079
|
+
if (typeof v === "object" && "@id" in v && !("@type" in v) &&
|
21080
|
+
globalThis.Object.keys(v).length === 1) {
|
21081
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(!URL.canParse(v["@id"]) && v["@id"].startsWith("at://")
|
21082
|
+
? new URL("at://" + encodeURIComponent(v["@id"].substring(5)))
|
21083
|
+
: new URL(v["@id"]));
|
21084
|
+
continue;
|
21085
|
+
}
|
21086
|
+
const decoded = typeof v === "object" && "@type" in v &&
|
21087
|
+
Array.isArray(v["@type"]) &&
|
21088
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Application")
|
21089
|
+
? await Application.fromJsonLd(v, options)
|
21090
|
+
: typeof v === "object" && "@type" in v &&
|
21091
|
+
Array.isArray(v["@type"]) &&
|
21092
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Group")
|
21093
|
+
? await _d.fromJsonLd(v, options)
|
21094
|
+
: typeof v === "object" && "@type" in v &&
|
21095
|
+
Array.isArray(v["@type"]) &&
|
21096
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization")
|
21097
|
+
? await Organization.fromJsonLd(v, options)
|
21098
|
+
: typeof v === "object" && "@type" in v &&
|
21099
|
+
Array.isArray(v["@type"]) &&
|
21100
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Person")
|
21101
|
+
? await Person.fromJsonLd(v, options)
|
21102
|
+
: typeof v === "object" && "@type" in v &&
|
21103
|
+
Array.isArray(v["@type"]) &&
|
21104
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Service")
|
21105
|
+
? await Service.fromJsonLd(v, options)
|
21106
|
+
: undefined;
|
21107
|
+
if (typeof decoded === "undefined")
|
21108
|
+
continue;
|
21109
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(decoded);
|
21110
|
+
}
|
21111
|
+
instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
21112
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
20651
21113
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
20652
21114
|
let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"];
|
20653
21115
|
for (const v of _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array == null
|
@@ -20963,6 +21425,18 @@ export class Group extends Object {
|
|
20963
21425
|
if (_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length == 1) {
|
20964
21426
|
proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
20965
21427
|
}
|
21428
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this
|
21429
|
+
.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo
|
21430
|
+
// deno-lint-ignore no-explicit-any
|
21431
|
+
.map((v) => v instanceof URL
|
21432
|
+
? {
|
21433
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
21434
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
|
21435
|
+
}
|
21436
|
+
: v);
|
21437
|
+
if (_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length == 1) {
|
21438
|
+
proxy.successor = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
21439
|
+
}
|
20966
21440
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this
|
20967
21441
|
.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs
|
20968
21442
|
// deno-lint-ignore no-explicit-any
|
@@ -24942,6 +25416,7 @@ export class Organization extends Object {
|
|
24942
25416
|
#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = [];
|
24943
25417
|
#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = [];
|
24944
25418
|
#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = [];
|
25419
|
+
#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
24945
25420
|
#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
24946
25421
|
#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [];
|
24947
25422
|
#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = [];
|
@@ -25189,6 +25664,20 @@ export class Organization extends Object {
|
|
25189
25664
|
"boolean" + ".");
|
25190
25665
|
}
|
25191
25666
|
}
|
25667
|
+
if ("successor" in values && values.successor != null) {
|
25668
|
+
if (values.successor instanceof Application ||
|
25669
|
+
values.successor instanceof Group ||
|
25670
|
+
values.successor instanceof _f ||
|
25671
|
+
values.successor instanceof Person ||
|
25672
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
25673
|
+
// @ts-ignore: type is checked above.
|
25674
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
25675
|
+
}
|
25676
|
+
else {
|
25677
|
+
throw new TypeError("The successor must be of type " +
|
25678
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
25679
|
+
}
|
25680
|
+
}
|
25192
25681
|
if ("alias" in values && values.alias != null) {
|
25193
25682
|
if (values.alias instanceof Application || values.alias instanceof Group ||
|
25194
25683
|
values.alias instanceof _f ||
|
@@ -25538,6 +26027,22 @@ export class Organization extends Object {
|
|
25538
26027
|
"boolean" + ".");
|
25539
26028
|
}
|
25540
26029
|
}
|
26030
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
26031
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
26032
|
+
if ("successor" in values && values.successor != null) {
|
26033
|
+
if (values.successor instanceof Application ||
|
26034
|
+
values.successor instanceof Group ||
|
26035
|
+
values.successor instanceof _f ||
|
26036
|
+
values.successor instanceof Person ||
|
26037
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
26038
|
+
// @ts-ignore: type is checked above.
|
26039
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
26040
|
+
}
|
26041
|
+
else {
|
26042
|
+
throw new TypeError("The successor must be of type " +
|
26043
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
26044
|
+
}
|
26045
|
+
}
|
25541
26046
|
clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs =
|
25542
26047
|
this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs;
|
25543
26048
|
if ("alias" in values && values.alias != null) {
|
@@ -26332,7 +26837,7 @@ export class Organization extends Object {
|
|
26332
26837
|
return null;
|
26333
26838
|
return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
26334
26839
|
}
|
26335
|
-
async #
|
26840
|
+
async #fetchSuccessor(url, options = {}) {
|
26336
26841
|
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
26337
26842
|
fetchDocumentLoader;
|
26338
26843
|
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
@@ -26395,37 +26900,126 @@ export class Organization extends Object {
|
|
26395
26900
|
}
|
26396
26901
|
/**
|
26397
26902
|
* Similar to
|
26398
|
-
* {@link Organization.
|
26903
|
+
* {@link Organization.getSuccessor},
|
26399
26904
|
* but returns its `@id` URL instead of the object itself.
|
26400
26905
|
*/
|
26401
|
-
get
|
26402
|
-
if (this.#
|
26906
|
+
get successorId() {
|
26907
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
26403
26908
|
return null;
|
26404
|
-
const v = this.#
|
26909
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
26405
26910
|
if (v instanceof URL)
|
26406
26911
|
return v;
|
26407
26912
|
return v.id;
|
26408
26913
|
}
|
26409
|
-
/**
|
26410
|
-
* or aliases for an entity. It can be used to provide additional identifiers
|
26411
|
-
* or labels for an entity, which can be useful in scenarios where an entity
|
26412
|
-
* may have multiple names or aliases.
|
26914
|
+
/** Signifies that an actor has been moved to a different ID. Used in Mastodon-style data portability with the {@link Move} activity; see [ActivityPub Data Portability/Move Action](https://swicg.github.io/activitypub-data-portability/#move-action) for more details.
|
26413
26915
|
*/
|
26414
|
-
async
|
26415
|
-
if (this.#
|
26916
|
+
async getSuccessor(options = {}) {
|
26917
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
26416
26918
|
return null;
|
26417
|
-
const v = this.#
|
26919
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
26418
26920
|
if (v instanceof URL) {
|
26419
|
-
const fetched = await this.#
|
26921
|
+
const fetched = await this.#fetchSuccessor(v, options);
|
26420
26922
|
if (fetched == null)
|
26421
26923
|
return null;
|
26422
|
-
this.#
|
26924
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0] = fetched;
|
26423
26925
|
return fetched;
|
26424
26926
|
}
|
26425
26927
|
return v;
|
26426
26928
|
}
|
26427
|
-
|
26428
|
-
|
26929
|
+
async #fetchAlias(url, options = {}) {
|
26930
|
+
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
26931
|
+
fetchDocumentLoader;
|
26932
|
+
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
26933
|
+
fetchDocumentLoader;
|
26934
|
+
let fetchResult;
|
26935
|
+
try {
|
26936
|
+
fetchResult = await documentLoader(url.href);
|
26937
|
+
}
|
26938
|
+
catch (error) {
|
26939
|
+
if (options.suppressError) {
|
26940
|
+
getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
|
26941
|
+
return null;
|
26942
|
+
}
|
26943
|
+
throw error;
|
26944
|
+
}
|
26945
|
+
const { document } = fetchResult;
|
26946
|
+
try {
|
26947
|
+
return await Application.fromJsonLd(document, { documentLoader, contextLoader });
|
26948
|
+
}
|
26949
|
+
catch (e) {
|
26950
|
+
if (!(e instanceof TypeError))
|
26951
|
+
throw e;
|
26952
|
+
}
|
26953
|
+
try {
|
26954
|
+
return await Group.fromJsonLd(document, { documentLoader, contextLoader });
|
26955
|
+
}
|
26956
|
+
catch (e) {
|
26957
|
+
if (!(e instanceof TypeError))
|
26958
|
+
throw e;
|
26959
|
+
}
|
26960
|
+
try {
|
26961
|
+
return await _f.fromJsonLd(document, { documentLoader, contextLoader });
|
26962
|
+
}
|
26963
|
+
catch (e) {
|
26964
|
+
if (!(e instanceof TypeError))
|
26965
|
+
throw e;
|
26966
|
+
}
|
26967
|
+
try {
|
26968
|
+
return await Person.fromJsonLd(document, { documentLoader, contextLoader });
|
26969
|
+
}
|
26970
|
+
catch (e) {
|
26971
|
+
if (!(e instanceof TypeError))
|
26972
|
+
throw e;
|
26973
|
+
}
|
26974
|
+
try {
|
26975
|
+
return await Service.fromJsonLd(document, { documentLoader, contextLoader });
|
26976
|
+
}
|
26977
|
+
catch (e) {
|
26978
|
+
if (!(e instanceof TypeError))
|
26979
|
+
throw e;
|
26980
|
+
}
|
26981
|
+
throw new TypeError("Expected an object of any type of: " +
|
26982
|
+
[
|
26983
|
+
"https://www.w3.org/ns/activitystreams#Application",
|
26984
|
+
"https://www.w3.org/ns/activitystreams#Group",
|
26985
|
+
"https://www.w3.org/ns/activitystreams#Organization",
|
26986
|
+
"https://www.w3.org/ns/activitystreams#Person",
|
26987
|
+
"https://www.w3.org/ns/activitystreams#Service",
|
26988
|
+
].join(", "));
|
26989
|
+
}
|
26990
|
+
/**
|
26991
|
+
* Similar to
|
26992
|
+
* {@link Organization.getAlias},
|
26993
|
+
* but returns its `@id` URL instead of the object itself.
|
26994
|
+
*/
|
26995
|
+
get aliasId() {
|
26996
|
+
if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1)
|
26997
|
+
return null;
|
26998
|
+
const v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0];
|
26999
|
+
if (v instanceof URL)
|
27000
|
+
return v;
|
27001
|
+
return v.id;
|
27002
|
+
}
|
27003
|
+
/** The `aliases` (`alsoKnownAs`) property is used to specify alternative names
|
27004
|
+
* or aliases for an entity. It can be used to provide additional identifiers
|
27005
|
+
* or labels for an entity, which can be useful in scenarios where an entity
|
27006
|
+
* may have multiple names or aliases.
|
27007
|
+
*/
|
27008
|
+
async getAlias(options = {}) {
|
27009
|
+
if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1)
|
27010
|
+
return null;
|
27011
|
+
const v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0];
|
27012
|
+
if (v instanceof URL) {
|
27013
|
+
const fetched = await this.#fetchAlias(v, options);
|
27014
|
+
if (fetched == null)
|
27015
|
+
return null;
|
27016
|
+
this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0] = fetched;
|
27017
|
+
return fetched;
|
27018
|
+
}
|
27019
|
+
return v;
|
27020
|
+
}
|
27021
|
+
/**
|
27022
|
+
* Similar to
|
26429
27023
|
* {@link Organization.getAliases},
|
26430
27024
|
* but returns their `@id`s instead of the objects themselves.
|
26431
27025
|
*/
|
@@ -26796,6 +27390,46 @@ export class Organization extends Object {
|
|
26796
27390
|
: compactItems[0];
|
26797
27391
|
}
|
26798
27392
|
compactItems = [];
|
27393
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
27394
|
+
const item = v instanceof URL
|
27395
|
+
? v.href
|
27396
|
+
: v instanceof Application
|
27397
|
+
? await v.toJsonLd({
|
27398
|
+
...options,
|
27399
|
+
format: undefined,
|
27400
|
+
context: undefined,
|
27401
|
+
})
|
27402
|
+
: v instanceof Group
|
27403
|
+
? await v.toJsonLd({
|
27404
|
+
...options,
|
27405
|
+
format: undefined,
|
27406
|
+
context: undefined,
|
27407
|
+
})
|
27408
|
+
: v instanceof _f
|
27409
|
+
? await v.toJsonLd({
|
27410
|
+
...options,
|
27411
|
+
format: undefined,
|
27412
|
+
context: undefined,
|
27413
|
+
})
|
27414
|
+
: v instanceof Person
|
27415
|
+
? await v.toJsonLd({
|
27416
|
+
...options,
|
27417
|
+
format: undefined,
|
27418
|
+
context: undefined,
|
27419
|
+
})
|
27420
|
+
: await v.toJsonLd({
|
27421
|
+
...options,
|
27422
|
+
format: undefined,
|
27423
|
+
context: undefined,
|
27424
|
+
});
|
27425
|
+
compactItems.push(item);
|
27426
|
+
}
|
27427
|
+
if (compactItems.length > 0) {
|
27428
|
+
result["movedTo"] = compactItems.length > 1
|
27429
|
+
? compactItems
|
27430
|
+
: compactItems[0];
|
27431
|
+
}
|
27432
|
+
compactItems = [];
|
26799
27433
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
26800
27434
|
const item = v instanceof URL
|
26801
27435
|
? v.href
|
@@ -26871,6 +27505,7 @@ export class Organization extends Object {
|
|
26871
27505
|
{
|
26872
27506
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
26873
27507
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
27508
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
26874
27509
|
"toot": "http://joinmastodon.org/ns#",
|
26875
27510
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
26876
27511
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -27073,6 +27708,25 @@ export class Organization extends Object {
|
|
27073
27708
|
values["http://joinmastodon.org/ns#indexable"] = propValue;
|
27074
27709
|
}
|
27075
27710
|
array = [];
|
27711
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
27712
|
+
const element = v instanceof URL
|
27713
|
+
? { "@id": v.href }
|
27714
|
+
: v instanceof Application
|
27715
|
+
? await v.toJsonLd(options)
|
27716
|
+
: v instanceof Group
|
27717
|
+
? await v.toJsonLd(options)
|
27718
|
+
: v instanceof _f
|
27719
|
+
? await v.toJsonLd(options)
|
27720
|
+
: v instanceof Person
|
27721
|
+
? await v.toJsonLd(options)
|
27722
|
+
: await v.toJsonLd(options);
|
27723
|
+
array.push(element);
|
27724
|
+
}
|
27725
|
+
if (array.length > 0) {
|
27726
|
+
const propValue = array;
|
27727
|
+
values["https://www.w3.org/ns/activitystreams#movedTo"] = propValue;
|
27728
|
+
}
|
27729
|
+
array = [];
|
27076
27730
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
27077
27731
|
const element = v instanceof URL
|
27078
27732
|
? { "@id": v.href }
|
@@ -27127,6 +27781,7 @@ export class Organization extends Object {
|
|
27127
27781
|
{
|
27128
27782
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
27129
27783
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
27784
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
27130
27785
|
"toot": "http://joinmastodon.org/ns#",
|
27131
27786
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
27132
27787
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -27533,6 +28188,50 @@ export class Organization extends Object {
|
|
27533
28188
|
}
|
27534
28189
|
instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable =
|
27535
28190
|
_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable;
|
28191
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
28192
|
+
let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"];
|
28193
|
+
for (const v of _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array == null
|
28194
|
+
? []
|
28195
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array.length === 1 &&
|
28196
|
+
"@list" in _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]
|
28197
|
+
? _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]["@list"]
|
28198
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array) {
|
28199
|
+
if (v == null)
|
28200
|
+
continue;
|
28201
|
+
if (typeof v === "object" && "@id" in v && !("@type" in v) &&
|
28202
|
+
globalThis.Object.keys(v).length === 1) {
|
28203
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(!URL.canParse(v["@id"]) && v["@id"].startsWith("at://")
|
28204
|
+
? new URL("at://" + encodeURIComponent(v["@id"].substring(5)))
|
28205
|
+
: new URL(v["@id"]));
|
28206
|
+
continue;
|
28207
|
+
}
|
28208
|
+
const decoded = typeof v === "object" && "@type" in v &&
|
28209
|
+
Array.isArray(v["@type"]) &&
|
28210
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Application")
|
28211
|
+
? await Application.fromJsonLd(v, options)
|
28212
|
+
: typeof v === "object" && "@type" in v &&
|
28213
|
+
Array.isArray(v["@type"]) &&
|
28214
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Group")
|
28215
|
+
? await Group.fromJsonLd(v, options)
|
28216
|
+
: typeof v === "object" && "@type" in v &&
|
28217
|
+
Array.isArray(v["@type"]) &&
|
28218
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization")
|
28219
|
+
? await _f.fromJsonLd(v, options)
|
28220
|
+
: typeof v === "object" && "@type" in v &&
|
28221
|
+
Array.isArray(v["@type"]) &&
|
28222
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Person")
|
28223
|
+
? await Person.fromJsonLd(v, options)
|
28224
|
+
: typeof v === "object" && "@type" in v &&
|
28225
|
+
Array.isArray(v["@type"]) &&
|
28226
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Service")
|
28227
|
+
? await Service.fromJsonLd(v, options)
|
28228
|
+
: undefined;
|
28229
|
+
if (typeof decoded === "undefined")
|
28230
|
+
continue;
|
28231
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(decoded);
|
28232
|
+
}
|
28233
|
+
instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
28234
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
27536
28235
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
27537
28236
|
let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"];
|
27538
28237
|
for (const v of _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array == null
|
@@ -27848,6 +28547,18 @@ export class Organization extends Object {
|
|
27848
28547
|
if (_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length == 1) {
|
27849
28548
|
proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
27850
28549
|
}
|
28550
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this
|
28551
|
+
.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo
|
28552
|
+
// deno-lint-ignore no-explicit-any
|
28553
|
+
.map((v) => v instanceof URL
|
28554
|
+
? {
|
28555
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
28556
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
|
28557
|
+
}
|
28558
|
+
: v);
|
28559
|
+
if (_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length == 1) {
|
28560
|
+
proxy.successor = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
28561
|
+
}
|
27851
28562
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this
|
27852
28563
|
.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs
|
27853
28564
|
// deno-lint-ignore no-explicit-any
|
@@ -28108,6 +28819,7 @@ export class Person extends Object {
|
|
28108
28819
|
#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = [];
|
28109
28820
|
#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = [];
|
28110
28821
|
#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = [];
|
28822
|
+
#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
28111
28823
|
#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
28112
28824
|
#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [];
|
28113
28825
|
#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = [];
|
@@ -28355,6 +29067,20 @@ export class Person extends Object {
|
|
28355
29067
|
"boolean" + ".");
|
28356
29068
|
}
|
28357
29069
|
}
|
29070
|
+
if ("successor" in values && values.successor != null) {
|
29071
|
+
if (values.successor instanceof Application ||
|
29072
|
+
values.successor instanceof Group ||
|
29073
|
+
values.successor instanceof Organization ||
|
29074
|
+
values.successor instanceof _g ||
|
29075
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
29076
|
+
// @ts-ignore: type is checked above.
|
29077
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
29078
|
+
}
|
29079
|
+
else {
|
29080
|
+
throw new TypeError("The successor must be of type " +
|
29081
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
29082
|
+
}
|
29083
|
+
}
|
28358
29084
|
if ("alias" in values && values.alias != null) {
|
28359
29085
|
if (values.alias instanceof Application || values.alias instanceof Group ||
|
28360
29086
|
values.alias instanceof Organization ||
|
@@ -28704,6 +29430,22 @@ export class Person extends Object {
|
|
28704
29430
|
"boolean" + ".");
|
28705
29431
|
}
|
28706
29432
|
}
|
29433
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
29434
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
29435
|
+
if ("successor" in values && values.successor != null) {
|
29436
|
+
if (values.successor instanceof Application ||
|
29437
|
+
values.successor instanceof Group ||
|
29438
|
+
values.successor instanceof Organization ||
|
29439
|
+
values.successor instanceof _g ||
|
29440
|
+
values.successor instanceof Service || values.successor instanceof URL) {
|
29441
|
+
// @ts-ignore: type is checked above.
|
29442
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
29443
|
+
}
|
29444
|
+
else {
|
29445
|
+
throw new TypeError("The successor must be of type " +
|
29446
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
29447
|
+
}
|
29448
|
+
}
|
28707
29449
|
clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs =
|
28708
29450
|
this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs;
|
28709
29451
|
if ("alias" in values && values.alias != null) {
|
@@ -29498,6 +30240,95 @@ export class Person extends Object {
|
|
29498
30240
|
return null;
|
29499
30241
|
return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
29500
30242
|
}
|
30243
|
+
async #fetchSuccessor(url, options = {}) {
|
30244
|
+
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
30245
|
+
fetchDocumentLoader;
|
30246
|
+
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
30247
|
+
fetchDocumentLoader;
|
30248
|
+
let fetchResult;
|
30249
|
+
try {
|
30250
|
+
fetchResult = await documentLoader(url.href);
|
30251
|
+
}
|
30252
|
+
catch (error) {
|
30253
|
+
if (options.suppressError) {
|
30254
|
+
getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
|
30255
|
+
return null;
|
30256
|
+
}
|
30257
|
+
throw error;
|
30258
|
+
}
|
30259
|
+
const { document } = fetchResult;
|
30260
|
+
try {
|
30261
|
+
return await Application.fromJsonLd(document, { documentLoader, contextLoader });
|
30262
|
+
}
|
30263
|
+
catch (e) {
|
30264
|
+
if (!(e instanceof TypeError))
|
30265
|
+
throw e;
|
30266
|
+
}
|
30267
|
+
try {
|
30268
|
+
return await Group.fromJsonLd(document, { documentLoader, contextLoader });
|
30269
|
+
}
|
30270
|
+
catch (e) {
|
30271
|
+
if (!(e instanceof TypeError))
|
30272
|
+
throw e;
|
30273
|
+
}
|
30274
|
+
try {
|
30275
|
+
return await Organization.fromJsonLd(document, { documentLoader, contextLoader });
|
30276
|
+
}
|
30277
|
+
catch (e) {
|
30278
|
+
if (!(e instanceof TypeError))
|
30279
|
+
throw e;
|
30280
|
+
}
|
30281
|
+
try {
|
30282
|
+
return await _g.fromJsonLd(document, { documentLoader, contextLoader });
|
30283
|
+
}
|
30284
|
+
catch (e) {
|
30285
|
+
if (!(e instanceof TypeError))
|
30286
|
+
throw e;
|
30287
|
+
}
|
30288
|
+
try {
|
30289
|
+
return await Service.fromJsonLd(document, { documentLoader, contextLoader });
|
30290
|
+
}
|
30291
|
+
catch (e) {
|
30292
|
+
if (!(e instanceof TypeError))
|
30293
|
+
throw e;
|
30294
|
+
}
|
30295
|
+
throw new TypeError("Expected an object of any type of: " +
|
30296
|
+
[
|
30297
|
+
"https://www.w3.org/ns/activitystreams#Application",
|
30298
|
+
"https://www.w3.org/ns/activitystreams#Group",
|
30299
|
+
"https://www.w3.org/ns/activitystreams#Organization",
|
30300
|
+
"https://www.w3.org/ns/activitystreams#Person",
|
30301
|
+
"https://www.w3.org/ns/activitystreams#Service",
|
30302
|
+
].join(", "));
|
30303
|
+
}
|
30304
|
+
/**
|
30305
|
+
* Similar to
|
30306
|
+
* {@link Person.getSuccessor},
|
30307
|
+
* but returns its `@id` URL instead of the object itself.
|
30308
|
+
*/
|
30309
|
+
get successorId() {
|
30310
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
30311
|
+
return null;
|
30312
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
30313
|
+
if (v instanceof URL)
|
30314
|
+
return v;
|
30315
|
+
return v.id;
|
30316
|
+
}
|
30317
|
+
/** Signifies that an actor has been moved to a different ID. Used in Mastodon-style data portability with the {@link Move} activity; see [ActivityPub Data Portability/Move Action](https://swicg.github.io/activitypub-data-portability/#move-action) for more details.
|
30318
|
+
*/
|
30319
|
+
async getSuccessor(options = {}) {
|
30320
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
30321
|
+
return null;
|
30322
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
30323
|
+
if (v instanceof URL) {
|
30324
|
+
const fetched = await this.#fetchSuccessor(v, options);
|
30325
|
+
if (fetched == null)
|
30326
|
+
return null;
|
30327
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0] = fetched;
|
30328
|
+
return fetched;
|
30329
|
+
}
|
30330
|
+
return v;
|
30331
|
+
}
|
29501
30332
|
async #fetchAlias(url, options = {}) {
|
29502
30333
|
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
29503
30334
|
fetchDocumentLoader;
|
@@ -29957,7 +30788,47 @@ export class Person extends Object {
|
|
29957
30788
|
compactItems.push(item);
|
29958
30789
|
}
|
29959
30790
|
if (compactItems.length > 0) {
|
29960
|
-
result["indexable"] = compactItems.length > 1
|
30791
|
+
result["indexable"] = compactItems.length > 1
|
30792
|
+
? compactItems
|
30793
|
+
: compactItems[0];
|
30794
|
+
}
|
30795
|
+
compactItems = [];
|
30796
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
30797
|
+
const item = v instanceof URL
|
30798
|
+
? v.href
|
30799
|
+
: v instanceof Application
|
30800
|
+
? await v.toJsonLd({
|
30801
|
+
...options,
|
30802
|
+
format: undefined,
|
30803
|
+
context: undefined,
|
30804
|
+
})
|
30805
|
+
: v instanceof Group
|
30806
|
+
? await v.toJsonLd({
|
30807
|
+
...options,
|
30808
|
+
format: undefined,
|
30809
|
+
context: undefined,
|
30810
|
+
})
|
30811
|
+
: v instanceof Organization
|
30812
|
+
? await v.toJsonLd({
|
30813
|
+
...options,
|
30814
|
+
format: undefined,
|
30815
|
+
context: undefined,
|
30816
|
+
})
|
30817
|
+
: v instanceof _g
|
30818
|
+
? await v.toJsonLd({
|
30819
|
+
...options,
|
30820
|
+
format: undefined,
|
30821
|
+
context: undefined,
|
30822
|
+
})
|
30823
|
+
: await v.toJsonLd({
|
30824
|
+
...options,
|
30825
|
+
format: undefined,
|
30826
|
+
context: undefined,
|
30827
|
+
});
|
30828
|
+
compactItems.push(item);
|
30829
|
+
}
|
30830
|
+
if (compactItems.length > 0) {
|
30831
|
+
result["movedTo"] = compactItems.length > 1
|
29961
30832
|
? compactItems
|
29962
30833
|
: compactItems[0];
|
29963
30834
|
}
|
@@ -30037,6 +30908,7 @@ export class Person extends Object {
|
|
30037
30908
|
{
|
30038
30909
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
30039
30910
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
30911
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
30040
30912
|
"toot": "http://joinmastodon.org/ns#",
|
30041
30913
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
30042
30914
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -30239,6 +31111,25 @@ export class Person extends Object {
|
|
30239
31111
|
values["http://joinmastodon.org/ns#indexable"] = propValue;
|
30240
31112
|
}
|
30241
31113
|
array = [];
|
31114
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
31115
|
+
const element = v instanceof URL
|
31116
|
+
? { "@id": v.href }
|
31117
|
+
: v instanceof Application
|
31118
|
+
? await v.toJsonLd(options)
|
31119
|
+
: v instanceof Group
|
31120
|
+
? await v.toJsonLd(options)
|
31121
|
+
: v instanceof Organization
|
31122
|
+
? await v.toJsonLd(options)
|
31123
|
+
: v instanceof _g
|
31124
|
+
? await v.toJsonLd(options)
|
31125
|
+
: await v.toJsonLd(options);
|
31126
|
+
array.push(element);
|
31127
|
+
}
|
31128
|
+
if (array.length > 0) {
|
31129
|
+
const propValue = array;
|
31130
|
+
values["https://www.w3.org/ns/activitystreams#movedTo"] = propValue;
|
31131
|
+
}
|
31132
|
+
array = [];
|
30242
31133
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
30243
31134
|
const element = v instanceof URL
|
30244
31135
|
? { "@id": v.href }
|
@@ -30293,6 +31184,7 @@ export class Person extends Object {
|
|
30293
31184
|
{
|
30294
31185
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
30295
31186
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
31187
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
30296
31188
|
"toot": "http://joinmastodon.org/ns#",
|
30297
31189
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
30298
31190
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -30699,6 +31591,50 @@ export class Person extends Object {
|
|
30699
31591
|
}
|
30700
31592
|
instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable =
|
30701
31593
|
_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable;
|
31594
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
31595
|
+
let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"];
|
31596
|
+
for (const v of _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array == null
|
31597
|
+
? []
|
31598
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array.length === 1 &&
|
31599
|
+
"@list" in _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]
|
31600
|
+
? _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]["@list"]
|
31601
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array) {
|
31602
|
+
if (v == null)
|
31603
|
+
continue;
|
31604
|
+
if (typeof v === "object" && "@id" in v && !("@type" in v) &&
|
31605
|
+
globalThis.Object.keys(v).length === 1) {
|
31606
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(!URL.canParse(v["@id"]) && v["@id"].startsWith("at://")
|
31607
|
+
? new URL("at://" + encodeURIComponent(v["@id"].substring(5)))
|
31608
|
+
: new URL(v["@id"]));
|
31609
|
+
continue;
|
31610
|
+
}
|
31611
|
+
const decoded = typeof v === "object" && "@type" in v &&
|
31612
|
+
Array.isArray(v["@type"]) &&
|
31613
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Application")
|
31614
|
+
? await Application.fromJsonLd(v, options)
|
31615
|
+
: typeof v === "object" && "@type" in v &&
|
31616
|
+
Array.isArray(v["@type"]) &&
|
31617
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Group")
|
31618
|
+
? await Group.fromJsonLd(v, options)
|
31619
|
+
: typeof v === "object" && "@type" in v &&
|
31620
|
+
Array.isArray(v["@type"]) &&
|
31621
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization")
|
31622
|
+
? await Organization.fromJsonLd(v, options)
|
31623
|
+
: typeof v === "object" && "@type" in v &&
|
31624
|
+
Array.isArray(v["@type"]) &&
|
31625
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Person")
|
31626
|
+
? await _g.fromJsonLd(v, options)
|
31627
|
+
: typeof v === "object" && "@type" in v &&
|
31628
|
+
Array.isArray(v["@type"]) &&
|
31629
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Service")
|
31630
|
+
? await Service.fromJsonLd(v, options)
|
31631
|
+
: undefined;
|
31632
|
+
if (typeof decoded === "undefined")
|
31633
|
+
continue;
|
31634
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(decoded);
|
31635
|
+
}
|
31636
|
+
instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
31637
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
30702
31638
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
30703
31639
|
let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"];
|
30704
31640
|
for (const v of _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array == null
|
@@ -31014,6 +31950,18 @@ export class Person extends Object {
|
|
31014
31950
|
if (_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length == 1) {
|
31015
31951
|
proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
31016
31952
|
}
|
31953
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this
|
31954
|
+
.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo
|
31955
|
+
// deno-lint-ignore no-explicit-any
|
31956
|
+
.map((v) => v instanceof URL
|
31957
|
+
? {
|
31958
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
31959
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
|
31960
|
+
}
|
31961
|
+
: v);
|
31962
|
+
if (_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length == 1) {
|
31963
|
+
proxy.successor = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
31964
|
+
}
|
31017
31965
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this
|
31018
31966
|
.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs
|
31019
31967
|
// deno-lint-ignore no-explicit-any
|
@@ -33968,6 +34916,7 @@ export class Service extends Object {
|
|
33968
34916
|
#_2kGKkJtoFWg8c18PaVSqj9NKP4t7_suspended = [];
|
33969
34917
|
#_79S8K4f5J9MWUgCxziRyUe6PTHZ_memorial = [];
|
33970
34918
|
#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable = [];
|
34919
|
+
#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
33971
34920
|
#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
33972
34921
|
#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service = [];
|
33973
34922
|
#_2xEU4QtkC53RAun67T81Egqt9vmL_isCat = [];
|
@@ -34215,6 +35164,20 @@ export class Service extends Object {
|
|
34215
35164
|
"boolean" + ".");
|
34216
35165
|
}
|
34217
35166
|
}
|
35167
|
+
if ("successor" in values && values.successor != null) {
|
35168
|
+
if (values.successor instanceof Application ||
|
35169
|
+
values.successor instanceof Group ||
|
35170
|
+
values.successor instanceof Organization ||
|
35171
|
+
values.successor instanceof Person ||
|
35172
|
+
values.successor instanceof _h || values.successor instanceof URL) {
|
35173
|
+
// @ts-ignore: type is checked above.
|
35174
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
35175
|
+
}
|
35176
|
+
else {
|
35177
|
+
throw new TypeError("The successor must be of type " +
|
35178
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
35179
|
+
}
|
35180
|
+
}
|
34218
35181
|
if ("alias" in values && values.alias != null) {
|
34219
35182
|
if (values.alias instanceof Application || values.alias instanceof Group ||
|
34220
35183
|
values.alias instanceof Organization ||
|
@@ -34564,6 +35527,22 @@ export class Service extends Object {
|
|
34564
35527
|
"boolean" + ".");
|
34565
35528
|
}
|
34566
35529
|
}
|
35530
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
35531
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
35532
|
+
if ("successor" in values && values.successor != null) {
|
35533
|
+
if (values.successor instanceof Application ||
|
35534
|
+
values.successor instanceof Group ||
|
35535
|
+
values.successor instanceof Organization ||
|
35536
|
+
values.successor instanceof Person ||
|
35537
|
+
values.successor instanceof _h || values.successor instanceof URL) {
|
35538
|
+
// @ts-ignore: type is checked above.
|
35539
|
+
clone.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [values.successor];
|
35540
|
+
}
|
35541
|
+
else {
|
35542
|
+
throw new TypeError("The successor must be of type " +
|
35543
|
+
"Application | Group | Organization | Person | Service | URL" + ".");
|
35544
|
+
}
|
35545
|
+
}
|
34567
35546
|
clone.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs =
|
34568
35547
|
this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs;
|
34569
35548
|
if ("alias" in values && values.alias != null) {
|
@@ -35358,6 +36337,95 @@ export class Service extends Object {
|
|
35358
36337
|
return null;
|
35359
36338
|
return this.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
35360
36339
|
}
|
36340
|
+
async #fetchSuccessor(url, options = {}) {
|
36341
|
+
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
36342
|
+
fetchDocumentLoader;
|
36343
|
+
const contextLoader = options.contextLoader ?? this._contextLoader ??
|
36344
|
+
fetchDocumentLoader;
|
36345
|
+
let fetchResult;
|
36346
|
+
try {
|
36347
|
+
fetchResult = await documentLoader(url.href);
|
36348
|
+
}
|
36349
|
+
catch (error) {
|
36350
|
+
if (options.suppressError) {
|
36351
|
+
getLogger(["fedify", "vocab"]).error("Failed to fetch {url}: {error}", { error, url: url.href });
|
36352
|
+
return null;
|
36353
|
+
}
|
36354
|
+
throw error;
|
36355
|
+
}
|
36356
|
+
const { document } = fetchResult;
|
36357
|
+
try {
|
36358
|
+
return await Application.fromJsonLd(document, { documentLoader, contextLoader });
|
36359
|
+
}
|
36360
|
+
catch (e) {
|
36361
|
+
if (!(e instanceof TypeError))
|
36362
|
+
throw e;
|
36363
|
+
}
|
36364
|
+
try {
|
36365
|
+
return await Group.fromJsonLd(document, { documentLoader, contextLoader });
|
36366
|
+
}
|
36367
|
+
catch (e) {
|
36368
|
+
if (!(e instanceof TypeError))
|
36369
|
+
throw e;
|
36370
|
+
}
|
36371
|
+
try {
|
36372
|
+
return await Organization.fromJsonLd(document, { documentLoader, contextLoader });
|
36373
|
+
}
|
36374
|
+
catch (e) {
|
36375
|
+
if (!(e instanceof TypeError))
|
36376
|
+
throw e;
|
36377
|
+
}
|
36378
|
+
try {
|
36379
|
+
return await Person.fromJsonLd(document, { documentLoader, contextLoader });
|
36380
|
+
}
|
36381
|
+
catch (e) {
|
36382
|
+
if (!(e instanceof TypeError))
|
36383
|
+
throw e;
|
36384
|
+
}
|
36385
|
+
try {
|
36386
|
+
return await _h.fromJsonLd(document, { documentLoader, contextLoader });
|
36387
|
+
}
|
36388
|
+
catch (e) {
|
36389
|
+
if (!(e instanceof TypeError))
|
36390
|
+
throw e;
|
36391
|
+
}
|
36392
|
+
throw new TypeError("Expected an object of any type of: " +
|
36393
|
+
[
|
36394
|
+
"https://www.w3.org/ns/activitystreams#Application",
|
36395
|
+
"https://www.w3.org/ns/activitystreams#Group",
|
36396
|
+
"https://www.w3.org/ns/activitystreams#Organization",
|
36397
|
+
"https://www.w3.org/ns/activitystreams#Person",
|
36398
|
+
"https://www.w3.org/ns/activitystreams#Service",
|
36399
|
+
].join(", "));
|
36400
|
+
}
|
36401
|
+
/**
|
36402
|
+
* Similar to
|
36403
|
+
* {@link Service.getSuccessor},
|
36404
|
+
* but returns its `@id` URL instead of the object itself.
|
36405
|
+
*/
|
36406
|
+
get successorId() {
|
36407
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
36408
|
+
return null;
|
36409
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
36410
|
+
if (v instanceof URL)
|
36411
|
+
return v;
|
36412
|
+
return v.id;
|
36413
|
+
}
|
36414
|
+
/** Signifies that an actor has been moved to a different ID. Used in Mastodon-style data portability with the {@link Move} activity; see [ActivityPub Data Portability/Move Action](https://swicg.github.io/activitypub-data-portability/#move-action) for more details.
|
36415
|
+
*/
|
36416
|
+
async getSuccessor(options = {}) {
|
36417
|
+
if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1)
|
36418
|
+
return null;
|
36419
|
+
const v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
36420
|
+
if (v instanceof URL) {
|
36421
|
+
const fetched = await this.#fetchSuccessor(v, options);
|
36422
|
+
if (fetched == null)
|
36423
|
+
return null;
|
36424
|
+
this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0] = fetched;
|
36425
|
+
return fetched;
|
36426
|
+
}
|
36427
|
+
return v;
|
36428
|
+
}
|
35361
36429
|
async #fetchAlias(url, options = {}) {
|
35362
36430
|
const documentLoader = options.documentLoader ?? this._documentLoader ??
|
35363
36431
|
fetchDocumentLoader;
|
@@ -35822,6 +36890,46 @@ export class Service extends Object {
|
|
35822
36890
|
: compactItems[0];
|
35823
36891
|
}
|
35824
36892
|
compactItems = [];
|
36893
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
36894
|
+
const item = v instanceof URL
|
36895
|
+
? v.href
|
36896
|
+
: v instanceof Application
|
36897
|
+
? await v.toJsonLd({
|
36898
|
+
...options,
|
36899
|
+
format: undefined,
|
36900
|
+
context: undefined,
|
36901
|
+
})
|
36902
|
+
: v instanceof Group
|
36903
|
+
? await v.toJsonLd({
|
36904
|
+
...options,
|
36905
|
+
format: undefined,
|
36906
|
+
context: undefined,
|
36907
|
+
})
|
36908
|
+
: v instanceof Organization
|
36909
|
+
? await v.toJsonLd({
|
36910
|
+
...options,
|
36911
|
+
format: undefined,
|
36912
|
+
context: undefined,
|
36913
|
+
})
|
36914
|
+
: v instanceof Person
|
36915
|
+
? await v.toJsonLd({
|
36916
|
+
...options,
|
36917
|
+
format: undefined,
|
36918
|
+
context: undefined,
|
36919
|
+
})
|
36920
|
+
: await v.toJsonLd({
|
36921
|
+
...options,
|
36922
|
+
format: undefined,
|
36923
|
+
context: undefined,
|
36924
|
+
});
|
36925
|
+
compactItems.push(item);
|
36926
|
+
}
|
36927
|
+
if (compactItems.length > 0) {
|
36928
|
+
result["movedTo"] = compactItems.length > 1
|
36929
|
+
? compactItems
|
36930
|
+
: compactItems[0];
|
36931
|
+
}
|
36932
|
+
compactItems = [];
|
35825
36933
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
35826
36934
|
const item = v instanceof URL
|
35827
36935
|
? v.href
|
@@ -35897,6 +37005,7 @@ export class Service extends Object {
|
|
35897
37005
|
{
|
35898
37006
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
35899
37007
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
37008
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
35900
37009
|
"toot": "http://joinmastodon.org/ns#",
|
35901
37010
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
35902
37011
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -36099,6 +37208,25 @@ export class Service extends Object {
|
|
36099
37208
|
values["http://joinmastodon.org/ns#indexable"] = propValue;
|
36100
37209
|
}
|
36101
37210
|
array = [];
|
37211
|
+
for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) {
|
37212
|
+
const element = v instanceof URL
|
37213
|
+
? { "@id": v.href }
|
37214
|
+
: v instanceof Application
|
37215
|
+
? await v.toJsonLd(options)
|
37216
|
+
: v instanceof Group
|
37217
|
+
? await v.toJsonLd(options)
|
37218
|
+
: v instanceof Organization
|
37219
|
+
? await v.toJsonLd(options)
|
37220
|
+
: v instanceof Person
|
37221
|
+
? await v.toJsonLd(options)
|
37222
|
+
: await v.toJsonLd(options);
|
37223
|
+
array.push(element);
|
37224
|
+
}
|
37225
|
+
if (array.length > 0) {
|
37226
|
+
const propValue = array;
|
37227
|
+
values["https://www.w3.org/ns/activitystreams#movedTo"] = propValue;
|
37228
|
+
}
|
37229
|
+
array = [];
|
36102
37230
|
for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) {
|
36103
37231
|
const element = v instanceof URL
|
36104
37232
|
? { "@id": v.href }
|
@@ -36153,6 +37281,7 @@ export class Service extends Object {
|
|
36153
37281
|
{
|
36154
37282
|
"alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" },
|
36155
37283
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
37284
|
+
"movedTo": { "@id": "as:movedTo", "@type": "@id" },
|
36156
37285
|
"toot": "http://joinmastodon.org/ns#",
|
36157
37286
|
"featured": { "@id": "toot:featured", "@type": "@id" },
|
36158
37287
|
"featuredTags": { "@id": "toot:featuredTags", "@type": "@id" },
|
@@ -36559,6 +37688,50 @@ export class Service extends Object {
|
|
36559
37688
|
}
|
36560
37689
|
instance.#_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable =
|
36561
37690
|
_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable;
|
37691
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = [];
|
37692
|
+
let _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array = values["https://www.w3.org/ns/activitystreams#movedTo"];
|
37693
|
+
for (const v of _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array == null
|
37694
|
+
? []
|
37695
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array.length === 1 &&
|
37696
|
+
"@list" in _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]
|
37697
|
+
? _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array[0]["@list"]
|
37698
|
+
: _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo__array) {
|
37699
|
+
if (v == null)
|
37700
|
+
continue;
|
37701
|
+
if (typeof v === "object" && "@id" in v && !("@type" in v) &&
|
37702
|
+
globalThis.Object.keys(v).length === 1) {
|
37703
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(!URL.canParse(v["@id"]) && v["@id"].startsWith("at://")
|
37704
|
+
? new URL("at://" + encodeURIComponent(v["@id"].substring(5)))
|
37705
|
+
: new URL(v["@id"]));
|
37706
|
+
continue;
|
37707
|
+
}
|
37708
|
+
const decoded = typeof v === "object" && "@type" in v &&
|
37709
|
+
Array.isArray(v["@type"]) &&
|
37710
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Application")
|
37711
|
+
? await Application.fromJsonLd(v, options)
|
37712
|
+
: typeof v === "object" && "@type" in v &&
|
37713
|
+
Array.isArray(v["@type"]) &&
|
37714
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Group")
|
37715
|
+
? await Group.fromJsonLd(v, options)
|
37716
|
+
: typeof v === "object" && "@type" in v &&
|
37717
|
+
Array.isArray(v["@type"]) &&
|
37718
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Organization")
|
37719
|
+
? await Organization.fromJsonLd(v, options)
|
37720
|
+
: typeof v === "object" && "@type" in v &&
|
37721
|
+
Array.isArray(v["@type"]) &&
|
37722
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Person")
|
37723
|
+
? await Person.fromJsonLd(v, options)
|
37724
|
+
: typeof v === "object" && "@type" in v &&
|
37725
|
+
Array.isArray(v["@type"]) &&
|
37726
|
+
v["@type"].includes("https://www.w3.org/ns/activitystreams#Service")
|
37727
|
+
? await _h.fromJsonLd(v, options)
|
37728
|
+
: undefined;
|
37729
|
+
if (typeof decoded === "undefined")
|
37730
|
+
continue;
|
37731
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(decoded);
|
37732
|
+
}
|
37733
|
+
instance.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo =
|
37734
|
+
_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo;
|
36562
37735
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = [];
|
36563
37736
|
let _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array = values["https://www.w3.org/ns/activitystreams#alsoKnownAs"];
|
36564
37737
|
for (const v of _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs__array == null
|
@@ -36874,6 +38047,18 @@ export class Service extends Object {
|
|
36874
38047
|
if (_2diCorzqPGQQqftp6e4SrCEwEnyk_indexable.length == 1) {
|
36875
38048
|
proxy.indexable = _2diCorzqPGQQqftp6e4SrCEwEnyk_indexable[0];
|
36876
38049
|
}
|
38050
|
+
const _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo = this
|
38051
|
+
.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo
|
38052
|
+
// deno-lint-ignore no-explicit-any
|
38053
|
+
.map((v) => v instanceof URL
|
38054
|
+
? {
|
38055
|
+
[Symbol.for("Deno.customInspect")]: (inspect, options) => "URL " + inspect(v.href, options),
|
38056
|
+
[Symbol.for("nodejs.util.inspect.custom")]: (_depth, options, inspect) => "URL " + inspect(v.href, options),
|
38057
|
+
}
|
38058
|
+
: v);
|
38059
|
+
if (_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length == 1) {
|
38060
|
+
proxy.successor = _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0];
|
38061
|
+
}
|
36877
38062
|
const _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs = this
|
36878
38063
|
.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs
|
36879
38064
|
// deno-lint-ignore no-explicit-any
|