Skip to content

Commit debde3b

Browse files
committed
as:alsoKnownAsalsoKnownAs
1 parent eb573c5 commit debde3b

File tree

9 files changed

+84
-15
lines changed

9 files changed

+84
-15
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Version 1.0.4
88

99
To be released.
1010

11+
- Fixed a bug where `Actor.aliasId` and `Actor.aliasIds` properties had been
12+
represented as `as:alsoKnownAs` property instead of `alsoKnownAs` property
13+
in compacted JSON-LD objects.
14+
1115

1216
Version 1.0.3
1317
-------------

src/codegen/__snapshots__/class.test.ts.snap

+10-10
Large diffs are not rendered by default.

src/federation/handler.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ test("handleActor()", async () => {
185185
"https://www.w3.org/ns/did/v1",
186186
"https://w3id.org/security/multikey/v1",
187187
{
188+
alsoKnownAs: {
189+
"@id": "as:alsoKnownAs",
190+
"@type": "@id",
191+
},
188192
manuallyApprovesFollowers: "as:manuallyApprovesFollowers",
189193
featured: {
190194
"@id": "toot:featured",
@@ -281,6 +285,10 @@ test("handleActor()", async () => {
281285
"https://www.w3.org/ns/did/v1",
282286
"https://w3id.org/security/multikey/v1",
283287
{
288+
alsoKnownAs: {
289+
"@id": "as:alsoKnownAs",
290+
"@type": "@id",
291+
},
284292
manuallyApprovesFollowers: "as:manuallyApprovesFollowers",
285293
featured: {
286294
"@id": "toot:featured",

src/vocab/application.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ defaultContext:
1111
- "https://w3id.org/security/data-integrity/v1"
1212
- "https://www.w3.org/ns/did/v1"
1313
- "https://w3id.org/security/multikey/v1"
14-
- manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
14+
- alsoKnownAs:
15+
"@id": "as:alsoKnownAs"
16+
"@type": "@id"
17+
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
1518
toot: "http://joinmastodon.org/ns#"
1619
featured:
1720
"@id": "toot:featured"

src/vocab/group.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ defaultContext:
1111
- "https://w3id.org/security/data-integrity/v1"
1212
- "https://www.w3.org/ns/did/v1"
1313
- "https://w3id.org/security/multikey/v1"
14-
- manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
14+
- alsoKnownAs:
15+
"@id": "as:alsoKnownAs"
16+
"@type": "@id"
17+
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
1518
toot: "http://joinmastodon.org/ns#"
1619
featured:
1720
"@id": "toot:featured"

src/vocab/organization.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ defaultContext:
1111
- "https://w3id.org/security/data-integrity/v1"
1212
- "https://www.w3.org/ns/did/v1"
1313
- "https://w3id.org/security/multikey/v1"
14-
- manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
14+
- alsoKnownAs:
15+
"@id": "as:alsoKnownAs"
16+
"@type": "@id"
17+
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
1518
toot: "http://joinmastodon.org/ns#"
1619
featured:
1720
"@id": "toot:featured"

src/vocab/person.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ defaultContext:
1111
- "https://w3id.org/security/data-integrity/v1"
1212
- "https://www.w3.org/ns/did/v1"
1313
- "https://w3id.org/security/multikey/v1"
14-
- manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
14+
- alsoKnownAs:
15+
"@id": "as:alsoKnownAs"
16+
"@type": "@id"
17+
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
1518
toot: "http://joinmastodon.org/ns#"
1619
featured:
1720
"@id": "toot:featured"

src/vocab/service.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ defaultContext:
1111
- "https://w3id.org/security/data-integrity/v1"
1212
- "https://www.w3.org/ns/did/v1"
1313
- "https://w3id.org/security/multikey/v1"
14-
- manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
14+
- alsoKnownAs:
15+
"@id": "as:alsoKnownAs"
16+
"@type": "@id"
17+
manuallyApprovesFollowers: "as:manuallyApprovesFollowers"
1518
toot: "http://joinmastodon.org/ns#"
1619
featured:
1720
"@id": "toot:featured"

src/vocab/vocab.test.ts

+42
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,48 @@ test("Person.fromJsonLd()", async () => {
522522
);
523523
});
524524

525+
test("Person.toJsonLd()", async () => {
526+
const person = new Person({
527+
aliases: [new URL("https://example.com/alias")],
528+
});
529+
assertEquals(await person.toJsonLd(), {
530+
"@context": [
531+
"https://www.w3.org/ns/activitystreams",
532+
"https://w3id.org/security/v1",
533+
"https://w3id.org/security/data-integrity/v1",
534+
"https://www.w3.org/ns/did/v1",
535+
"https://w3id.org/security/multikey/v1",
536+
{
537+
PropertyValue: "schema:PropertyValue",
538+
alsoKnownAs: {
539+
"@id": "as:alsoKnownAs",
540+
"@type": "@id",
541+
},
542+
discoverable: "toot:discoverable",
543+
featured: {
544+
"@id": "toot:featured",
545+
"@type": "@id",
546+
},
547+
featuredTags: {
548+
"@id": "toot:featuredTags",
549+
"@type": "@id",
550+
},
551+
indexable: "toot:indexable",
552+
isCat: "misskey:isCat",
553+
manuallyApprovesFollowers: "as:manuallyApprovesFollowers",
554+
memorial: "toot:memorial",
555+
misskey: "https://misskey-hub.net/ns#",
556+
schema: "http://schema.org#",
557+
suspended: "toot:suspended",
558+
toot: "http://joinmastodon.org/ns#",
559+
value: "schema:value",
560+
},
561+
],
562+
alsoKnownAs: "https://example.com/alias",
563+
type: "Person",
564+
});
565+
});
566+
525567
test("Note.quoteUrl", async () => {
526568
const note = new Note({
527569
quoteUrl: new URL("https://example.com/object"),

0 commit comments

Comments
 (0)