@fedify/vocab-tools 2.2.0-dev.628 → 2.2.0-dev.700
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 +1 -1
- package/dist/mod.js +1 -1
- package/package.json +1 -1
- package/src/__snapshots__/class.test.ts.deno.snap +2300 -11
- package/src/__snapshots__/class.test.ts.node.snap +2300 -11
- package/src/__snapshots__/class.test.ts.snap +2300 -11
|
@@ -10190,6 +10190,10 @@ get urls(): ((URL | Link))[] {
|
|
|
10190
10190
|
return await ReplyAuthorization.fromJsonLd(json, options);
|
|
10191
10191
|
}
|
|
10192
10192
|
|
|
10193
|
+
if (values[\\"@type\\"].includes(\\"https://w3id.org/valueflows/ont/vf#Proposal\\")) {
|
|
10194
|
+
return await Proposal.fromJsonLd(json, options);
|
|
10195
|
+
}
|
|
10196
|
+
|
|
10193
10197
|
if (values[\\"@type\\"].includes(\\"https://www.w3.org/ns/activitystreams#Activity\\")) {
|
|
10194
10198
|
return await Activity.fromJsonLd(json, options);
|
|
10195
10199
|
}
|
|
@@ -10446,7 +10450,7 @@ get urls(): ((URL | Link))[] {
|
|
|
10446
10450
|
|
|
10447
10451
|
const decoded =
|
|
10448
10452
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
10449
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10453
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10450
10454
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
10451
10455
|
v,
|
|
10452
10456
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -10600,7 +10604,7 @@ get urls(): ((URL | Link))[] {
|
|
|
10600
10604
|
|
|
10601
10605
|
const decoded =
|
|
10602
10606
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
10603
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10607
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10604
10608
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
10605
10609
|
v,
|
|
10606
10610
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -10686,7 +10690,7 @@ get urls(): ((URL | Link))[] {
|
|
|
10686
10690
|
|
|
10687
10691
|
const decoded =
|
|
10688
10692
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
10689
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10693
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10690
10694
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
10691
10695
|
v,
|
|
10692
10696
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -10789,7 +10793,7 @@ get urls(): ((URL | Link))[] {
|
|
|
10789
10793
|
|
|
10790
10794
|
const decoded =
|
|
10791
10795
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
10792
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10796
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10793
10797
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
10794
10798
|
v,
|
|
10795
10799
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -10832,7 +10836,7 @@ get urls(): ((URL | Link))[] {
|
|
|
10832
10836
|
|
|
10833
10837
|
const decoded =
|
|
10834
10838
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
10835
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10839
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10836
10840
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
10837
10841
|
v,
|
|
10838
10842
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -10880,7 +10884,7 @@ get urls(): ((URL | Link))[] {
|
|
|
10880
10884
|
v,
|
|
10881
10885
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
10882
10886
|
) : typeof v === \\"object\\" && \\"@type\\" in v
|
|
10883
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10887
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
10884
10888
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
10885
10889
|
v,
|
|
10886
10890
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -11100,7 +11104,7 @@ get urls(): ((URL | Link))[] {
|
|
|
11100
11104
|
|
|
11101
11105
|
const decoded =
|
|
11102
11106
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
11103
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
11107
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
11104
11108
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
11105
11109
|
v,
|
|
11106
11110
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -17530,6 +17534,574 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;}
|
|
|
17530
17534
|
const proxy = this._getCustomInspectProxy();
|
|
17531
17535
|
return \\"PropertyValue \\" + inspect(proxy, options);
|
|
17532
17536
|
};
|
|
17537
|
+
/** A quantity with a unit of measure.
|
|
17538
|
+
*/
|
|
17539
|
+
export class Measure {
|
|
17540
|
+
|
|
17541
|
+
readonly #documentLoader?: DocumentLoader;
|
|
17542
|
+
readonly #contextLoader?: DocumentLoader;
|
|
17543
|
+
readonly #tracerProvider?: TracerProvider;
|
|
17544
|
+
readonly #warning?: {
|
|
17545
|
+
category: string[];
|
|
17546
|
+
message: string;
|
|
17547
|
+
values?: Record<string, unknown>;
|
|
17548
|
+
};
|
|
17549
|
+
#cachedJsonLd?: unknown;
|
|
17550
|
+
readonly id: URL | null;
|
|
17551
|
+
|
|
17552
|
+
protected get _documentLoader(): DocumentLoader | undefined {
|
|
17553
|
+
return this.#documentLoader;
|
|
17554
|
+
}
|
|
17555
|
+
|
|
17556
|
+
protected get _contextLoader(): DocumentLoader | undefined {
|
|
17557
|
+
return this.#contextLoader;
|
|
17558
|
+
}
|
|
17559
|
+
|
|
17560
|
+
protected get _tracerProvider(): TracerProvider | undefined {
|
|
17561
|
+
return this.#tracerProvider;
|
|
17562
|
+
}
|
|
17563
|
+
|
|
17564
|
+
protected get _warning(): {
|
|
17565
|
+
category: string[];
|
|
17566
|
+
message: string;
|
|
17567
|
+
values?: Record<string, unknown>;
|
|
17568
|
+
} | undefined {
|
|
17569
|
+
return this.#warning;
|
|
17570
|
+
}
|
|
17571
|
+
|
|
17572
|
+
protected get _cachedJsonLd(): unknown | undefined {
|
|
17573
|
+
return this.#cachedJsonLd;
|
|
17574
|
+
}
|
|
17575
|
+
|
|
17576
|
+
protected set _cachedJsonLd(value: unknown | undefined) {
|
|
17577
|
+
this.#cachedJsonLd = value;
|
|
17578
|
+
}
|
|
17579
|
+
|
|
17580
|
+
/**
|
|
17581
|
+
* The type URI of {@link Measure}: \`http://www.ontology-of-units-of-measure.org/resource/om-2/Measure\`.
|
|
17582
|
+
*/
|
|
17583
|
+
static get typeId(): URL {
|
|
17584
|
+
return new URL(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/Measure\\");
|
|
17585
|
+
}
|
|
17586
|
+
#_27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = [];
|
|
17587
|
+
#_1GQx8o2RgxRs4x9G5uT39XYBv7D: (Decimal)[] = [];
|
|
17588
|
+
|
|
17589
|
+
/**
|
|
17590
|
+
* Constructs a new instance of Measure with the given values.
|
|
17591
|
+
* @param values The values to initialize the instance with.
|
|
17592
|
+
* @param options The options to use for initialization.
|
|
17593
|
+
*/
|
|
17594
|
+
constructor(
|
|
17595
|
+
values:
|
|
17596
|
+
{
|
|
17597
|
+
id?: URL | null;
|
|
17598
|
+
unit?: string | null;numericalValue?: Decimal | null;}
|
|
17599
|
+
,
|
|
17600
|
+
options: {
|
|
17601
|
+
documentLoader?: DocumentLoader,
|
|
17602
|
+
contextLoader?: DocumentLoader,
|
|
17603
|
+
tracerProvider?: TracerProvider,
|
|
17604
|
+
} = {},
|
|
17605
|
+
) {
|
|
17606
|
+
|
|
17607
|
+
this.#documentLoader = options.documentLoader;
|
|
17608
|
+
this.#contextLoader = options.contextLoader;
|
|
17609
|
+
this.#tracerProvider = options.tracerProvider;
|
|
17610
|
+
if (\\"\$warning\\" in options) {
|
|
17611
|
+
this.#warning = options.\$warning as unknown as {
|
|
17612
|
+
category: string[];
|
|
17613
|
+
message: string;
|
|
17614
|
+
values?: Record<string, unknown>;
|
|
17615
|
+
};
|
|
17616
|
+
}
|
|
17617
|
+
if (values.id == null || values.id instanceof URL) {
|
|
17618
|
+
this.id = values.id ?? null;
|
|
17619
|
+
} else {
|
|
17620
|
+
throw new TypeError(\\"The id must be a URL.\\");
|
|
17621
|
+
}
|
|
17622
|
+
|
|
17623
|
+
if (\\"unit\\" in values && values.unit != null) {
|
|
17624
|
+
if (typeof values.unit === \\"string\\") {
|
|
17625
|
+
// @ts-ignore: type is checked above.
|
|
17626
|
+
this.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = [values.unit];
|
|
17627
|
+
|
|
17628
|
+
} else {
|
|
17629
|
+
throw new TypeError(
|
|
17630
|
+
\\"The unit must be of type \\" +
|
|
17631
|
+
\\"string\\" + \\".\\",
|
|
17632
|
+
);
|
|
17633
|
+
}
|
|
17634
|
+
}
|
|
17635
|
+
|
|
17636
|
+
if (\\"numericalValue\\" in values && values.numericalValue != null) {
|
|
17637
|
+
if (typeof values.numericalValue === \\"string\\" && isDecimal(values.numericalValue)) {
|
|
17638
|
+
// @ts-ignore: type is checked above.
|
|
17639
|
+
this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = [values.numericalValue];
|
|
17640
|
+
|
|
17641
|
+
} else {
|
|
17642
|
+
throw new TypeError(
|
|
17643
|
+
\\"The numericalValue must be of type \\" +
|
|
17644
|
+
\\"Decimal\\" + \\".\\",
|
|
17645
|
+
);
|
|
17646
|
+
}
|
|
17647
|
+
}
|
|
17648
|
+
}
|
|
17649
|
+
|
|
17650
|
+
/**
|
|
17651
|
+
* Clones this instance, optionally updating it with the given values.
|
|
17652
|
+
* @param values The values to update the clone with.
|
|
17653
|
+
* @param options The options to use for cloning.
|
|
17654
|
+
* @returns The cloned instance.
|
|
17655
|
+
*/
|
|
17656
|
+
clone(
|
|
17657
|
+
values:
|
|
17658
|
+
{
|
|
17659
|
+
id?: URL | null;
|
|
17660
|
+
unit?: string | null;numericalValue?: Decimal | null;}
|
|
17661
|
+
|
|
17662
|
+
= {},
|
|
17663
|
+
options: {
|
|
17664
|
+
documentLoader?: DocumentLoader,
|
|
17665
|
+
contextLoader?: DocumentLoader,
|
|
17666
|
+
} = {}
|
|
17667
|
+
): Measure {
|
|
17668
|
+
if (this._warning != null) {
|
|
17669
|
+
getLogger(this._warning.category).warn(
|
|
17670
|
+
this._warning.message,
|
|
17671
|
+
this._warning.values
|
|
17672
|
+
);
|
|
17673
|
+
// @ts-ignore: \$warning is not recognized as a property, but it is.
|
|
17674
|
+
options = { ...options, \$warning: this._warning };
|
|
17675
|
+
}
|
|
17676
|
+
|
|
17677
|
+
// @ts-ignore: this.constructor is not recognized as a constructor, but it is.
|
|
17678
|
+
const clone: Measure = new this.constructor(
|
|
17679
|
+
{ id: values.id ?? this.id },
|
|
17680
|
+
options
|
|
17681
|
+
);
|
|
17682
|
+
clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6;
|
|
17683
|
+
if (\\"unit\\" in values && values.unit != null) {
|
|
17684
|
+
if (typeof values.unit === \\"string\\") {
|
|
17685
|
+
// @ts-ignore: type is checked above.
|
|
17686
|
+
clone.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = [values.unit];
|
|
17687
|
+
|
|
17688
|
+
} else {
|
|
17689
|
+
throw new TypeError(
|
|
17690
|
+
\\"The unit must be of type \\" +
|
|
17691
|
+
\\"string\\" + \\".\\",
|
|
17692
|
+
);
|
|
17693
|
+
}
|
|
17694
|
+
}
|
|
17695
|
+
clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D;
|
|
17696
|
+
if (\\"numericalValue\\" in values && values.numericalValue != null) {
|
|
17697
|
+
if (typeof values.numericalValue === \\"string\\" && isDecimal(values.numericalValue)) {
|
|
17698
|
+
// @ts-ignore: type is checked above.
|
|
17699
|
+
clone.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = [values.numericalValue];
|
|
17700
|
+
|
|
17701
|
+
} else {
|
|
17702
|
+
throw new TypeError(
|
|
17703
|
+
\\"The numericalValue must be of type \\" +
|
|
17704
|
+
\\"Decimal\\" + \\".\\",
|
|
17705
|
+
);
|
|
17706
|
+
}
|
|
17707
|
+
}
|
|
17708
|
+
|
|
17709
|
+
return clone;
|
|
17710
|
+
}
|
|
17711
|
+
|
|
17712
|
+
/** The name of the unit, according to the Ontology of units of Measure
|
|
17713
|
+
* classification. The recommended unit for countable items is \`\\"one\\"\`.
|
|
17714
|
+
*
|
|
17715
|
+
*/
|
|
17716
|
+
get unit(): (string | null) {
|
|
17717
|
+
if (this._warning != null) {
|
|
17718
|
+
getLogger(this._warning.category).warn(
|
|
17719
|
+
this._warning.message,
|
|
17720
|
+
this._warning.values
|
|
17721
|
+
);
|
|
17722
|
+
}
|
|
17723
|
+
if (this.#_27fgyFbosTtMAhuepJH8K3ZGURT6.length < 1) return null;
|
|
17724
|
+
return this.#_27fgyFbosTtMAhuepJH8K3ZGURT6[0];
|
|
17725
|
+
}
|
|
17726
|
+
|
|
17727
|
+
/** The amount of the resource. If not specified, arbitrary amounts can be
|
|
17728
|
+
* used when responding to the proposal.
|
|
17729
|
+
*
|
|
17730
|
+
*/
|
|
17731
|
+
get numericalValue(): (Decimal | null) {
|
|
17732
|
+
if (this._warning != null) {
|
|
17733
|
+
getLogger(this._warning.category).warn(
|
|
17734
|
+
this._warning.message,
|
|
17735
|
+
this._warning.values
|
|
17736
|
+
);
|
|
17737
|
+
}
|
|
17738
|
+
if (this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D.length < 1) return null;
|
|
17739
|
+
return this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D[0];
|
|
17740
|
+
}
|
|
17741
|
+
|
|
17742
|
+
/**
|
|
17743
|
+
* Converts this object to a JSON-LD structure.
|
|
17744
|
+
* @param options The options to use.
|
|
17745
|
+
* - \`format\`: The format of the output: \`compact\` or
|
|
17746
|
+
\`expand\`.
|
|
17747
|
+
* - \`contextLoader\`: The loader for remote JSON-LD contexts.
|
|
17748
|
+
* - \`context\`: The JSON-LD context to use. Not applicable
|
|
17749
|
+
when \`format\` is set to \`'expand'\`.
|
|
17750
|
+
* @returns The JSON-LD representation of this object.
|
|
17751
|
+
*/
|
|
17752
|
+
async toJsonLd(options: {
|
|
17753
|
+
format?: \\"compact\\" | \\"expand\\",
|
|
17754
|
+
contextLoader?: DocumentLoader,
|
|
17755
|
+
context?: string | Record<string, string> | (string | Record<string, string>)[],
|
|
17756
|
+
} = {}): Promise<unknown> {
|
|
17757
|
+
if (options.format == null && this._cachedJsonLd != null) {
|
|
17758
|
+
return this._cachedJsonLd;
|
|
17759
|
+
}
|
|
17760
|
+
if (options.format !== \\"compact\\" && options.context != null) {
|
|
17761
|
+
throw new TypeError(
|
|
17762
|
+
\\"The context option can only be used when the format option is set \\" +
|
|
17763
|
+
\\"to 'compact'.\\"
|
|
17764
|
+
);
|
|
17765
|
+
}
|
|
17766
|
+
options = {
|
|
17767
|
+
...options,
|
|
17768
|
+
contextLoader: options.contextLoader ?? getDocumentLoader(),
|
|
17769
|
+
};
|
|
17770
|
+
|
|
17771
|
+
if (options.format == null && this.isCompactable()) {
|
|
17772
|
+
const result: Record<string, unknown> = {};
|
|
17773
|
+
// deno-lint-ignore no-unused-vars
|
|
17774
|
+
let compactItems: unknown[];
|
|
17775
|
+
|
|
17776
|
+
compactItems = [];
|
|
17777
|
+
for (const v of this.#_27fgyFbosTtMAhuepJH8K3ZGURT6) {
|
|
17778
|
+
const item = (
|
|
17779
|
+
v
|
|
17780
|
+
);
|
|
17781
|
+
compactItems.push(item);
|
|
17782
|
+
}
|
|
17783
|
+
if (compactItems.length > 0) {
|
|
17784
|
+
|
|
17785
|
+
result[\\"hasUnit\\"]
|
|
17786
|
+
= compactItems.length > 1
|
|
17787
|
+
? compactItems
|
|
17788
|
+
: compactItems[0];
|
|
17789
|
+
|
|
17790
|
+
}
|
|
17791
|
+
|
|
17792
|
+
compactItems = [];
|
|
17793
|
+
for (const v of this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D) {
|
|
17794
|
+
const item = (
|
|
17795
|
+
v
|
|
17796
|
+
);
|
|
17797
|
+
compactItems.push(item);
|
|
17798
|
+
}
|
|
17799
|
+
if (compactItems.length > 0) {
|
|
17800
|
+
|
|
17801
|
+
result[\\"hasNumericalValue\\"]
|
|
17802
|
+
= compactItems.length > 1
|
|
17803
|
+
? compactItems
|
|
17804
|
+
: compactItems[0];
|
|
17805
|
+
|
|
17806
|
+
}
|
|
17807
|
+
|
|
17808
|
+
result[\\"type\\"] = \\"om2:Measure\\";
|
|
17809
|
+
if (this.id != null) result[\\"id\\"] = this.id.href;
|
|
17810
|
+
result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}];
|
|
17811
|
+
return result;
|
|
17812
|
+
}
|
|
17813
|
+
|
|
17814
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
|
17815
|
+
let array: unknown[];
|
|
17816
|
+
const values: Record<string, unknown[] | string> = {};
|
|
17817
|
+
array = [];
|
|
17818
|
+
for (const v of this.#_27fgyFbosTtMAhuepJH8K3ZGURT6) {
|
|
17819
|
+
const element = (
|
|
17820
|
+
{ \\"@value\\": v }
|
|
17821
|
+
);
|
|
17822
|
+
array.push(element);;
|
|
17823
|
+
}
|
|
17824
|
+
if (array.length > 0) {
|
|
17825
|
+
const propValue = (
|
|
17826
|
+
array
|
|
17827
|
+
);
|
|
17828
|
+
values[\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\"] = propValue;
|
|
17829
|
+
|
|
17830
|
+
}
|
|
17831
|
+
|
|
17832
|
+
array = [];
|
|
17833
|
+
for (const v of this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D) {
|
|
17834
|
+
const element = (
|
|
17835
|
+
{
|
|
17836
|
+
\\"@type\\": \\"http://www.w3.org/2001/XMLSchema#decimal\\",
|
|
17837
|
+
\\"@value\\": v,
|
|
17838
|
+
}
|
|
17839
|
+
);
|
|
17840
|
+
array.push(element);;
|
|
17841
|
+
}
|
|
17842
|
+
if (array.length > 0) {
|
|
17843
|
+
const propValue = (
|
|
17844
|
+
array
|
|
17845
|
+
);
|
|
17846
|
+
values[\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\"] = propValue;
|
|
17847
|
+
|
|
17848
|
+
}
|
|
17849
|
+
|
|
17850
|
+
values[\\"@type\\"] = [\\"http://www.ontology-of-units-of-measure.org/resource/om-2/Measure\\"];
|
|
17851
|
+
if (this.id != null) values[\\"@id\\"] = this.id.href;
|
|
17852
|
+
if (options.format === \\"expand\\") {
|
|
17853
|
+
return await jsonld.expand(
|
|
17854
|
+
values,
|
|
17855
|
+
{ documentLoader: options.contextLoader },
|
|
17856
|
+
);
|
|
17857
|
+
}
|
|
17858
|
+
const docContext = options.context ??
|
|
17859
|
+
[\\"https://www.w3.org/ns/activitystreams\\",{\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}];
|
|
17860
|
+
const compacted = await jsonld.compact(
|
|
17861
|
+
values,
|
|
17862
|
+
docContext,
|
|
17863
|
+
{ documentLoader: options.contextLoader },
|
|
17864
|
+
);
|
|
17865
|
+
if (docContext != null) {
|
|
17866
|
+
// Embed context
|
|
17867
|
+
|
|
17868
|
+
}
|
|
17869
|
+
return compacted;
|
|
17870
|
+
}
|
|
17871
|
+
|
|
17872
|
+
protected isCompactable(): boolean {
|
|
17873
|
+
|
|
17874
|
+
return true;
|
|
17875
|
+
}
|
|
17876
|
+
|
|
17877
|
+
/**
|
|
17878
|
+
* Converts a JSON-LD structure to an object of this type.
|
|
17879
|
+
* @param json The JSON-LD structure to convert.
|
|
17880
|
+
* @param options The options to use.
|
|
17881
|
+
* - \`documentLoader\`: The loader for remote JSON-LD documents.
|
|
17882
|
+
* - \`contextLoader\`: The loader for remote JSON-LD contexts.
|
|
17883
|
+
* - \`tracerProvider\`: The OpenTelemetry tracer provider to use.
|
|
17884
|
+
* If omitted, the global tracer provider is used.
|
|
17885
|
+
* @returns The object of this type.
|
|
17886
|
+
* @throws {TypeError} If the given \`json\` is invalid.
|
|
17887
|
+
*/
|
|
17888
|
+
static async fromJsonLd(
|
|
17889
|
+
json: unknown,
|
|
17890
|
+
options: {
|
|
17891
|
+
documentLoader?: DocumentLoader,
|
|
17892
|
+
contextLoader?: DocumentLoader,
|
|
17893
|
+
tracerProvider?: TracerProvider,
|
|
17894
|
+
baseUrl?: URL,
|
|
17895
|
+
} = {},
|
|
17896
|
+
): Promise<Measure> {
|
|
17897
|
+
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
17898
|
+
const tracer = tracerProvider.getTracer(
|
|
17899
|
+
\\"@fedify/vocab-tools\\",
|
|
17900
|
+
\\"0.0.0\\",
|
|
17901
|
+
);
|
|
17902
|
+
return await tracer.startActiveSpan(
|
|
17903
|
+
\\"activitypub.parse_object\\",
|
|
17904
|
+
async (span) => {
|
|
17905
|
+
try {
|
|
17906
|
+
const object = await this.__fromJsonLd__Measure__(
|
|
17907
|
+
json, span, options);
|
|
17908
|
+
if (object.id != null) {
|
|
17909
|
+
span.setAttribute(\\"activitypub.object.id\\", object.id.href);
|
|
17910
|
+
}
|
|
17911
|
+
return object;
|
|
17912
|
+
} catch (error) {
|
|
17913
|
+
span.setStatus({
|
|
17914
|
+
code: SpanStatusCode.ERROR,
|
|
17915
|
+
message: String(error),
|
|
17916
|
+
});
|
|
17917
|
+
throw error;
|
|
17918
|
+
} finally {
|
|
17919
|
+
span.end();
|
|
17920
|
+
}
|
|
17921
|
+
},
|
|
17922
|
+
);
|
|
17923
|
+
}
|
|
17924
|
+
|
|
17925
|
+
protected static async __fromJsonLd__Measure__(
|
|
17926
|
+
json: unknown,
|
|
17927
|
+
span: Span,
|
|
17928
|
+
options: {
|
|
17929
|
+
documentLoader?: DocumentLoader,
|
|
17930
|
+
contextLoader?: DocumentLoader,
|
|
17931
|
+
tracerProvider?: TracerProvider,
|
|
17932
|
+
baseUrl?: URL,
|
|
17933
|
+
} = {},
|
|
17934
|
+
): Promise<Measure> {
|
|
17935
|
+
if (typeof json === \\"undefined\\") {
|
|
17936
|
+
throw new TypeError(\\"Invalid JSON-LD: undefined.\\");
|
|
17937
|
+
}
|
|
17938
|
+
else if (json === null) throw new TypeError(\\"Invalid JSON-LD: null.\\");
|
|
17939
|
+
options = {
|
|
17940
|
+
...options,
|
|
17941
|
+
documentLoader: options.documentLoader ?? getDocumentLoader(),
|
|
17942
|
+
contextLoader: options.contextLoader ?? getDocumentLoader(),
|
|
17943
|
+
tracerProvider: options.tracerProvider ?? trace.getTracerProvider(),
|
|
17944
|
+
};
|
|
17945
|
+
// deno-lint-ignore no-explicit-any
|
|
17946
|
+
let values: Record<string, any[]> & { \\"@id\\"?: string };
|
|
17947
|
+
if (globalThis.Object.keys(json).length == 0) {
|
|
17948
|
+
values = {};
|
|
17949
|
+
} else {
|
|
17950
|
+
const expanded = await jsonld.expand(json, {
|
|
17951
|
+
documentLoader: options.contextLoader,
|
|
17952
|
+
keepFreeFloatingNodes: true,
|
|
17953
|
+
});
|
|
17954
|
+
values =
|
|
17955
|
+
// deno-lint-ignore no-explicit-any
|
|
17956
|
+
(expanded[0] ?? {}) as (Record<string, any[]> & { \\"@id\\"?: string });
|
|
17957
|
+
}
|
|
17958
|
+
if (options.baseUrl == null && values[\\"@id\\"] != null) {
|
|
17959
|
+
options = { ...options, baseUrl: new URL(values[\\"@id\\"]) };
|
|
17960
|
+
}
|
|
17961
|
+
|
|
17962
|
+
if (\\"@type\\" in values) {
|
|
17963
|
+
span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]);
|
|
17964
|
+
}
|
|
17965
|
+
if (\\"@type\\" in values &&
|
|
17966
|
+
!values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) {
|
|
17967
|
+
|
|
17968
|
+
if (!values[\\"@type\\"].includes(\\"http://www.ontology-of-units-of-measure.org/resource/om-2/Measure\\")) {
|
|
17969
|
+
throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]);
|
|
17970
|
+
}
|
|
17971
|
+
}
|
|
17972
|
+
|
|
17973
|
+
const instance = new this(
|
|
17974
|
+
{ id: \\"@id\\" in values ? new URL(values[\\"@id\\"] as string) : undefined },
|
|
17975
|
+
options,
|
|
17976
|
+
);
|
|
17977
|
+
const _27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = [];
|
|
17978
|
+
|
|
17979
|
+
let _27fgyFbosTtMAhuepJH8K3ZGURT6__array = values[\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasUnit\\"];
|
|
17980
|
+
|
|
17981
|
+
for (
|
|
17982
|
+
const v of _27fgyFbosTtMAhuepJH8K3ZGURT6__array == null
|
|
17983
|
+
? []
|
|
17984
|
+
: _27fgyFbosTtMAhuepJH8K3ZGURT6__array.length === 1 && \\"@list\\" in _27fgyFbosTtMAhuepJH8K3ZGURT6__array[0]
|
|
17985
|
+
? _27fgyFbosTtMAhuepJH8K3ZGURT6__array[0][\\"@list\\"]
|
|
17986
|
+
: _27fgyFbosTtMAhuepJH8K3ZGURT6__array
|
|
17987
|
+
) {
|
|
17988
|
+
if (v == null) continue;
|
|
17989
|
+
_27fgyFbosTtMAhuepJH8K3ZGURT6.push(v[\\"@value\\"])
|
|
17990
|
+
}
|
|
17991
|
+
instance.#_27fgyFbosTtMAhuepJH8K3ZGURT6 = _27fgyFbosTtMAhuepJH8K3ZGURT6;
|
|
17992
|
+
const _1GQx8o2RgxRs4x9G5uT39XYBv7D: (Decimal)[] = [];
|
|
17993
|
+
|
|
17994
|
+
let _1GQx8o2RgxRs4x9G5uT39XYBv7D__array = values[\\"http://www.ontology-of-units-of-measure.org/resource/om-2/hasNumericalValue\\"];
|
|
17995
|
+
|
|
17996
|
+
for (
|
|
17997
|
+
const v of _1GQx8o2RgxRs4x9G5uT39XYBv7D__array == null
|
|
17998
|
+
? []
|
|
17999
|
+
: _1GQx8o2RgxRs4x9G5uT39XYBv7D__array.length === 1 && \\"@list\\" in _1GQx8o2RgxRs4x9G5uT39XYBv7D__array[0]
|
|
18000
|
+
? _1GQx8o2RgxRs4x9G5uT39XYBv7D__array[0][\\"@list\\"]
|
|
18001
|
+
: _1GQx8o2RgxRs4x9G5uT39XYBv7D__array
|
|
18002
|
+
) {
|
|
18003
|
+
if (v == null) continue;
|
|
18004
|
+
_1GQx8o2RgxRs4x9G5uT39XYBv7D.push(parseDecimal(v[\\"@value\\"]))
|
|
18005
|
+
}
|
|
18006
|
+
instance.#_1GQx8o2RgxRs4x9G5uT39XYBv7D = _1GQx8o2RgxRs4x9G5uT39XYBv7D;
|
|
18007
|
+
|
|
18008
|
+
if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) {
|
|
18009
|
+
try {
|
|
18010
|
+
instance._cachedJsonLd = structuredClone(json);
|
|
18011
|
+
} catch {
|
|
18012
|
+
getLogger([\\"fedify\\", \\"vocab\\"]).warn(
|
|
18013
|
+
\\"Failed to cache JSON-LD: {json}\\",
|
|
18014
|
+
{ json },
|
|
18015
|
+
);
|
|
18016
|
+
}
|
|
18017
|
+
}
|
|
18018
|
+
return instance;
|
|
18019
|
+
}
|
|
18020
|
+
|
|
18021
|
+
protected _getCustomInspectProxy(): Record<string, unknown> {
|
|
18022
|
+
|
|
18023
|
+
const proxy: Record<string, unknown> = {};
|
|
18024
|
+
if (this.id != null) {
|
|
18025
|
+
proxy.id = {
|
|
18026
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
18027
|
+
inspect: typeof Deno.inspect,
|
|
18028
|
+
options: Deno.InspectOptions,
|
|
18029
|
+
): string => \\"URL \\" + inspect(this.id!.href, options),
|
|
18030
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
18031
|
+
_depth: number,
|
|
18032
|
+
options: unknown,
|
|
18033
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
18034
|
+
): string => \\"URL \\" + inspect(this.id!.href, options),
|
|
18035
|
+
};
|
|
18036
|
+
}
|
|
18037
|
+
|
|
18038
|
+
const _27fgyFbosTtMAhuepJH8K3ZGURT6 = this.#_27fgyFbosTtMAhuepJH8K3ZGURT6
|
|
18039
|
+
// deno-lint-ignore no-explicit-any
|
|
18040
|
+
.map((v: any) => v instanceof URL
|
|
18041
|
+
? {
|
|
18042
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
18043
|
+
inspect: typeof Deno.inspect,
|
|
18044
|
+
options: Deno.InspectOptions,
|
|
18045
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
18046
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
18047
|
+
_depth: number,
|
|
18048
|
+
options: unknown,
|
|
18049
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
18050
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
18051
|
+
}
|
|
18052
|
+
: v);
|
|
18053
|
+
|
|
18054
|
+
if (_27fgyFbosTtMAhuepJH8K3ZGURT6.length == 1) {
|
|
18055
|
+
proxy.unit = _27fgyFbosTtMAhuepJH8K3ZGURT6[0];
|
|
18056
|
+
}
|
|
18057
|
+
|
|
18058
|
+
const _1GQx8o2RgxRs4x9G5uT39XYBv7D = this.#_1GQx8o2RgxRs4x9G5uT39XYBv7D
|
|
18059
|
+
// deno-lint-ignore no-explicit-any
|
|
18060
|
+
.map((v: any) => v instanceof URL
|
|
18061
|
+
? {
|
|
18062
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
18063
|
+
inspect: typeof Deno.inspect,
|
|
18064
|
+
options: Deno.InspectOptions,
|
|
18065
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
18066
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
18067
|
+
_depth: number,
|
|
18068
|
+
options: unknown,
|
|
18069
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
18070
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
18071
|
+
}
|
|
18072
|
+
: v);
|
|
18073
|
+
|
|
18074
|
+
if (_1GQx8o2RgxRs4x9G5uT39XYBv7D.length == 1) {
|
|
18075
|
+
proxy.numericalValue = _1GQx8o2RgxRs4x9G5uT39XYBv7D[0];
|
|
18076
|
+
}
|
|
18077
|
+
|
|
18078
|
+
return proxy;
|
|
18079
|
+
}
|
|
18080
|
+
}
|
|
18081
|
+
|
|
18082
|
+
|
|
18083
|
+
// deno-lint-ignore no-explicit-any
|
|
18084
|
+
(Measure.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] =
|
|
18085
|
+
function (
|
|
18086
|
+
this: Measure,
|
|
18087
|
+
inspect: typeof Deno.inspect,
|
|
18088
|
+
options: Deno.InspectOptions,
|
|
18089
|
+
): string {
|
|
18090
|
+
const proxy = this._getCustomInspectProxy();
|
|
18091
|
+
return \\"Measure \\" + inspect(proxy, options);
|
|
18092
|
+
};
|
|
18093
|
+
|
|
18094
|
+
// deno-lint-ignore no-explicit-any
|
|
18095
|
+
(Measure.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] =
|
|
18096
|
+
function (
|
|
18097
|
+
this: Measure,
|
|
18098
|
+
_depth: number,
|
|
18099
|
+
options: unknown,
|
|
18100
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
18101
|
+
): string {
|
|
18102
|
+
const proxy = this._getCustomInspectProxy();
|
|
18103
|
+
return \\"Measure \\" + inspect(proxy, options);
|
|
18104
|
+
};
|
|
17533
18105
|
/** Proves that an {@link Announce} interaction has been approved by
|
|
17534
18106
|
* the post author.
|
|
17535
18107
|
*
|
|
@@ -26472,6 +27044,1723 @@ controller?: Application | Group | Organization | Person | Service | URL | null;
|
|
|
26472
27044
|
const proxy = this._getCustomInspectProxy();
|
|
26473
27045
|
return \\"Multikey \\" + inspect(proxy, options);
|
|
26474
27046
|
};
|
|
27047
|
+
/** A proposed economic transaction describing what is being offered or requested
|
|
27048
|
+
* in a {@link Proposal}.
|
|
27049
|
+
*
|
|
27050
|
+
*/
|
|
27051
|
+
export class Intent {
|
|
27052
|
+
|
|
27053
|
+
readonly #documentLoader?: DocumentLoader;
|
|
27054
|
+
readonly #contextLoader?: DocumentLoader;
|
|
27055
|
+
readonly #tracerProvider?: TracerProvider;
|
|
27056
|
+
readonly #warning?: {
|
|
27057
|
+
category: string[];
|
|
27058
|
+
message: string;
|
|
27059
|
+
values?: Record<string, unknown>;
|
|
27060
|
+
};
|
|
27061
|
+
#cachedJsonLd?: unknown;
|
|
27062
|
+
readonly id: URL | null;
|
|
27063
|
+
|
|
27064
|
+
protected get _documentLoader(): DocumentLoader | undefined {
|
|
27065
|
+
return this.#documentLoader;
|
|
27066
|
+
}
|
|
27067
|
+
|
|
27068
|
+
protected get _contextLoader(): DocumentLoader | undefined {
|
|
27069
|
+
return this.#contextLoader;
|
|
27070
|
+
}
|
|
27071
|
+
|
|
27072
|
+
protected get _tracerProvider(): TracerProvider | undefined {
|
|
27073
|
+
return this.#tracerProvider;
|
|
27074
|
+
}
|
|
27075
|
+
|
|
27076
|
+
protected get _warning(): {
|
|
27077
|
+
category: string[];
|
|
27078
|
+
message: string;
|
|
27079
|
+
values?: Record<string, unknown>;
|
|
27080
|
+
} | undefined {
|
|
27081
|
+
return this.#warning;
|
|
27082
|
+
}
|
|
27083
|
+
|
|
27084
|
+
protected get _cachedJsonLd(): unknown | undefined {
|
|
27085
|
+
return this.#cachedJsonLd;
|
|
27086
|
+
}
|
|
27087
|
+
|
|
27088
|
+
protected set _cachedJsonLd(value: unknown | undefined) {
|
|
27089
|
+
this.#cachedJsonLd = value;
|
|
27090
|
+
}
|
|
27091
|
+
|
|
27092
|
+
/**
|
|
27093
|
+
* The type URI of {@link Intent}: \`https://w3id.org/valueflows/ont/vf#Intent\`.
|
|
27094
|
+
*/
|
|
27095
|
+
static get typeId(): URL {
|
|
27096
|
+
return new URL(\\"https://w3id.org/valueflows/ont/vf#Intent\\");
|
|
27097
|
+
}
|
|
27098
|
+
#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = [];
|
|
27099
|
+
#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo: (URL)[] = [];
|
|
27100
|
+
#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity: (Measure)[] = [];
|
|
27101
|
+
#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity: (Measure)[] = [];
|
|
27102
|
+
#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity: (Measure)[] = [];
|
|
27103
|
+
|
|
27104
|
+
/**
|
|
27105
|
+
* Constructs a new instance of Intent with the given values.
|
|
27106
|
+
* @param values The values to initialize the instance with.
|
|
27107
|
+
* @param options The options to use for initialization.
|
|
27108
|
+
*/
|
|
27109
|
+
constructor(
|
|
27110
|
+
values:
|
|
27111
|
+
{
|
|
27112
|
+
id?: URL | null;
|
|
27113
|
+
action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measure | null;availableQuantity?: Measure | null;minimumQuantity?: Measure | null;}
|
|
27114
|
+
,
|
|
27115
|
+
options: {
|
|
27116
|
+
documentLoader?: DocumentLoader,
|
|
27117
|
+
contextLoader?: DocumentLoader,
|
|
27118
|
+
tracerProvider?: TracerProvider,
|
|
27119
|
+
} = {},
|
|
27120
|
+
) {
|
|
27121
|
+
|
|
27122
|
+
this.#documentLoader = options.documentLoader;
|
|
27123
|
+
this.#contextLoader = options.contextLoader;
|
|
27124
|
+
this.#tracerProvider = options.tracerProvider;
|
|
27125
|
+
if (\\"\$warning\\" in options) {
|
|
27126
|
+
this.#warning = options.\$warning as unknown as {
|
|
27127
|
+
category: string[];
|
|
27128
|
+
message: string;
|
|
27129
|
+
values?: Record<string, unknown>;
|
|
27130
|
+
};
|
|
27131
|
+
}
|
|
27132
|
+
if (values.id == null || values.id instanceof URL) {
|
|
27133
|
+
this.id = values.id ?? null;
|
|
27134
|
+
} else {
|
|
27135
|
+
throw new TypeError(\\"The id must be a URL.\\");
|
|
27136
|
+
}
|
|
27137
|
+
|
|
27138
|
+
if (\\"action\\" in values && values.action != null) {
|
|
27139
|
+
if (typeof values.action === \\"string\\") {
|
|
27140
|
+
// @ts-ignore: type is checked above.
|
|
27141
|
+
this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = [values.action];
|
|
27142
|
+
|
|
27143
|
+
} else {
|
|
27144
|
+
throw new TypeError(
|
|
27145
|
+
\\"The action must be of type \\" +
|
|
27146
|
+
\\"string\\" + \\".\\",
|
|
27147
|
+
);
|
|
27148
|
+
}
|
|
27149
|
+
}
|
|
27150
|
+
|
|
27151
|
+
if (\\"resourceConformsTo\\" in values && values.resourceConformsTo != null) {
|
|
27152
|
+
if (values.resourceConformsTo instanceof URL) {
|
|
27153
|
+
// @ts-ignore: type is checked above.
|
|
27154
|
+
this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = [values.resourceConformsTo];
|
|
27155
|
+
|
|
27156
|
+
} else {
|
|
27157
|
+
throw new TypeError(
|
|
27158
|
+
\\"The resourceConformsTo must be of type \\" +
|
|
27159
|
+
\\"URL\\" + \\".\\",
|
|
27160
|
+
);
|
|
27161
|
+
}
|
|
27162
|
+
}
|
|
27163
|
+
|
|
27164
|
+
if (\\"resourceQuantity\\" in values && values.resourceQuantity != null) {
|
|
27165
|
+
if (values.resourceQuantity instanceof Measure) {
|
|
27166
|
+
// @ts-ignore: type is checked above.
|
|
27167
|
+
this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = [values.resourceQuantity];
|
|
27168
|
+
|
|
27169
|
+
} else {
|
|
27170
|
+
throw new TypeError(
|
|
27171
|
+
\\"The resourceQuantity must be of type \\" +
|
|
27172
|
+
\\"Measure\\" + \\".\\",
|
|
27173
|
+
);
|
|
27174
|
+
}
|
|
27175
|
+
}
|
|
27176
|
+
|
|
27177
|
+
if (\\"availableQuantity\\" in values && values.availableQuantity != null) {
|
|
27178
|
+
if (values.availableQuantity instanceof Measure) {
|
|
27179
|
+
// @ts-ignore: type is checked above.
|
|
27180
|
+
this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = [values.availableQuantity];
|
|
27181
|
+
|
|
27182
|
+
} else {
|
|
27183
|
+
throw new TypeError(
|
|
27184
|
+
\\"The availableQuantity must be of type \\" +
|
|
27185
|
+
\\"Measure\\" + \\".\\",
|
|
27186
|
+
);
|
|
27187
|
+
}
|
|
27188
|
+
}
|
|
27189
|
+
|
|
27190
|
+
if (\\"minimumQuantity\\" in values && values.minimumQuantity != null) {
|
|
27191
|
+
if (values.minimumQuantity instanceof Measure) {
|
|
27192
|
+
// @ts-ignore: type is checked above.
|
|
27193
|
+
this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = [values.minimumQuantity];
|
|
27194
|
+
|
|
27195
|
+
} else {
|
|
27196
|
+
throw new TypeError(
|
|
27197
|
+
\\"The minimumQuantity must be of type \\" +
|
|
27198
|
+
\\"Measure\\" + \\".\\",
|
|
27199
|
+
);
|
|
27200
|
+
}
|
|
27201
|
+
}
|
|
27202
|
+
}
|
|
27203
|
+
|
|
27204
|
+
/**
|
|
27205
|
+
* Clones this instance, optionally updating it with the given values.
|
|
27206
|
+
* @param values The values to update the clone with.
|
|
27207
|
+
* @param options The options to use for cloning.
|
|
27208
|
+
* @returns The cloned instance.
|
|
27209
|
+
*/
|
|
27210
|
+
clone(
|
|
27211
|
+
values:
|
|
27212
|
+
{
|
|
27213
|
+
id?: URL | null;
|
|
27214
|
+
action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measure | null;availableQuantity?: Measure | null;minimumQuantity?: Measure | null;}
|
|
27215
|
+
|
|
27216
|
+
= {},
|
|
27217
|
+
options: {
|
|
27218
|
+
documentLoader?: DocumentLoader,
|
|
27219
|
+
contextLoader?: DocumentLoader,
|
|
27220
|
+
} = {}
|
|
27221
|
+
): Intent {
|
|
27222
|
+
if (this._warning != null) {
|
|
27223
|
+
getLogger(this._warning.category).warn(
|
|
27224
|
+
this._warning.message,
|
|
27225
|
+
this._warning.values
|
|
27226
|
+
);
|
|
27227
|
+
// @ts-ignore: \$warning is not recognized as a property, but it is.
|
|
27228
|
+
options = { ...options, \$warning: this._warning };
|
|
27229
|
+
}
|
|
27230
|
+
|
|
27231
|
+
// @ts-ignore: this.constructor is not recognized as a constructor, but it is.
|
|
27232
|
+
const clone: Intent = new this.constructor(
|
|
27233
|
+
{ id: values.id ?? this.id },
|
|
27234
|
+
options
|
|
27235
|
+
);
|
|
27236
|
+
clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action;
|
|
27237
|
+
if (\\"action\\" in values && values.action != null) {
|
|
27238
|
+
if (typeof values.action === \\"string\\") {
|
|
27239
|
+
// @ts-ignore: type is checked above.
|
|
27240
|
+
clone.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = [values.action];
|
|
27241
|
+
|
|
27242
|
+
} else {
|
|
27243
|
+
throw new TypeError(
|
|
27244
|
+
\\"The action must be of type \\" +
|
|
27245
|
+
\\"string\\" + \\".\\",
|
|
27246
|
+
);
|
|
27247
|
+
}
|
|
27248
|
+
}
|
|
27249
|
+
clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo;
|
|
27250
|
+
if (\\"resourceConformsTo\\" in values && values.resourceConformsTo != null) {
|
|
27251
|
+
if (values.resourceConformsTo instanceof URL) {
|
|
27252
|
+
// @ts-ignore: type is checked above.
|
|
27253
|
+
clone.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = [values.resourceConformsTo];
|
|
27254
|
+
|
|
27255
|
+
} else {
|
|
27256
|
+
throw new TypeError(
|
|
27257
|
+
\\"The resourceConformsTo must be of type \\" +
|
|
27258
|
+
\\"URL\\" + \\".\\",
|
|
27259
|
+
);
|
|
27260
|
+
}
|
|
27261
|
+
}
|
|
27262
|
+
clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity;
|
|
27263
|
+
if (\\"resourceQuantity\\" in values && values.resourceQuantity != null) {
|
|
27264
|
+
if (values.resourceQuantity instanceof Measure) {
|
|
27265
|
+
// @ts-ignore: type is checked above.
|
|
27266
|
+
clone.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = [values.resourceQuantity];
|
|
27267
|
+
|
|
27268
|
+
} else {
|
|
27269
|
+
throw new TypeError(
|
|
27270
|
+
\\"The resourceQuantity must be of type \\" +
|
|
27271
|
+
\\"Measure\\" + \\".\\",
|
|
27272
|
+
);
|
|
27273
|
+
}
|
|
27274
|
+
}
|
|
27275
|
+
clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity;
|
|
27276
|
+
if (\\"availableQuantity\\" in values && values.availableQuantity != null) {
|
|
27277
|
+
if (values.availableQuantity instanceof Measure) {
|
|
27278
|
+
// @ts-ignore: type is checked above.
|
|
27279
|
+
clone.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = [values.availableQuantity];
|
|
27280
|
+
|
|
27281
|
+
} else {
|
|
27282
|
+
throw new TypeError(
|
|
27283
|
+
\\"The availableQuantity must be of type \\" +
|
|
27284
|
+
\\"Measure\\" + \\".\\",
|
|
27285
|
+
);
|
|
27286
|
+
}
|
|
27287
|
+
}
|
|
27288
|
+
clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity;
|
|
27289
|
+
if (\\"minimumQuantity\\" in values && values.minimumQuantity != null) {
|
|
27290
|
+
if (values.minimumQuantity instanceof Measure) {
|
|
27291
|
+
// @ts-ignore: type is checked above.
|
|
27292
|
+
clone.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = [values.minimumQuantity];
|
|
27293
|
+
|
|
27294
|
+
} else {
|
|
27295
|
+
throw new TypeError(
|
|
27296
|
+
\\"The minimumQuantity must be of type \\" +
|
|
27297
|
+
\\"Measure\\" + \\".\\",
|
|
27298
|
+
);
|
|
27299
|
+
}
|
|
27300
|
+
}
|
|
27301
|
+
|
|
27302
|
+
return clone;
|
|
27303
|
+
}
|
|
27304
|
+
|
|
27305
|
+
/** The type of economic transaction. The value of this property should be
|
|
27306
|
+
* either \`\\"deliverService\\"\` or \`\\"transfer\\"\`.
|
|
27307
|
+
*
|
|
27308
|
+
*/
|
|
27309
|
+
get action(): (string | null) {
|
|
27310
|
+
if (this._warning != null) {
|
|
27311
|
+
getLogger(this._warning.category).warn(
|
|
27312
|
+
this._warning.message,
|
|
27313
|
+
this._warning.values
|
|
27314
|
+
);
|
|
27315
|
+
}
|
|
27316
|
+
if (this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length < 1) return null;
|
|
27317
|
+
return this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action[0];
|
|
27318
|
+
}
|
|
27319
|
+
|
|
27320
|
+
/** The type of an economic resource. Could be any URI.
|
|
27321
|
+
*
|
|
27322
|
+
*/
|
|
27323
|
+
get resourceConformsTo(): (URL | null) {
|
|
27324
|
+
if (this._warning != null) {
|
|
27325
|
+
getLogger(this._warning.category).warn(
|
|
27326
|
+
this._warning.message,
|
|
27327
|
+
this._warning.values
|
|
27328
|
+
);
|
|
27329
|
+
}
|
|
27330
|
+
if (this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length < 1) return null;
|
|
27331
|
+
return this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[0];
|
|
27332
|
+
}
|
|
27333
|
+
|
|
27334
|
+
/** The amount and unit of the economic resource.
|
|
27335
|
+
*
|
|
27336
|
+
*/
|
|
27337
|
+
get resourceQuantity(): (Measure | null) {
|
|
27338
|
+
if (this._warning != null) {
|
|
27339
|
+
getLogger(this._warning.category).warn(
|
|
27340
|
+
this._warning.message,
|
|
27341
|
+
this._warning.values
|
|
27342
|
+
);
|
|
27343
|
+
}
|
|
27344
|
+
if (this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length < 1) return null;
|
|
27345
|
+
return this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[0];
|
|
27346
|
+
}
|
|
27347
|
+
|
|
27348
|
+
/** The quantity of the offered resource currently available.
|
|
27349
|
+
*
|
|
27350
|
+
*/
|
|
27351
|
+
get availableQuantity(): (Measure | null) {
|
|
27352
|
+
if (this._warning != null) {
|
|
27353
|
+
getLogger(this._warning.category).warn(
|
|
27354
|
+
this._warning.message,
|
|
27355
|
+
this._warning.values
|
|
27356
|
+
);
|
|
27357
|
+
}
|
|
27358
|
+
if (this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length < 1) return null;
|
|
27359
|
+
return this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[0];
|
|
27360
|
+
}
|
|
27361
|
+
|
|
27362
|
+
/** The minimum possible quantity of the resource.
|
|
27363
|
+
*
|
|
27364
|
+
*/
|
|
27365
|
+
get minimumQuantity(): (Measure | null) {
|
|
27366
|
+
if (this._warning != null) {
|
|
27367
|
+
getLogger(this._warning.category).warn(
|
|
27368
|
+
this._warning.message,
|
|
27369
|
+
this._warning.values
|
|
27370
|
+
);
|
|
27371
|
+
}
|
|
27372
|
+
if (this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length < 1) return null;
|
|
27373
|
+
return this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[0];
|
|
27374
|
+
}
|
|
27375
|
+
|
|
27376
|
+
/**
|
|
27377
|
+
* Converts this object to a JSON-LD structure.
|
|
27378
|
+
* @param options The options to use.
|
|
27379
|
+
* - \`format\`: The format of the output: \`compact\` or
|
|
27380
|
+
\`expand\`.
|
|
27381
|
+
* - \`contextLoader\`: The loader for remote JSON-LD contexts.
|
|
27382
|
+
* - \`context\`: The JSON-LD context to use. Not applicable
|
|
27383
|
+
when \`format\` is set to \`'expand'\`.
|
|
27384
|
+
* @returns The JSON-LD representation of this object.
|
|
27385
|
+
*/
|
|
27386
|
+
async toJsonLd(options: {
|
|
27387
|
+
format?: \\"compact\\" | \\"expand\\",
|
|
27388
|
+
contextLoader?: DocumentLoader,
|
|
27389
|
+
context?: string | Record<string, string> | (string | Record<string, string>)[],
|
|
27390
|
+
} = {}): Promise<unknown> {
|
|
27391
|
+
if (options.format == null && this._cachedJsonLd != null) {
|
|
27392
|
+
return this._cachedJsonLd;
|
|
27393
|
+
}
|
|
27394
|
+
if (options.format !== \\"compact\\" && options.context != null) {
|
|
27395
|
+
throw new TypeError(
|
|
27396
|
+
\\"The context option can only be used when the format option is set \\" +
|
|
27397
|
+
\\"to 'compact'.\\"
|
|
27398
|
+
);
|
|
27399
|
+
}
|
|
27400
|
+
options = {
|
|
27401
|
+
...options,
|
|
27402
|
+
contextLoader: options.contextLoader ?? getDocumentLoader(),
|
|
27403
|
+
};
|
|
27404
|
+
|
|
27405
|
+
if (options.format == null && this.isCompactable()) {
|
|
27406
|
+
const result: Record<string, unknown> = {};
|
|
27407
|
+
// deno-lint-ignore no-unused-vars
|
|
27408
|
+
let compactItems: unknown[];
|
|
27409
|
+
|
|
27410
|
+
compactItems = [];
|
|
27411
|
+
for (const v of this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) {
|
|
27412
|
+
const item = (
|
|
27413
|
+
v
|
|
27414
|
+
);
|
|
27415
|
+
compactItems.push(item);
|
|
27416
|
+
}
|
|
27417
|
+
if (compactItems.length > 0) {
|
|
27418
|
+
|
|
27419
|
+
result[\\"action\\"]
|
|
27420
|
+
= compactItems.length > 1
|
|
27421
|
+
? compactItems
|
|
27422
|
+
: compactItems[0];
|
|
27423
|
+
|
|
27424
|
+
}
|
|
27425
|
+
|
|
27426
|
+
compactItems = [];
|
|
27427
|
+
for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) {
|
|
27428
|
+
const item = (
|
|
27429
|
+
v.href
|
|
27430
|
+
);
|
|
27431
|
+
compactItems.push(item);
|
|
27432
|
+
}
|
|
27433
|
+
if (compactItems.length > 0) {
|
|
27434
|
+
|
|
27435
|
+
result[\\"resourceConformsTo\\"]
|
|
27436
|
+
= compactItems.length > 1
|
|
27437
|
+
? compactItems
|
|
27438
|
+
: compactItems[0];
|
|
27439
|
+
|
|
27440
|
+
}
|
|
27441
|
+
|
|
27442
|
+
compactItems = [];
|
|
27443
|
+
for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) {
|
|
27444
|
+
const item = (
|
|
27445
|
+
await v.toJsonLd({
|
|
27446
|
+
...(options),
|
|
27447
|
+
format: undefined,
|
|
27448
|
+
context: undefined,
|
|
27449
|
+
})
|
|
27450
|
+
);
|
|
27451
|
+
compactItems.push(item);
|
|
27452
|
+
}
|
|
27453
|
+
if (compactItems.length > 0) {
|
|
27454
|
+
|
|
27455
|
+
result[\\"resourceQuantity\\"]
|
|
27456
|
+
= compactItems.length > 1
|
|
27457
|
+
? compactItems
|
|
27458
|
+
: compactItems[0];
|
|
27459
|
+
|
|
27460
|
+
}
|
|
27461
|
+
|
|
27462
|
+
compactItems = [];
|
|
27463
|
+
for (const v of this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) {
|
|
27464
|
+
const item = (
|
|
27465
|
+
await v.toJsonLd({
|
|
27466
|
+
...(options),
|
|
27467
|
+
format: undefined,
|
|
27468
|
+
context: undefined,
|
|
27469
|
+
})
|
|
27470
|
+
);
|
|
27471
|
+
compactItems.push(item);
|
|
27472
|
+
}
|
|
27473
|
+
if (compactItems.length > 0) {
|
|
27474
|
+
|
|
27475
|
+
result[\\"availableQuantity\\"]
|
|
27476
|
+
= compactItems.length > 1
|
|
27477
|
+
? compactItems
|
|
27478
|
+
: compactItems[0];
|
|
27479
|
+
|
|
27480
|
+
}
|
|
27481
|
+
|
|
27482
|
+
compactItems = [];
|
|
27483
|
+
for (const v of this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) {
|
|
27484
|
+
const item = (
|
|
27485
|
+
await v.toJsonLd({
|
|
27486
|
+
...(options),
|
|
27487
|
+
format: undefined,
|
|
27488
|
+
context: undefined,
|
|
27489
|
+
})
|
|
27490
|
+
);
|
|
27491
|
+
compactItems.push(item);
|
|
27492
|
+
}
|
|
27493
|
+
if (compactItems.length > 0) {
|
|
27494
|
+
|
|
27495
|
+
result[\\"minimumQuantity\\"]
|
|
27496
|
+
= compactItems.length > 1
|
|
27497
|
+
? compactItems
|
|
27498
|
+
: compactItems[0];
|
|
27499
|
+
|
|
27500
|
+
}
|
|
27501
|
+
|
|
27502
|
+
result[\\"type\\"] = \\"Intent\\";
|
|
27503
|
+
if (this.id != null) result[\\"id\\"] = this.id.href;
|
|
27504
|
+
result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"Intent\\":\\"vf:Intent\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}];
|
|
27505
|
+
return result;
|
|
27506
|
+
}
|
|
27507
|
+
|
|
27508
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
|
27509
|
+
let array: unknown[];
|
|
27510
|
+
const values: Record<string, unknown[] | string> = {};
|
|
27511
|
+
array = [];
|
|
27512
|
+
for (const v of this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action) {
|
|
27513
|
+
const element = (
|
|
27514
|
+
{ \\"@value\\": v }
|
|
27515
|
+
);
|
|
27516
|
+
array.push(element);;
|
|
27517
|
+
}
|
|
27518
|
+
if (array.length > 0) {
|
|
27519
|
+
const propValue = (
|
|
27520
|
+
array
|
|
27521
|
+
);
|
|
27522
|
+
values[\\"https://w3id.org/valueflows/ont/vf#action\\"] = propValue;
|
|
27523
|
+
|
|
27524
|
+
}
|
|
27525
|
+
|
|
27526
|
+
array = [];
|
|
27527
|
+
for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) {
|
|
27528
|
+
const element = (
|
|
27529
|
+
{ \\"@id\\": v.href }
|
|
27530
|
+
);
|
|
27531
|
+
array.push(element);;
|
|
27532
|
+
}
|
|
27533
|
+
if (array.length > 0) {
|
|
27534
|
+
const propValue = (
|
|
27535
|
+
array
|
|
27536
|
+
);
|
|
27537
|
+
values[\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\"] = propValue;
|
|
27538
|
+
|
|
27539
|
+
}
|
|
27540
|
+
|
|
27541
|
+
array = [];
|
|
27542
|
+
for (const v of this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity) {
|
|
27543
|
+
const element = (
|
|
27544
|
+
await v.toJsonLd(options)
|
|
27545
|
+
);
|
|
27546
|
+
array.push(element);;
|
|
27547
|
+
}
|
|
27548
|
+
if (array.length > 0) {
|
|
27549
|
+
const propValue = (
|
|
27550
|
+
array
|
|
27551
|
+
);
|
|
27552
|
+
values[\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\"] = propValue;
|
|
27553
|
+
|
|
27554
|
+
}
|
|
27555
|
+
|
|
27556
|
+
array = [];
|
|
27557
|
+
for (const v of this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity) {
|
|
27558
|
+
const element = (
|
|
27559
|
+
await v.toJsonLd(options)
|
|
27560
|
+
);
|
|
27561
|
+
array.push(element);;
|
|
27562
|
+
}
|
|
27563
|
+
if (array.length > 0) {
|
|
27564
|
+
const propValue = (
|
|
27565
|
+
array
|
|
27566
|
+
);
|
|
27567
|
+
values[\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\"] = propValue;
|
|
27568
|
+
|
|
27569
|
+
}
|
|
27570
|
+
|
|
27571
|
+
array = [];
|
|
27572
|
+
for (const v of this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity) {
|
|
27573
|
+
const element = (
|
|
27574
|
+
await v.toJsonLd(options)
|
|
27575
|
+
);
|
|
27576
|
+
array.push(element);;
|
|
27577
|
+
}
|
|
27578
|
+
if (array.length > 0) {
|
|
27579
|
+
const propValue = (
|
|
27580
|
+
array
|
|
27581
|
+
);
|
|
27582
|
+
values[\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\"] = propValue;
|
|
27583
|
+
|
|
27584
|
+
}
|
|
27585
|
+
|
|
27586
|
+
values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Intent\\"];
|
|
27587
|
+
if (this.id != null) values[\\"@id\\"] = this.id.href;
|
|
27588
|
+
if (options.format === \\"expand\\") {
|
|
27589
|
+
return await jsonld.expand(
|
|
27590
|
+
values,
|
|
27591
|
+
{ documentLoader: options.contextLoader },
|
|
27592
|
+
);
|
|
27593
|
+
}
|
|
27594
|
+
const docContext = options.context ??
|
|
27595
|
+
[\\"https://www.w3.org/ns/activitystreams\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"Intent\\":\\"vf:Intent\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}];
|
|
27596
|
+
const compacted = await jsonld.compact(
|
|
27597
|
+
values,
|
|
27598
|
+
docContext,
|
|
27599
|
+
{ documentLoader: options.contextLoader },
|
|
27600
|
+
);
|
|
27601
|
+
if (docContext != null) {
|
|
27602
|
+
// Embed context
|
|
27603
|
+
|
|
27604
|
+
}
|
|
27605
|
+
return compacted;
|
|
27606
|
+
}
|
|
27607
|
+
|
|
27608
|
+
protected isCompactable(): boolean {
|
|
27609
|
+
|
|
27610
|
+
return true;
|
|
27611
|
+
}
|
|
27612
|
+
|
|
27613
|
+
/**
|
|
27614
|
+
* Converts a JSON-LD structure to an object of this type.
|
|
27615
|
+
* @param json The JSON-LD structure to convert.
|
|
27616
|
+
* @param options The options to use.
|
|
27617
|
+
* - \`documentLoader\`: The loader for remote JSON-LD documents.
|
|
27618
|
+
* - \`contextLoader\`: The loader for remote JSON-LD contexts.
|
|
27619
|
+
* - \`tracerProvider\`: The OpenTelemetry tracer provider to use.
|
|
27620
|
+
* If omitted, the global tracer provider is used.
|
|
27621
|
+
* @returns The object of this type.
|
|
27622
|
+
* @throws {TypeError} If the given \`json\` is invalid.
|
|
27623
|
+
*/
|
|
27624
|
+
static async fromJsonLd(
|
|
27625
|
+
json: unknown,
|
|
27626
|
+
options: {
|
|
27627
|
+
documentLoader?: DocumentLoader,
|
|
27628
|
+
contextLoader?: DocumentLoader,
|
|
27629
|
+
tracerProvider?: TracerProvider,
|
|
27630
|
+
baseUrl?: URL,
|
|
27631
|
+
} = {},
|
|
27632
|
+
): Promise<Intent> {
|
|
27633
|
+
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
27634
|
+
const tracer = tracerProvider.getTracer(
|
|
27635
|
+
\\"@fedify/vocab-tools\\",
|
|
27636
|
+
\\"0.0.0\\",
|
|
27637
|
+
);
|
|
27638
|
+
return await tracer.startActiveSpan(
|
|
27639
|
+
\\"activitypub.parse_object\\",
|
|
27640
|
+
async (span) => {
|
|
27641
|
+
try {
|
|
27642
|
+
const object = await this.__fromJsonLd__Intent__(
|
|
27643
|
+
json, span, options);
|
|
27644
|
+
if (object.id != null) {
|
|
27645
|
+
span.setAttribute(\\"activitypub.object.id\\", object.id.href);
|
|
27646
|
+
}
|
|
27647
|
+
return object;
|
|
27648
|
+
} catch (error) {
|
|
27649
|
+
span.setStatus({
|
|
27650
|
+
code: SpanStatusCode.ERROR,
|
|
27651
|
+
message: String(error),
|
|
27652
|
+
});
|
|
27653
|
+
throw error;
|
|
27654
|
+
} finally {
|
|
27655
|
+
span.end();
|
|
27656
|
+
}
|
|
27657
|
+
},
|
|
27658
|
+
);
|
|
27659
|
+
}
|
|
27660
|
+
|
|
27661
|
+
protected static async __fromJsonLd__Intent__(
|
|
27662
|
+
json: unknown,
|
|
27663
|
+
span: Span,
|
|
27664
|
+
options: {
|
|
27665
|
+
documentLoader?: DocumentLoader,
|
|
27666
|
+
contextLoader?: DocumentLoader,
|
|
27667
|
+
tracerProvider?: TracerProvider,
|
|
27668
|
+
baseUrl?: URL,
|
|
27669
|
+
} = {},
|
|
27670
|
+
): Promise<Intent> {
|
|
27671
|
+
if (typeof json === \\"undefined\\") {
|
|
27672
|
+
throw new TypeError(\\"Invalid JSON-LD: undefined.\\");
|
|
27673
|
+
}
|
|
27674
|
+
else if (json === null) throw new TypeError(\\"Invalid JSON-LD: null.\\");
|
|
27675
|
+
options = {
|
|
27676
|
+
...options,
|
|
27677
|
+
documentLoader: options.documentLoader ?? getDocumentLoader(),
|
|
27678
|
+
contextLoader: options.contextLoader ?? getDocumentLoader(),
|
|
27679
|
+
tracerProvider: options.tracerProvider ?? trace.getTracerProvider(),
|
|
27680
|
+
};
|
|
27681
|
+
// deno-lint-ignore no-explicit-any
|
|
27682
|
+
let values: Record<string, any[]> & { \\"@id\\"?: string };
|
|
27683
|
+
if (globalThis.Object.keys(json).length == 0) {
|
|
27684
|
+
values = {};
|
|
27685
|
+
} else {
|
|
27686
|
+
const expanded = await jsonld.expand(json, {
|
|
27687
|
+
documentLoader: options.contextLoader,
|
|
27688
|
+
keepFreeFloatingNodes: true,
|
|
27689
|
+
});
|
|
27690
|
+
values =
|
|
27691
|
+
// deno-lint-ignore no-explicit-any
|
|
27692
|
+
(expanded[0] ?? {}) as (Record<string, any[]> & { \\"@id\\"?: string });
|
|
27693
|
+
}
|
|
27694
|
+
if (options.baseUrl == null && values[\\"@id\\"] != null) {
|
|
27695
|
+
options = { ...options, baseUrl: new URL(values[\\"@id\\"]) };
|
|
27696
|
+
}
|
|
27697
|
+
|
|
27698
|
+
if (\\"@type\\" in values) {
|
|
27699
|
+
span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]);
|
|
27700
|
+
}
|
|
27701
|
+
if (\\"@type\\" in values &&
|
|
27702
|
+
!values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) {
|
|
27703
|
+
|
|
27704
|
+
if (!values[\\"@type\\"].includes(\\"https://w3id.org/valueflows/ont/vf#Intent\\")) {
|
|
27705
|
+
throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]);
|
|
27706
|
+
}
|
|
27707
|
+
}
|
|
27708
|
+
|
|
27709
|
+
const instance = new this(
|
|
27710
|
+
{ id: \\"@id\\" in values ? new URL(values[\\"@id\\"] as string) : undefined },
|
|
27711
|
+
options,
|
|
27712
|
+
);
|
|
27713
|
+
const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = [];
|
|
27714
|
+
|
|
27715
|
+
let _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array = values[\\"https://w3id.org/valueflows/ont/vf#action\\"];
|
|
27716
|
+
|
|
27717
|
+
for (
|
|
27718
|
+
const v of _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array == null
|
|
27719
|
+
? []
|
|
27720
|
+
: _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array.length === 1 && \\"@list\\" in _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array[0]
|
|
27721
|
+
? _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array[0][\\"@list\\"]
|
|
27722
|
+
: _38VmZKmXJSBy3AvgqNa9GVqbdphy_action__array
|
|
27723
|
+
) {
|
|
27724
|
+
if (v == null) continue;
|
|
27725
|
+
_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.push(v[\\"@value\\"])
|
|
27726
|
+
}
|
|
27727
|
+
instance.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action = _38VmZKmXJSBy3AvgqNa9GVqbdphy_action;
|
|
27728
|
+
const _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo: (URL)[] = [];
|
|
27729
|
+
|
|
27730
|
+
let _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array = values[\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\"];
|
|
27731
|
+
|
|
27732
|
+
for (
|
|
27733
|
+
const v of _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array == null
|
|
27734
|
+
? []
|
|
27735
|
+
: _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array.length === 1 && \\"@list\\" in _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array[0]
|
|
27736
|
+
? _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array[0][\\"@list\\"]
|
|
27737
|
+
: _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo__array
|
|
27738
|
+
) {
|
|
27739
|
+
if (v == null) continue;
|
|
27740
|
+
_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(v[\\"@id\\"].startsWith(\\"at://\\")
|
|
27741
|
+
? new URL(\\"at://\\" +
|
|
27742
|
+
encodeURIComponent(
|
|
27743
|
+
v[\\"@id\\"].includes(\\"/\\", 5)
|
|
27744
|
+
? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5))
|
|
27745
|
+
: v[\\"@id\\"].slice(5)
|
|
27746
|
+
) +
|
|
27747
|
+
(
|
|
27748
|
+
v[\\"@id\\"].includes(\\"/\\", 5)
|
|
27749
|
+
? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5))
|
|
27750
|
+
: \\"\\"
|
|
27751
|
+
)
|
|
27752
|
+
)
|
|
27753
|
+
: URL.canParse(v[\\"@id\\"]) && (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))
|
|
27754
|
+
? new URL(v[\\"@id\\"])
|
|
27755
|
+
: new URL(v[\\"@id\\"], (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"]))))
|
|
27756
|
+
}
|
|
27757
|
+
instance.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo;
|
|
27758
|
+
const _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity: (Measure)[] = [];
|
|
27759
|
+
|
|
27760
|
+
let _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array = values[\\"https://w3id.org/valueflows/ont/vf#resourceQuantity\\"];
|
|
27761
|
+
|
|
27762
|
+
for (
|
|
27763
|
+
const v of _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array == null
|
|
27764
|
+
? []
|
|
27765
|
+
: _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array.length === 1 && \\"@list\\" in _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array[0]
|
|
27766
|
+
? _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array[0][\\"@list\\"]
|
|
27767
|
+
: _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity__array
|
|
27768
|
+
) {
|
|
27769
|
+
if (v == null) continue;
|
|
27770
|
+
_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.push(await Measure.fromJsonLd(
|
|
27771
|
+
v,
|
|
27772
|
+
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
27773
|
+
))
|
|
27774
|
+
}
|
|
27775
|
+
instance.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity;
|
|
27776
|
+
const _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity: (Measure)[] = [];
|
|
27777
|
+
|
|
27778
|
+
let _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array = values[\\"https://w3id.org/valueflows/ont/vf#availableQuantity\\"];
|
|
27779
|
+
|
|
27780
|
+
for (
|
|
27781
|
+
const v of _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array == null
|
|
27782
|
+
? []
|
|
27783
|
+
: _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array.length === 1 && \\"@list\\" in _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array[0]
|
|
27784
|
+
? _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array[0][\\"@list\\"]
|
|
27785
|
+
: _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity__array
|
|
27786
|
+
) {
|
|
27787
|
+
if (v == null) continue;
|
|
27788
|
+
_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.push(await Measure.fromJsonLd(
|
|
27789
|
+
v,
|
|
27790
|
+
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
27791
|
+
))
|
|
27792
|
+
}
|
|
27793
|
+
instance.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity;
|
|
27794
|
+
const _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity: (Measure)[] = [];
|
|
27795
|
+
|
|
27796
|
+
let _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array = values[\\"https://w3id.org/valueflows/ont/vf#minimumQuantity\\"];
|
|
27797
|
+
|
|
27798
|
+
for (
|
|
27799
|
+
const v of _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array == null
|
|
27800
|
+
? []
|
|
27801
|
+
: _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array.length === 1 && \\"@list\\" in _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array[0]
|
|
27802
|
+
? _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array[0][\\"@list\\"]
|
|
27803
|
+
: _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity__array
|
|
27804
|
+
) {
|
|
27805
|
+
if (v == null) continue;
|
|
27806
|
+
_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.push(await Measure.fromJsonLd(
|
|
27807
|
+
v,
|
|
27808
|
+
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
27809
|
+
))
|
|
27810
|
+
}
|
|
27811
|
+
instance.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity;
|
|
27812
|
+
|
|
27813
|
+
if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) {
|
|
27814
|
+
try {
|
|
27815
|
+
instance._cachedJsonLd = structuredClone(json);
|
|
27816
|
+
} catch {
|
|
27817
|
+
getLogger([\\"fedify\\", \\"vocab\\"]).warn(
|
|
27818
|
+
\\"Failed to cache JSON-LD: {json}\\",
|
|
27819
|
+
{ json },
|
|
27820
|
+
);
|
|
27821
|
+
}
|
|
27822
|
+
}
|
|
27823
|
+
return instance;
|
|
27824
|
+
}
|
|
27825
|
+
|
|
27826
|
+
protected _getCustomInspectProxy(): Record<string, unknown> {
|
|
27827
|
+
|
|
27828
|
+
const proxy: Record<string, unknown> = {};
|
|
27829
|
+
if (this.id != null) {
|
|
27830
|
+
proxy.id = {
|
|
27831
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
27832
|
+
inspect: typeof Deno.inspect,
|
|
27833
|
+
options: Deno.InspectOptions,
|
|
27834
|
+
): string => \\"URL \\" + inspect(this.id!.href, options),
|
|
27835
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
27836
|
+
_depth: number,
|
|
27837
|
+
options: unknown,
|
|
27838
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
27839
|
+
): string => \\"URL \\" + inspect(this.id!.href, options),
|
|
27840
|
+
};
|
|
27841
|
+
}
|
|
27842
|
+
|
|
27843
|
+
const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action = this.#_38VmZKmXJSBy3AvgqNa9GVqbdphy_action
|
|
27844
|
+
// deno-lint-ignore no-explicit-any
|
|
27845
|
+
.map((v: any) => v instanceof URL
|
|
27846
|
+
? {
|
|
27847
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
27848
|
+
inspect: typeof Deno.inspect,
|
|
27849
|
+
options: Deno.InspectOptions,
|
|
27850
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27851
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
27852
|
+
_depth: number,
|
|
27853
|
+
options: unknown,
|
|
27854
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
27855
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27856
|
+
}
|
|
27857
|
+
: v);
|
|
27858
|
+
|
|
27859
|
+
if (_38VmZKmXJSBy3AvgqNa9GVqbdphy_action.length == 1) {
|
|
27860
|
+
proxy.action = _38VmZKmXJSBy3AvgqNa9GVqbdphy_action[0];
|
|
27861
|
+
}
|
|
27862
|
+
|
|
27863
|
+
const _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo = this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo
|
|
27864
|
+
// deno-lint-ignore no-explicit-any
|
|
27865
|
+
.map((v: any) => v instanceof URL
|
|
27866
|
+
? {
|
|
27867
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
27868
|
+
inspect: typeof Deno.inspect,
|
|
27869
|
+
options: Deno.InspectOptions,
|
|
27870
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27871
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
27872
|
+
_depth: number,
|
|
27873
|
+
options: unknown,
|
|
27874
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
27875
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27876
|
+
}
|
|
27877
|
+
: v);
|
|
27878
|
+
|
|
27879
|
+
if (_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.length == 1) {
|
|
27880
|
+
proxy.resourceConformsTo = _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo[0];
|
|
27881
|
+
}
|
|
27882
|
+
|
|
27883
|
+
const _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity = this.#_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity
|
|
27884
|
+
// deno-lint-ignore no-explicit-any
|
|
27885
|
+
.map((v: any) => v instanceof URL
|
|
27886
|
+
? {
|
|
27887
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
27888
|
+
inspect: typeof Deno.inspect,
|
|
27889
|
+
options: Deno.InspectOptions,
|
|
27890
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27891
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
27892
|
+
_depth: number,
|
|
27893
|
+
options: unknown,
|
|
27894
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
27895
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27896
|
+
}
|
|
27897
|
+
: v);
|
|
27898
|
+
|
|
27899
|
+
if (_2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity.length == 1) {
|
|
27900
|
+
proxy.resourceQuantity = _2dLfqTbbRiggEcMQWbHpxkQrtmrc_resourceQuantity[0];
|
|
27901
|
+
}
|
|
27902
|
+
|
|
27903
|
+
const _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity = this.#_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity
|
|
27904
|
+
// deno-lint-ignore no-explicit-any
|
|
27905
|
+
.map((v: any) => v instanceof URL
|
|
27906
|
+
? {
|
|
27907
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
27908
|
+
inspect: typeof Deno.inspect,
|
|
27909
|
+
options: Deno.InspectOptions,
|
|
27910
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27911
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
27912
|
+
_depth: number,
|
|
27913
|
+
options: unknown,
|
|
27914
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
27915
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27916
|
+
}
|
|
27917
|
+
: v);
|
|
27918
|
+
|
|
27919
|
+
if (_YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity.length == 1) {
|
|
27920
|
+
proxy.availableQuantity = _YmNSnuih3Zk4VdR5JPVnQYroLAh_availableQuantity[0];
|
|
27921
|
+
}
|
|
27922
|
+
|
|
27923
|
+
const _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity = this.#_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity
|
|
27924
|
+
// deno-lint-ignore no-explicit-any
|
|
27925
|
+
.map((v: any) => v instanceof URL
|
|
27926
|
+
? {
|
|
27927
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
27928
|
+
inspect: typeof Deno.inspect,
|
|
27929
|
+
options: Deno.InspectOptions,
|
|
27930
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27931
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
27932
|
+
_depth: number,
|
|
27933
|
+
options: unknown,
|
|
27934
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
27935
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
27936
|
+
}
|
|
27937
|
+
: v);
|
|
27938
|
+
|
|
27939
|
+
if (_3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity.length == 1) {
|
|
27940
|
+
proxy.minimumQuantity = _3XueAFds2NBrqNpnV8b7aC8hV72S_minimumQuantity[0];
|
|
27941
|
+
}
|
|
27942
|
+
|
|
27943
|
+
return proxy;
|
|
27944
|
+
}
|
|
27945
|
+
}
|
|
27946
|
+
|
|
27947
|
+
|
|
27948
|
+
// deno-lint-ignore no-explicit-any
|
|
27949
|
+
(Intent.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] =
|
|
27950
|
+
function (
|
|
27951
|
+
this: Intent,
|
|
27952
|
+
inspect: typeof Deno.inspect,
|
|
27953
|
+
options: Deno.InspectOptions,
|
|
27954
|
+
): string {
|
|
27955
|
+
const proxy = this._getCustomInspectProxy();
|
|
27956
|
+
return \\"Intent \\" + inspect(proxy, options);
|
|
27957
|
+
};
|
|
27958
|
+
|
|
27959
|
+
// deno-lint-ignore no-explicit-any
|
|
27960
|
+
(Intent.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] =
|
|
27961
|
+
function (
|
|
27962
|
+
this: Intent,
|
|
27963
|
+
_depth: number,
|
|
27964
|
+
options: unknown,
|
|
27965
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
27966
|
+
): string {
|
|
27967
|
+
const proxy = this._getCustomInspectProxy();
|
|
27968
|
+
return \\"Intent \\" + inspect(proxy, options);
|
|
27969
|
+
};
|
|
27970
|
+
/** A published request or offer, sometimes with what is expected in return.
|
|
27971
|
+
*
|
|
27972
|
+
* Proposals contain a primary {@link Intent} (via \`publishes\`) describing
|
|
27973
|
+
* what is being offered or requested, and optionally a reciprocal
|
|
27974
|
+
* {@link Intent} describing what is expected or offered in return.
|
|
27975
|
+
*
|
|
27976
|
+
* Note: This type extends ActivityStreams \`Object\` for practical
|
|
27977
|
+
* interoperability within ActivityPub federation, even though FEP-0837
|
|
27978
|
+
* defines \`Proposal\` as a pure ValueFlows type. Extending \`Object\`
|
|
27979
|
+
* provides useful inherited properties such as \`name\`, \`content\`,
|
|
27980
|
+
* \`attributedTo\`, \`published\`, \`to\`, and \`location\` without needing to
|
|
27981
|
+
* redefine them.
|
|
27982
|
+
*
|
|
27983
|
+
*/
|
|
27984
|
+
export class Proposal extends Object {
|
|
27985
|
+
|
|
27986
|
+
/**
|
|
27987
|
+
* The type URI of {@link Proposal}: \`https://w3id.org/valueflows/ont/vf#Proposal\`.
|
|
27988
|
+
*/
|
|
27989
|
+
static override get typeId(): URL {
|
|
27990
|
+
return new URL(\\"https://w3id.org/valueflows/ont/vf#Proposal\\");
|
|
27991
|
+
}
|
|
27992
|
+
#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose: (string)[] = [];
|
|
27993
|
+
#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes: (Intent)[] = [];
|
|
27994
|
+
#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal: (Intent)[] = [];
|
|
27995
|
+
#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased: (boolean)[] = [];
|
|
27996
|
+
|
|
27997
|
+
/**
|
|
27998
|
+
* Constructs a new instance of Proposal with the given values.
|
|
27999
|
+
* @param values The values to initialize the instance with.
|
|
28000
|
+
* @param options The options to use for initialization.
|
|
28001
|
+
*/
|
|
28002
|
+
constructor(
|
|
28003
|
+
values:
|
|
28004
|
+
{
|
|
28005
|
+
id?: URL | null;
|
|
28006
|
+
attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null;
|
|
28007
|
+
attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null;
|
|
28008
|
+
audiences?: (Object | URL)[];content?: string | LanguageString | null;
|
|
28009
|
+
contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null;
|
|
28010
|
+
names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null;
|
|
28011
|
+
icons?: (Image | URL)[];image?: Image | URL | null;
|
|
28012
|
+
images?: (Image | URL)[];replyTarget?: Object | Link | URL | null;
|
|
28013
|
+
replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null;
|
|
28014
|
+
locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null;
|
|
28015
|
+
previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null;
|
|
28016
|
+
summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null;
|
|
28017
|
+
urls?: ((URL | Link))[];to?: Object | URL | null;
|
|
28018
|
+
tos?: (Object | URL)[];bto?: Object | URL | null;
|
|
28019
|
+
btos?: (Object | URL)[];cc?: Object | URL | null;
|
|
28020
|
+
ccs?: (Object | URL)[];bcc?: Object | URL | null;
|
|
28021
|
+
bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null;
|
|
28022
|
+
proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;purpose?: string | null;publishes?: Intent | null;reciprocal?: Intent | null;unitBased?: boolean | null;}
|
|
28023
|
+
,
|
|
28024
|
+
options: {
|
|
28025
|
+
documentLoader?: DocumentLoader,
|
|
28026
|
+
contextLoader?: DocumentLoader,
|
|
28027
|
+
tracerProvider?: TracerProvider,
|
|
28028
|
+
} = {},
|
|
28029
|
+
) {
|
|
28030
|
+
super(values, options);
|
|
28031
|
+
if (\\"purpose\\" in values && values.purpose != null) {
|
|
28032
|
+
if (typeof values.purpose === \\"string\\") {
|
|
28033
|
+
// @ts-ignore: type is checked above.
|
|
28034
|
+
this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = [values.purpose];
|
|
28035
|
+
|
|
28036
|
+
} else {
|
|
28037
|
+
throw new TypeError(
|
|
28038
|
+
\\"The purpose must be of type \\" +
|
|
28039
|
+
\\"string\\" + \\".\\",
|
|
28040
|
+
);
|
|
28041
|
+
}
|
|
28042
|
+
}
|
|
28043
|
+
|
|
28044
|
+
if (\\"publishes\\" in values && values.publishes != null) {
|
|
28045
|
+
if (values.publishes instanceof Intent) {
|
|
28046
|
+
// @ts-ignore: type is checked above.
|
|
28047
|
+
this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = [values.publishes];
|
|
28048
|
+
|
|
28049
|
+
} else {
|
|
28050
|
+
throw new TypeError(
|
|
28051
|
+
\\"The publishes must be of type \\" +
|
|
28052
|
+
\\"Intent\\" + \\".\\",
|
|
28053
|
+
);
|
|
28054
|
+
}
|
|
28055
|
+
}
|
|
28056
|
+
|
|
28057
|
+
if (\\"reciprocal\\" in values && values.reciprocal != null) {
|
|
28058
|
+
if (values.reciprocal instanceof Intent) {
|
|
28059
|
+
// @ts-ignore: type is checked above.
|
|
28060
|
+
this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = [values.reciprocal];
|
|
28061
|
+
|
|
28062
|
+
} else {
|
|
28063
|
+
throw new TypeError(
|
|
28064
|
+
\\"The reciprocal must be of type \\" +
|
|
28065
|
+
\\"Intent\\" + \\".\\",
|
|
28066
|
+
);
|
|
28067
|
+
}
|
|
28068
|
+
}
|
|
28069
|
+
|
|
28070
|
+
if (\\"unitBased\\" in values && values.unitBased != null) {
|
|
28071
|
+
if (typeof values.unitBased === \\"boolean\\") {
|
|
28072
|
+
// @ts-ignore: type is checked above.
|
|
28073
|
+
this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = [values.unitBased];
|
|
28074
|
+
|
|
28075
|
+
} else {
|
|
28076
|
+
throw new TypeError(
|
|
28077
|
+
\\"The unitBased must be of type \\" +
|
|
28078
|
+
\\"boolean\\" + \\".\\",
|
|
28079
|
+
);
|
|
28080
|
+
}
|
|
28081
|
+
}
|
|
28082
|
+
}
|
|
28083
|
+
|
|
28084
|
+
/**
|
|
28085
|
+
* Clones this instance, optionally updating it with the given values.
|
|
28086
|
+
* @param values The values to update the clone with.
|
|
28087
|
+
* @param options The options to use for cloning.
|
|
28088
|
+
* @returns The cloned instance.
|
|
28089
|
+
*/
|
|
28090
|
+
override clone(
|
|
28091
|
+
values:
|
|
28092
|
+
{
|
|
28093
|
+
id?: URL | null;
|
|
28094
|
+
attachments?: (Object | Link | PropertyValue | URL)[];attribution?: Application | Group | Organization | Person | Service | URL | null;
|
|
28095
|
+
attributions?: (Application | Group | Organization | Person | Service | URL)[];audience?: Object | URL | null;
|
|
28096
|
+
audiences?: (Object | URL)[];content?: string | LanguageString | null;
|
|
28097
|
+
contents?: ((string | LanguageString))[];contexts?: (Object | Link | URL)[];name?: string | LanguageString | null;
|
|
28098
|
+
names?: ((string | LanguageString))[];endTime?: Temporal.Instant | null;generators?: (Object | Link | URL)[];icon?: Image | URL | null;
|
|
28099
|
+
icons?: (Image | URL)[];image?: Image | URL | null;
|
|
28100
|
+
images?: (Image | URL)[];replyTarget?: Object | Link | URL | null;
|
|
28101
|
+
replyTargets?: (Object | Link | URL)[];location?: Object | Link | URL | null;
|
|
28102
|
+
locations?: (Object | Link | URL)[];preview?: Link | Object | URL | null;
|
|
28103
|
+
previews?: (Link | Object | URL)[];published?: Temporal.Instant | null;replies?: Collection | URL | null;shares?: Collection | URL | null;likes?: Collection | URL | null;emojiReactions?: Collection | URL | null;startTime?: Temporal.Instant | null;summary?: string | LanguageString | null;
|
|
28104
|
+
summaries?: ((string | LanguageString))[];tags?: (Object | Link | URL)[];updated?: Temporal.Instant | null;url?: URL | Link | null;
|
|
28105
|
+
urls?: ((URL | Link))[];to?: Object | URL | null;
|
|
28106
|
+
tos?: (Object | URL)[];bto?: Object | URL | null;
|
|
28107
|
+
btos?: (Object | URL)[];cc?: Object | URL | null;
|
|
28108
|
+
ccs?: (Object | URL)[];bcc?: Object | URL | null;
|
|
28109
|
+
bccs?: (Object | URL)[];mediaType?: string | null;duration?: Temporal.Duration | null;sensitive?: boolean | null;source?: Source | null;proof?: DataIntegrityProof | URL | null;
|
|
28110
|
+
proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | null;approvedBy?: URL | null;likeAuthorization?: LikeAuthorization | URL | null;replyAuthorization?: ReplyAuthorization | URL | null;announceAuthorization?: AnnounceAuthorization | URL | null;purpose?: string | null;publishes?: Intent | null;reciprocal?: Intent | null;unitBased?: boolean | null;}
|
|
28111
|
+
|
|
28112
|
+
= {},
|
|
28113
|
+
options: {
|
|
28114
|
+
documentLoader?: DocumentLoader,
|
|
28115
|
+
contextLoader?: DocumentLoader,
|
|
28116
|
+
} = {}
|
|
28117
|
+
): Proposal {
|
|
28118
|
+
if (this._warning != null) {
|
|
28119
|
+
getLogger(this._warning.category).warn(
|
|
28120
|
+
this._warning.message,
|
|
28121
|
+
this._warning.values
|
|
28122
|
+
);
|
|
28123
|
+
// @ts-ignore: \$warning is not recognized as a property, but it is.
|
|
28124
|
+
options = { ...options, \$warning: this._warning };
|
|
28125
|
+
}
|
|
28126
|
+
const clone = super.clone(values, options) as unknown as Proposal;clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose;
|
|
28127
|
+
if (\\"purpose\\" in values && values.purpose != null) {
|
|
28128
|
+
if (typeof values.purpose === \\"string\\") {
|
|
28129
|
+
// @ts-ignore: type is checked above.
|
|
28130
|
+
clone.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = [values.purpose];
|
|
28131
|
+
|
|
28132
|
+
} else {
|
|
28133
|
+
throw new TypeError(
|
|
28134
|
+
\\"The purpose must be of type \\" +
|
|
28135
|
+
\\"string\\" + \\".\\",
|
|
28136
|
+
);
|
|
28137
|
+
}
|
|
28138
|
+
}
|
|
28139
|
+
clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes;
|
|
28140
|
+
if (\\"publishes\\" in values && values.publishes != null) {
|
|
28141
|
+
if (values.publishes instanceof Intent) {
|
|
28142
|
+
// @ts-ignore: type is checked above.
|
|
28143
|
+
clone.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = [values.publishes];
|
|
28144
|
+
|
|
28145
|
+
} else {
|
|
28146
|
+
throw new TypeError(
|
|
28147
|
+
\\"The publishes must be of type \\" +
|
|
28148
|
+
\\"Intent\\" + \\".\\",
|
|
28149
|
+
);
|
|
28150
|
+
}
|
|
28151
|
+
}
|
|
28152
|
+
clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal;
|
|
28153
|
+
if (\\"reciprocal\\" in values && values.reciprocal != null) {
|
|
28154
|
+
if (values.reciprocal instanceof Intent) {
|
|
28155
|
+
// @ts-ignore: type is checked above.
|
|
28156
|
+
clone.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = [values.reciprocal];
|
|
28157
|
+
|
|
28158
|
+
} else {
|
|
28159
|
+
throw new TypeError(
|
|
28160
|
+
\\"The reciprocal must be of type \\" +
|
|
28161
|
+
\\"Intent\\" + \\".\\",
|
|
28162
|
+
);
|
|
28163
|
+
}
|
|
28164
|
+
}
|
|
28165
|
+
clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased;
|
|
28166
|
+
if (\\"unitBased\\" in values && values.unitBased != null) {
|
|
28167
|
+
if (typeof values.unitBased === \\"boolean\\") {
|
|
28168
|
+
// @ts-ignore: type is checked above.
|
|
28169
|
+
clone.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = [values.unitBased];
|
|
28170
|
+
|
|
28171
|
+
} else {
|
|
28172
|
+
throw new TypeError(
|
|
28173
|
+
\\"The unitBased must be of type \\" +
|
|
28174
|
+
\\"boolean\\" + \\".\\",
|
|
28175
|
+
);
|
|
28176
|
+
}
|
|
28177
|
+
}
|
|
28178
|
+
|
|
28179
|
+
return clone;
|
|
28180
|
+
}
|
|
28181
|
+
|
|
28182
|
+
/** The type of proposal. Possible values are \`\\"offer\\"\` and \`\\"request\\"\`.
|
|
28183
|
+
*
|
|
28184
|
+
*/
|
|
28185
|
+
get purpose(): (string | null) {
|
|
28186
|
+
if (this._warning != null) {
|
|
28187
|
+
getLogger(this._warning.category).warn(
|
|
28188
|
+
this._warning.message,
|
|
28189
|
+
this._warning.values
|
|
28190
|
+
);
|
|
28191
|
+
}
|
|
28192
|
+
if (this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.length < 1) return null;
|
|
28193
|
+
return this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose[0];
|
|
28194
|
+
}
|
|
28195
|
+
|
|
28196
|
+
/** The primary intent of this proposal, describing what is being offered
|
|
28197
|
+
* or requested.
|
|
28198
|
+
*
|
|
28199
|
+
*/
|
|
28200
|
+
get publishes(): (Intent | null) {
|
|
28201
|
+
if (this._warning != null) {
|
|
28202
|
+
getLogger(this._warning.category).warn(
|
|
28203
|
+
this._warning.message,
|
|
28204
|
+
this._warning.values
|
|
28205
|
+
);
|
|
28206
|
+
}
|
|
28207
|
+
if (this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length < 1) return null;
|
|
28208
|
+
return this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[0];
|
|
28209
|
+
}
|
|
28210
|
+
|
|
28211
|
+
/** The reciprocal intent of this proposal, describing what is expected
|
|
28212
|
+
* or offered in return.
|
|
28213
|
+
*
|
|
28214
|
+
*/
|
|
28215
|
+
get reciprocal(): (Intent | null) {
|
|
28216
|
+
if (this._warning != null) {
|
|
28217
|
+
getLogger(this._warning.category).warn(
|
|
28218
|
+
this._warning.message,
|
|
28219
|
+
this._warning.values
|
|
28220
|
+
);
|
|
28221
|
+
}
|
|
28222
|
+
if (this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length < 1) return null;
|
|
28223
|
+
return this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[0];
|
|
28224
|
+
}
|
|
28225
|
+
|
|
28226
|
+
/** Indicates whether the quantities expressed in the proposal can be
|
|
28227
|
+
* multiplied or not. The default is \`false\`.
|
|
28228
|
+
*
|
|
28229
|
+
*/
|
|
28230
|
+
get unitBased(): (boolean | null) {
|
|
28231
|
+
if (this._warning != null) {
|
|
28232
|
+
getLogger(this._warning.category).warn(
|
|
28233
|
+
this._warning.message,
|
|
28234
|
+
this._warning.values
|
|
28235
|
+
);
|
|
28236
|
+
}
|
|
28237
|
+
if (this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.length < 1) return null;
|
|
28238
|
+
return this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased[0];
|
|
28239
|
+
}
|
|
28240
|
+
|
|
28241
|
+
/**
|
|
28242
|
+
* Converts this object to a JSON-LD structure.
|
|
28243
|
+
* @param options The options to use.
|
|
28244
|
+
* - \`format\`: The format of the output: \`compact\` or
|
|
28245
|
+
\`expand\`.
|
|
28246
|
+
* - \`contextLoader\`: The loader for remote JSON-LD contexts.
|
|
28247
|
+
* - \`context\`: The JSON-LD context to use. Not applicable
|
|
28248
|
+
when \`format\` is set to \`'expand'\`.
|
|
28249
|
+
* @returns The JSON-LD representation of this object.
|
|
28250
|
+
*/
|
|
28251
|
+
override async toJsonLd(options: {
|
|
28252
|
+
format?: \\"compact\\" | \\"expand\\",
|
|
28253
|
+
contextLoader?: DocumentLoader,
|
|
28254
|
+
context?: string | Record<string, string> | (string | Record<string, string>)[],
|
|
28255
|
+
} = {}): Promise<unknown> {
|
|
28256
|
+
if (options.format == null && this._cachedJsonLd != null) {
|
|
28257
|
+
return this._cachedJsonLd;
|
|
28258
|
+
}
|
|
28259
|
+
if (options.format !== \\"compact\\" && options.context != null) {
|
|
28260
|
+
throw new TypeError(
|
|
28261
|
+
\\"The context option can only be used when the format option is set \\" +
|
|
28262
|
+
\\"to 'compact'.\\"
|
|
28263
|
+
);
|
|
28264
|
+
}
|
|
28265
|
+
options = {
|
|
28266
|
+
...options,
|
|
28267
|
+
contextLoader: options.contextLoader ?? getDocumentLoader(),
|
|
28268
|
+
};
|
|
28269
|
+
|
|
28270
|
+
if (options.format == null && this.isCompactable()) {
|
|
28271
|
+
|
|
28272
|
+
const result = await super.toJsonLd({
|
|
28273
|
+
...options,
|
|
28274
|
+
format: undefined,
|
|
28275
|
+
context: undefined,
|
|
28276
|
+
}) as Record<string, unknown>;
|
|
28277
|
+
|
|
28278
|
+
// deno-lint-ignore no-unused-vars
|
|
28279
|
+
let compactItems: unknown[];
|
|
28280
|
+
|
|
28281
|
+
compactItems = [];
|
|
28282
|
+
for (const v of this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) {
|
|
28283
|
+
const item = (
|
|
28284
|
+
v
|
|
28285
|
+
);
|
|
28286
|
+
compactItems.push(item);
|
|
28287
|
+
}
|
|
28288
|
+
if (compactItems.length > 0) {
|
|
28289
|
+
|
|
28290
|
+
result[\\"purpose\\"]
|
|
28291
|
+
= compactItems.length > 1
|
|
28292
|
+
? compactItems
|
|
28293
|
+
: compactItems[0];
|
|
28294
|
+
|
|
28295
|
+
}
|
|
28296
|
+
|
|
28297
|
+
compactItems = [];
|
|
28298
|
+
for (const v of this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) {
|
|
28299
|
+
const item = (
|
|
28300
|
+
await v.toJsonLd({
|
|
28301
|
+
...(options),
|
|
28302
|
+
format: undefined,
|
|
28303
|
+
context: undefined,
|
|
28304
|
+
})
|
|
28305
|
+
);
|
|
28306
|
+
compactItems.push(item);
|
|
28307
|
+
}
|
|
28308
|
+
if (compactItems.length > 0) {
|
|
28309
|
+
|
|
28310
|
+
result[\\"publishes\\"]
|
|
28311
|
+
= compactItems.length > 1
|
|
28312
|
+
? compactItems
|
|
28313
|
+
: compactItems[0];
|
|
28314
|
+
|
|
28315
|
+
}
|
|
28316
|
+
|
|
28317
|
+
compactItems = [];
|
|
28318
|
+
for (const v of this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) {
|
|
28319
|
+
const item = (
|
|
28320
|
+
await v.toJsonLd({
|
|
28321
|
+
...(options),
|
|
28322
|
+
format: undefined,
|
|
28323
|
+
context: undefined,
|
|
28324
|
+
})
|
|
28325
|
+
);
|
|
28326
|
+
compactItems.push(item);
|
|
28327
|
+
}
|
|
28328
|
+
if (compactItems.length > 0) {
|
|
28329
|
+
|
|
28330
|
+
result[\\"reciprocal\\"]
|
|
28331
|
+
= compactItems.length > 1
|
|
28332
|
+
? compactItems
|
|
28333
|
+
: compactItems[0];
|
|
28334
|
+
|
|
28335
|
+
}
|
|
28336
|
+
|
|
28337
|
+
compactItems = [];
|
|
28338
|
+
for (const v of this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) {
|
|
28339
|
+
const item = (
|
|
28340
|
+
v
|
|
28341
|
+
);
|
|
28342
|
+
compactItems.push(item);
|
|
28343
|
+
}
|
|
28344
|
+
if (compactItems.length > 0) {
|
|
28345
|
+
|
|
28346
|
+
result[\\"unitBased\\"]
|
|
28347
|
+
= compactItems.length > 1
|
|
28348
|
+
? compactItems
|
|
28349
|
+
: compactItems[0];
|
|
28350
|
+
|
|
28351
|
+
}
|
|
28352
|
+
|
|
28353
|
+
result[\\"type\\"] = \\"Proposal\\";
|
|
28354
|
+
if (this.id != null) result[\\"id\\"] = this.id.href;
|
|
28355
|
+
result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"},\\"Proposal\\":\\"vf:Proposal\\",\\"Intent\\":\\"vf:Intent\\",\\"purpose\\":\\"vf:purpose\\",\\"unitBased\\":\\"vf:unitBased\\",\\"publishes\\":\\"vf:publishes\\",\\"reciprocal\\":\\"vf:reciprocal\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}];
|
|
28356
|
+
return result;
|
|
28357
|
+
}
|
|
28358
|
+
|
|
28359
|
+
// deno-lint-ignore no-unused-vars prefer-const
|
|
28360
|
+
let array: unknown[];
|
|
28361
|
+
|
|
28362
|
+
const baseValues = await super.toJsonLd({
|
|
28363
|
+
...options,
|
|
28364
|
+
format: \\"expand\\",
|
|
28365
|
+
context: undefined,
|
|
28366
|
+
}) as unknown[];
|
|
28367
|
+
const values = baseValues[0] as Record<
|
|
28368
|
+
string,
|
|
28369
|
+
unknown[] | { \\"@list\\": unknown[] } | string
|
|
28370
|
+
>;
|
|
28371
|
+
|
|
28372
|
+
array = [];
|
|
28373
|
+
for (const v of this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose) {
|
|
28374
|
+
const element = (
|
|
28375
|
+
{ \\"@value\\": v }
|
|
28376
|
+
);
|
|
28377
|
+
array.push(element);;
|
|
28378
|
+
}
|
|
28379
|
+
if (array.length > 0) {
|
|
28380
|
+
const propValue = (
|
|
28381
|
+
array
|
|
28382
|
+
);
|
|
28383
|
+
values[\\"https://w3id.org/valueflows/ont/vf#purpose\\"] = propValue;
|
|
28384
|
+
|
|
28385
|
+
}
|
|
28386
|
+
|
|
28387
|
+
array = [];
|
|
28388
|
+
for (const v of this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes) {
|
|
28389
|
+
const element = (
|
|
28390
|
+
await v.toJsonLd(options)
|
|
28391
|
+
);
|
|
28392
|
+
array.push(element);;
|
|
28393
|
+
}
|
|
28394
|
+
if (array.length > 0) {
|
|
28395
|
+
const propValue = (
|
|
28396
|
+
array
|
|
28397
|
+
);
|
|
28398
|
+
values[\\"https://w3id.org/valueflows/ont/vf#publishes\\"] = propValue;
|
|
28399
|
+
|
|
28400
|
+
}
|
|
28401
|
+
|
|
28402
|
+
array = [];
|
|
28403
|
+
for (const v of this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal) {
|
|
28404
|
+
const element = (
|
|
28405
|
+
await v.toJsonLd(options)
|
|
28406
|
+
);
|
|
28407
|
+
array.push(element);;
|
|
28408
|
+
}
|
|
28409
|
+
if (array.length > 0) {
|
|
28410
|
+
const propValue = (
|
|
28411
|
+
array
|
|
28412
|
+
);
|
|
28413
|
+
values[\\"https://w3id.org/valueflows/ont/vf#reciprocal\\"] = propValue;
|
|
28414
|
+
|
|
28415
|
+
}
|
|
28416
|
+
|
|
28417
|
+
array = [];
|
|
28418
|
+
for (const v of this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased) {
|
|
28419
|
+
const element = (
|
|
28420
|
+
{ \\"@value\\": v }
|
|
28421
|
+
);
|
|
28422
|
+
array.push(element);;
|
|
28423
|
+
}
|
|
28424
|
+
if (array.length > 0) {
|
|
28425
|
+
const propValue = (
|
|
28426
|
+
array
|
|
28427
|
+
);
|
|
28428
|
+
values[\\"https://w3id.org/valueflows/ont/vf#unitBased\\"] = propValue;
|
|
28429
|
+
|
|
28430
|
+
}
|
|
28431
|
+
|
|
28432
|
+
values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Proposal\\"];
|
|
28433
|
+
if (this.id != null) values[\\"@id\\"] = this.id.href;
|
|
28434
|
+
if (options.format === \\"expand\\") {
|
|
28435
|
+
return await jsonld.expand(
|
|
28436
|
+
values,
|
|
28437
|
+
{ documentLoader: options.contextLoader },
|
|
28438
|
+
);
|
|
28439
|
+
}
|
|
28440
|
+
const docContext = options.context ??
|
|
28441
|
+
[\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"},\\"Proposal\\":\\"vf:Proposal\\",\\"Intent\\":\\"vf:Intent\\",\\"purpose\\":\\"vf:purpose\\",\\"unitBased\\":\\"vf:unitBased\\",\\"publishes\\":\\"vf:publishes\\",\\"reciprocal\\":\\"vf:reciprocal\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}];
|
|
28442
|
+
const compacted = await jsonld.compact(
|
|
28443
|
+
values,
|
|
28444
|
+
docContext,
|
|
28445
|
+
{ documentLoader: options.contextLoader },
|
|
28446
|
+
);
|
|
28447
|
+
if (docContext != null) {
|
|
28448
|
+
// Embed context
|
|
28449
|
+
|
|
28450
|
+
if (\\"proof\\" in compacted &&
|
|
28451
|
+
compacted.proof != null) {
|
|
28452
|
+
if (Array.isArray(compacted.proof)) {
|
|
28453
|
+
for (const element of compacted.proof) {
|
|
28454
|
+
element[\\"@context\\"] = docContext;
|
|
28455
|
+
}
|
|
28456
|
+
} else {
|
|
28457
|
+
compacted.proof[\\"@context\\"] = docContext;
|
|
28458
|
+
}
|
|
28459
|
+
}
|
|
28460
|
+
|
|
28461
|
+
}
|
|
28462
|
+
return compacted;
|
|
28463
|
+
}
|
|
28464
|
+
|
|
28465
|
+
protected override isCompactable(): boolean {
|
|
28466
|
+
|
|
28467
|
+
return super.isCompactable();
|
|
28468
|
+
}
|
|
28469
|
+
|
|
28470
|
+
/**
|
|
28471
|
+
* Converts a JSON-LD structure to an object of this type.
|
|
28472
|
+
* @param json The JSON-LD structure to convert.
|
|
28473
|
+
* @param options The options to use.
|
|
28474
|
+
* - \`documentLoader\`: The loader for remote JSON-LD documents.
|
|
28475
|
+
* - \`contextLoader\`: The loader for remote JSON-LD contexts.
|
|
28476
|
+
* - \`tracerProvider\`: The OpenTelemetry tracer provider to use.
|
|
28477
|
+
* If omitted, the global tracer provider is used.
|
|
28478
|
+
* @returns The object of this type.
|
|
28479
|
+
* @throws {TypeError} If the given \`json\` is invalid.
|
|
28480
|
+
*/
|
|
28481
|
+
static override async fromJsonLd(
|
|
28482
|
+
json: unknown,
|
|
28483
|
+
options: {
|
|
28484
|
+
documentLoader?: DocumentLoader,
|
|
28485
|
+
contextLoader?: DocumentLoader,
|
|
28486
|
+
tracerProvider?: TracerProvider,
|
|
28487
|
+
baseUrl?: URL,
|
|
28488
|
+
} = {},
|
|
28489
|
+
): Promise<Proposal> {
|
|
28490
|
+
const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
|
|
28491
|
+
const tracer = tracerProvider.getTracer(
|
|
28492
|
+
\\"@fedify/vocab-tools\\",
|
|
28493
|
+
\\"0.0.0\\",
|
|
28494
|
+
);
|
|
28495
|
+
return await tracer.startActiveSpan(
|
|
28496
|
+
\\"activitypub.parse_object\\",
|
|
28497
|
+
async (span) => {
|
|
28498
|
+
try {
|
|
28499
|
+
const object = await this.__fromJsonLd__Proposal__(
|
|
28500
|
+
json, span, options);
|
|
28501
|
+
if (object.id != null) {
|
|
28502
|
+
span.setAttribute(\\"activitypub.object.id\\", object.id.href);
|
|
28503
|
+
}
|
|
28504
|
+
return object;
|
|
28505
|
+
} catch (error) {
|
|
28506
|
+
span.setStatus({
|
|
28507
|
+
code: SpanStatusCode.ERROR,
|
|
28508
|
+
message: String(error),
|
|
28509
|
+
});
|
|
28510
|
+
throw error;
|
|
28511
|
+
} finally {
|
|
28512
|
+
span.end();
|
|
28513
|
+
}
|
|
28514
|
+
},
|
|
28515
|
+
);
|
|
28516
|
+
}
|
|
28517
|
+
|
|
28518
|
+
protected static async __fromJsonLd__Proposal__(
|
|
28519
|
+
json: unknown,
|
|
28520
|
+
span: Span,
|
|
28521
|
+
options: {
|
|
28522
|
+
documentLoader?: DocumentLoader,
|
|
28523
|
+
contextLoader?: DocumentLoader,
|
|
28524
|
+
tracerProvider?: TracerProvider,
|
|
28525
|
+
baseUrl?: URL,
|
|
28526
|
+
} = {},
|
|
28527
|
+
): Promise<Proposal> {
|
|
28528
|
+
if (typeof json === \\"undefined\\") {
|
|
28529
|
+
throw new TypeError(\\"Invalid JSON-LD: undefined.\\");
|
|
28530
|
+
}
|
|
28531
|
+
else if (json === null) throw new TypeError(\\"Invalid JSON-LD: null.\\");
|
|
28532
|
+
options = {
|
|
28533
|
+
...options,
|
|
28534
|
+
documentLoader: options.documentLoader ?? getDocumentLoader(),
|
|
28535
|
+
contextLoader: options.contextLoader ?? getDocumentLoader(),
|
|
28536
|
+
tracerProvider: options.tracerProvider ?? trace.getTracerProvider(),
|
|
28537
|
+
};
|
|
28538
|
+
// deno-lint-ignore no-explicit-any
|
|
28539
|
+
let values: Record<string, any[]> & { \\"@id\\"?: string };
|
|
28540
|
+
if (globalThis.Object.keys(json).length == 0) {
|
|
28541
|
+
values = {};
|
|
28542
|
+
} else {
|
|
28543
|
+
const expanded = await jsonld.expand(json, {
|
|
28544
|
+
documentLoader: options.contextLoader,
|
|
28545
|
+
keepFreeFloatingNodes: true,
|
|
28546
|
+
});
|
|
28547
|
+
values =
|
|
28548
|
+
// deno-lint-ignore no-explicit-any
|
|
28549
|
+
(expanded[0] ?? {}) as (Record<string, any[]> & { \\"@id\\"?: string });
|
|
28550
|
+
}
|
|
28551
|
+
if (options.baseUrl == null && values[\\"@id\\"] != null) {
|
|
28552
|
+
options = { ...options, baseUrl: new URL(values[\\"@id\\"]) };
|
|
28553
|
+
}
|
|
28554
|
+
|
|
28555
|
+
if (\\"@type\\" in values) {
|
|
28556
|
+
span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]);
|
|
28557
|
+
}
|
|
28558
|
+
if (\\"@type\\" in values &&
|
|
28559
|
+
!values[\\"@type\\"].every(t => t.startsWith(\\"_:\\"))) {
|
|
28560
|
+
|
|
28561
|
+
if (!values[\\"@type\\"].includes(\\"https://w3id.org/valueflows/ont/vf#Proposal\\")) {
|
|
28562
|
+
throw new TypeError(\\"Invalid type: \\" + values[\\"@type\\"]);
|
|
28563
|
+
}
|
|
28564
|
+
}
|
|
28565
|
+
|
|
28566
|
+
delete values[\\"@type\\"];
|
|
28567
|
+
const instance = await super.fromJsonLd(values, {
|
|
28568
|
+
...options,
|
|
28569
|
+
// @ts-ignore: an internal option
|
|
28570
|
+
_fromSubclass: true,
|
|
28571
|
+
});
|
|
28572
|
+
if (!(instance instanceof Proposal)) {
|
|
28573
|
+
throw new TypeError(\\"Unexpected type: \\" + instance.constructor.name);
|
|
28574
|
+
}
|
|
28575
|
+
const _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose: (string)[] = [];
|
|
28576
|
+
|
|
28577
|
+
let _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array = values[\\"https://w3id.org/valueflows/ont/vf#purpose\\"];
|
|
28578
|
+
|
|
28579
|
+
for (
|
|
28580
|
+
const v of _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array == null
|
|
28581
|
+
? []
|
|
28582
|
+
: _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array.length === 1 && \\"@list\\" in _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array[0]
|
|
28583
|
+
? _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array[0][\\"@list\\"]
|
|
28584
|
+
: _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose__array
|
|
28585
|
+
) {
|
|
28586
|
+
if (v == null) continue;
|
|
28587
|
+
_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.push(v[\\"@value\\"])
|
|
28588
|
+
}
|
|
28589
|
+
instance.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose;
|
|
28590
|
+
const _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes: (Intent)[] = [];
|
|
28591
|
+
|
|
28592
|
+
let _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array = values[\\"https://w3id.org/valueflows/ont/vf#publishes\\"];
|
|
28593
|
+
|
|
28594
|
+
for (
|
|
28595
|
+
const v of _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array == null
|
|
28596
|
+
? []
|
|
28597
|
+
: _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array.length === 1 && \\"@list\\" in _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array[0]
|
|
28598
|
+
? _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array[0][\\"@list\\"]
|
|
28599
|
+
: _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes__array
|
|
28600
|
+
) {
|
|
28601
|
+
if (v == null) continue;
|
|
28602
|
+
_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.push(await Intent.fromJsonLd(
|
|
28603
|
+
v,
|
|
28604
|
+
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
28605
|
+
))
|
|
28606
|
+
}
|
|
28607
|
+
instance.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes;
|
|
28608
|
+
const _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal: (Intent)[] = [];
|
|
28609
|
+
|
|
28610
|
+
let _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array = values[\\"https://w3id.org/valueflows/ont/vf#reciprocal\\"];
|
|
28611
|
+
|
|
28612
|
+
for (
|
|
28613
|
+
const v of _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array == null
|
|
28614
|
+
? []
|
|
28615
|
+
: _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array.length === 1 && \\"@list\\" in _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array[0]
|
|
28616
|
+
? _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array[0][\\"@list\\"]
|
|
28617
|
+
: _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal__array
|
|
28618
|
+
) {
|
|
28619
|
+
if (v == null) continue;
|
|
28620
|
+
_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.push(await Intent.fromJsonLd(
|
|
28621
|
+
v,
|
|
28622
|
+
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
28623
|
+
))
|
|
28624
|
+
}
|
|
28625
|
+
instance.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal;
|
|
28626
|
+
const _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased: (boolean)[] = [];
|
|
28627
|
+
|
|
28628
|
+
let _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array = values[\\"https://w3id.org/valueflows/ont/vf#unitBased\\"];
|
|
28629
|
+
|
|
28630
|
+
for (
|
|
28631
|
+
const v of _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array == null
|
|
28632
|
+
? []
|
|
28633
|
+
: _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array.length === 1 && \\"@list\\" in _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array[0]
|
|
28634
|
+
? _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array[0][\\"@list\\"]
|
|
28635
|
+
: _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased__array
|
|
28636
|
+
) {
|
|
28637
|
+
if (v == null) continue;
|
|
28638
|
+
_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.push(v[\\"@value\\"])
|
|
28639
|
+
}
|
|
28640
|
+
instance.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased;
|
|
28641
|
+
|
|
28642
|
+
if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) {
|
|
28643
|
+
try {
|
|
28644
|
+
instance._cachedJsonLd = structuredClone(json);
|
|
28645
|
+
} catch {
|
|
28646
|
+
getLogger([\\"fedify\\", \\"vocab\\"]).warn(
|
|
28647
|
+
\\"Failed to cache JSON-LD: {json}\\",
|
|
28648
|
+
{ json },
|
|
28649
|
+
);
|
|
28650
|
+
}
|
|
28651
|
+
}
|
|
28652
|
+
return instance;
|
|
28653
|
+
}
|
|
28654
|
+
|
|
28655
|
+
protected override _getCustomInspectProxy(): Record<string, unknown> {
|
|
28656
|
+
const proxy: Record<string, unknown> = super._getCustomInspectProxy();
|
|
28657
|
+
const _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose = this.#_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose
|
|
28658
|
+
// deno-lint-ignore no-explicit-any
|
|
28659
|
+
.map((v: any) => v instanceof URL
|
|
28660
|
+
? {
|
|
28661
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
28662
|
+
inspect: typeof Deno.inspect,
|
|
28663
|
+
options: Deno.InspectOptions,
|
|
28664
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28665
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
28666
|
+
_depth: number,
|
|
28667
|
+
options: unknown,
|
|
28668
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
28669
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28670
|
+
}
|
|
28671
|
+
: v);
|
|
28672
|
+
|
|
28673
|
+
if (_4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose.length == 1) {
|
|
28674
|
+
proxy.purpose = _4wb2xgUBheR2gaD2Se8QBH4LEC7_purpose[0];
|
|
28675
|
+
}
|
|
28676
|
+
|
|
28677
|
+
const _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes = this.#_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes
|
|
28678
|
+
// deno-lint-ignore no-explicit-any
|
|
28679
|
+
.map((v: any) => v instanceof URL
|
|
28680
|
+
? {
|
|
28681
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
28682
|
+
inspect: typeof Deno.inspect,
|
|
28683
|
+
options: Deno.InspectOptions,
|
|
28684
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28685
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
28686
|
+
_depth: number,
|
|
28687
|
+
options: unknown,
|
|
28688
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
28689
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28690
|
+
}
|
|
28691
|
+
: v);
|
|
28692
|
+
|
|
28693
|
+
if (_sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes.length == 1) {
|
|
28694
|
+
proxy.publishes = _sS5LvXX8cn4c3x6ux836AwYbTyJ_publishes[0];
|
|
28695
|
+
}
|
|
28696
|
+
|
|
28697
|
+
const _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal = this.#_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal
|
|
28698
|
+
// deno-lint-ignore no-explicit-any
|
|
28699
|
+
.map((v: any) => v instanceof URL
|
|
28700
|
+
? {
|
|
28701
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
28702
|
+
inspect: typeof Deno.inspect,
|
|
28703
|
+
options: Deno.InspectOptions,
|
|
28704
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28705
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
28706
|
+
_depth: number,
|
|
28707
|
+
options: unknown,
|
|
28708
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
28709
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28710
|
+
}
|
|
28711
|
+
: v);
|
|
28712
|
+
|
|
28713
|
+
if (_Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal.length == 1) {
|
|
28714
|
+
proxy.reciprocal = _Z4ntJgFwR9BaNTbFvkRTGNEwUwy_reciprocal[0];
|
|
28715
|
+
}
|
|
28716
|
+
|
|
28717
|
+
const _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased = this.#_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased
|
|
28718
|
+
// deno-lint-ignore no-explicit-any
|
|
28719
|
+
.map((v: any) => v instanceof URL
|
|
28720
|
+
? {
|
|
28721
|
+
[Symbol.for(\\"Deno.customInspect\\")]: (
|
|
28722
|
+
inspect: typeof Deno.inspect,
|
|
28723
|
+
options: Deno.InspectOptions,
|
|
28724
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28725
|
+
[Symbol.for(\\"nodejs.util.inspect.custom\\")]: (
|
|
28726
|
+
_depth: number,
|
|
28727
|
+
options: unknown,
|
|
28728
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
28729
|
+
): string => \\"URL \\" + inspect(v.href, options),
|
|
28730
|
+
}
|
|
28731
|
+
: v);
|
|
28732
|
+
|
|
28733
|
+
if (_48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased.length == 1) {
|
|
28734
|
+
proxy.unitBased = _48ncwmfGhSoqAFByMVh2UxoiozPq_unitBased[0];
|
|
28735
|
+
}
|
|
28736
|
+
|
|
28737
|
+
return proxy;
|
|
28738
|
+
}
|
|
28739
|
+
}
|
|
28740
|
+
|
|
28741
|
+
|
|
28742
|
+
// deno-lint-ignore no-explicit-any
|
|
28743
|
+
(Proposal.prototype as any)[Symbol.for(\\"Deno.customInspect\\")] =
|
|
28744
|
+
function (
|
|
28745
|
+
this: Proposal,
|
|
28746
|
+
inspect: typeof Deno.inspect,
|
|
28747
|
+
options: Deno.InspectOptions,
|
|
28748
|
+
): string {
|
|
28749
|
+
const proxy = this._getCustomInspectProxy();
|
|
28750
|
+
return \\"Proposal \\" + inspect(proxy, options);
|
|
28751
|
+
};
|
|
28752
|
+
|
|
28753
|
+
// deno-lint-ignore no-explicit-any
|
|
28754
|
+
(Proposal.prototype as any)[Symbol.for(\\"nodejs.util.inspect.custom\\")] =
|
|
28755
|
+
function (
|
|
28756
|
+
this: Proposal,
|
|
28757
|
+
_depth: number,
|
|
28758
|
+
options: unknown,
|
|
28759
|
+
inspect: (value: unknown, options: unknown) => string,
|
|
28760
|
+
): string {
|
|
28761
|
+
const proxy = this._getCustomInspectProxy();
|
|
28762
|
+
return \\"Proposal \\" + inspect(proxy, options);
|
|
28763
|
+
};
|
|
26475
28764
|
/** Indicates that the \`actor\` accepts the \`object\`. The \`target\` property can be
|
|
26476
28765
|
* used in certain circumstances to indicate the context into which the \`object\`
|
|
26477
28766
|
* has been accepted.
|
|
@@ -40715,7 +43004,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu
|
|
|
40715
43004
|
|
|
40716
43005
|
const decoded =
|
|
40717
43006
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
40718
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
43007
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
40719
43008
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
40720
43009
|
v,
|
|
40721
43010
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -53729,7 +56018,7 @@ get names(): ((string | LanguageString))[] {
|
|
|
53729
56018
|
v,
|
|
53730
56019
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
53731
56020
|
) : typeof v === \\"object\\" && \\"@type\\" in v
|
|
53732
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
56021
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
53733
56022
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
53734
56023
|
v,
|
|
53735
56024
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -58355,7 +60644,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu
|
|
|
58355
60644
|
|
|
58356
60645
|
const decoded =
|
|
58357
60646
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
58358
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
60647
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
58359
60648
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
58360
60649
|
v,
|
|
58361
60650
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|
|
@@ -59141,7 +61430,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu
|
|
|
59141
61430
|
|
|
59142
61431
|
const decoded =
|
|
59143
61432
|
typeof v === \\"object\\" && \\"@type\\" in v
|
|
59144
|
-
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
61433
|
+
&& Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Object\\",\\"http://joinmastodon.org/ns#Emoji\\",\\"http://litepub.social/ns#ChatMessage\\",\\"https://gotosocial.org/ns#AnnounceAuthorization\\",\\"https://gotosocial.org/ns#LikeApproval\\",\\"https://gotosocial.org/ns#ReplyAuthorization\\",\\"https://w3id.org/valueflows/ont/vf#Proposal\\",\\"https://www.w3.org/ns/activitystreams#Activity\\",\\"http://litepub.social/ns#EmojiReact\\",\\"https://gotosocial.org/ns#AnnounceRequest\\",\\"https://gotosocial.org/ns#LikeRequest\\",\\"https://gotosocial.org/ns#ReplyRequest\\",\\"https://www.w3.org/ns/activitystreams#Accept\\",\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\",\\"https://www.w3.org/ns/activitystreams#Add\\",\\"https://www.w3.org/ns/activitystreams#Announce\\",\\"https://www.w3.org/ns/activitystreams#Create\\",\\"https://www.w3.org/ns/activitystreams#Delete\\",\\"https://www.w3.org/ns/activitystreams#Dislike\\",\\"https://www.w3.org/ns/activitystreams#Flag\\",\\"https://www.w3.org/ns/activitystreams#Follow\\",\\"https://www.w3.org/ns/activitystreams#Ignore\\",\\"https://www.w3.org/ns/activitystreams#Block\\",\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\",\\"https://www.w3.org/ns/activitystreams#Arrive\\",\\"https://www.w3.org/ns/activitystreams#Question\\",\\"https://www.w3.org/ns/activitystreams#Travel\\",\\"https://www.w3.org/ns/activitystreams#Join\\",\\"https://www.w3.org/ns/activitystreams#Leave\\",\\"https://www.w3.org/ns/activitystreams#Like\\",\\"https://www.w3.org/ns/activitystreams#Listen\\",\\"https://www.w3.org/ns/activitystreams#Move\\",\\"https://www.w3.org/ns/activitystreams#Offer\\",\\"https://www.w3.org/ns/activitystreams#Invite\\",\\"https://www.w3.org/ns/activitystreams#Read\\",\\"https://www.w3.org/ns/activitystreams#Reject\\",\\"https://www.w3.org/ns/activitystreams#TentativeReject\\",\\"https://www.w3.org/ns/activitystreams#Remove\\",\\"https://www.w3.org/ns/activitystreams#Undo\\",\\"https://www.w3.org/ns/activitystreams#Update\\",\\"https://www.w3.org/ns/activitystreams#View\\",\\"https://www.w3.org/ns/activitystreams#Application\\",\\"https://www.w3.org/ns/activitystreams#Article\\",\\"https://www.w3.org/ns/activitystreams#Collection\\",\\"https://www.w3.org/ns/activitystreams#CollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\",\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\",\\"https://www.w3.org/ns/activitystreams#Document\\",\\"https://www.w3.org/ns/activitystreams#Audio\\",\\"https://www.w3.org/ns/activitystreams#Image\\",\\"https://www.w3.org/ns/activitystreams#Page\\",\\"https://www.w3.org/ns/activitystreams#Video\\",\\"https://www.w3.org/ns/activitystreams#Event\\",\\"https://www.w3.org/ns/activitystreams#Group\\",\\"https://www.w3.org/ns/activitystreams#Note\\",\\"https://www.w3.org/ns/activitystreams#Organization\\",\\"https://www.w3.org/ns/activitystreams#Person\\",\\"https://www.w3.org/ns/activitystreams#Place\\",\\"https://www.w3.org/ns/activitystreams#Profile\\",\\"https://www.w3.org/ns/activitystreams#Relationship\\",\\"https://www.w3.org/ns/activitystreams#Service\\",\\"https://www.w3.org/ns/activitystreams#Tombstone\\"].some(
|
|
59145
61434
|
t => v[\\"@type\\"].includes(t)) ? await Object.fromJsonLd(
|
|
59146
61435
|
v,
|
|
59147
61436
|
{ ...options, baseUrl: (values[\\"@id\\"] == null ? options.baseUrl : new URL(values[\\"@id\\"])) }
|