Skip to content

Commit

Permalink
Emoji class
Browse files Browse the repository at this point in the history
Close #48
  • Loading branch information
dahlia committed May 7, 2024
1 parent c64cc70 commit 738f84b
Show file tree
Hide file tree
Showing 10 changed files with 1,500 additions and 1,174 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ To be released.

- Added `Hashtag` class to Activity Vocabulary API. [[#48]]

- Added `Emoji` class to Activity Vocabulary API. [[#48]]

- Added more log messages using the [LogTape] library. Currently the below
logger categories are used:

Expand Down
2,536 changes: 1,367 additions & 1,169 deletions codegen/__snapshots__/class.test.ts.snap

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions federation/handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,10 @@ Deno.test("handleObject()", async () => {
"@context": [
"https://www.w3.org/ns/activitystreams",
{
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
},
],
id: "https://example.com/users/someone/notes/123",
Expand Down Expand Up @@ -489,8 +491,10 @@ Deno.test("handleObject()", async () => {
"@context": [
"https://www.w3.org/ns/activitystreams",
{
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
},
],
id: "https://example.com/users/someone/notes/123",
Expand Down Expand Up @@ -865,8 +869,10 @@ Deno.test("respondWithObject()", async () => {
"@context": [
"https://www.w3.org/ns/activitystreams",
{
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
},
],
id: "https://example.com/notes/1",
Expand Down Expand Up @@ -897,8 +903,10 @@ Deno.test("respondWithObjectIfAcceptable", async () => {
"@context": [
"https://www.w3.org/ns/activitystreams",
{
Emoji: "toot:Emoji",
Hashtag: "as:Hashtag",
sensitive: "as:sensitive",
toot: "http://joinmastodon.org/ns#",
},
],
id: "https://example.com/notes/1",
Expand Down
97 changes: 97 additions & 0 deletions vocab/__snapshots__/vocab.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,102 @@
export const snapshot = {};

snapshot[`Deno.inspect(Emoji) [auto] 1`] = `
'Emoji {
id: URL "https://example.com/",
attachments: [ Object {}, Link {}, PropertyValue {} ],
attributions: [ Application {}, Group {}, Organization {}, Person {}, Service {} ],
audience: Object {},
contents: [ "hello", <en> "hello" ],
contexts: [ Object {}, Link {} ],
names: [ "hello", <en> "hello" ],
endTime: 2024-03-03T08:30:06.796196096Z,
generators: [ Object {}, Link {} ],
icon: Image {},
image: Image {},
replyTargets: [ Object {}, Link {} ],
locations: [ Object {}, Link {} ],
previews: [ Link {}, Object {} ],
published: 2024-03-03T08:30:06.796196096Z,
replies: Collection {},
startTime: 2024-03-03T08:30:06.796196096Z,
summaries: [ "hello", <en> "hello" ],
tags: [ Object {}, Link {} ],
updated: 2024-03-03T08:30:06.796196096Z,
urls: [ URL "https://example.com/", Link {} ],
to: Object {},
bto: Object {},
cc: Object {},
bcc: Object {},
mediaType: "hello",
duration: PT1H,
sensitive: true
}'
`;

snapshot[`Deno.inspect(Emoji) [auto] 2`] = `
'Emoji {
attachments: [ URL "https://example.com/" ],
attribution: URL "https://example.com/",
audience: URL "https://example.com/",
contents: [ "hello", <en> "hello" ],
contexts: [ URL "https://example.com/" ],
names: [ "hello", <en> "hello" ],
endTime: 2024-03-03T08:30:06.796196096Z,
generators: [ URL "https://example.com/" ],
icon: URL "https://example.com/",
image: URL "https://example.com/",
replyTarget: URL "https://example.com/",
location: URL "https://example.com/",
preview: URL "https://example.com/",
published: 2024-03-03T08:30:06.796196096Z,
replies: URL "https://example.com/",
startTime: 2024-03-03T08:30:06.796196096Z,
summaries: [ "hello", <en> "hello" ],
tags: [ URL "https://example.com/" ],
updated: 2024-03-03T08:30:06.796196096Z,
urls: [ URL "https://example.com/", Link {} ],
to: URL "https://example.com/",
bto: URL "https://example.com/",
cc: URL "https://example.com/",
bcc: URL "https://example.com/",
mediaType: "hello",
duration: PT1H,
sensitive: true
}'
`;

snapshot[`Deno.inspect(Emoji) [auto] 3`] = `
'Emoji {
attachments: [ Object {}, Object {} ],
attributions: [ Application {}, Application {} ],
audiences: [ Object {}, Object {} ],
contents: [ "hello", "hello" ],
contexts: [ Object {}, Object {} ],
names: [ "hello", "hello" ],
endTime: 2024-03-03T08:30:06.796196096Z,
generators: [ Object {}, Object {} ],
icons: [ Image {}, Image {} ],
images: [ Image {}, Image {} ],
replyTargets: [ Object {}, Object {} ],
locations: [ Object {}, Object {} ],
previews: [ Link {}, Link {} ],
published: 2024-03-03T08:30:06.796196096Z,
replies: Collection {},
startTime: 2024-03-03T08:30:06.796196096Z,
summaries: [ "hello", "hello" ],
tags: [ Object {}, Object {} ],
updated: 2024-03-03T08:30:06.796196096Z,
urls: [ URL "https://example.com/", URL "https://example.com/" ],
tos: [ Object {}, Object {} ],
btos: [ Object {}, Object {} ],
ccs: [ Object {}, Object {} ],
bccs: [ Object {}, Object {} ],
mediaType: "hello",
duration: PT1H,
sensitive: true
}'
`;

snapshot[`Deno.inspect(PropertyValue) [auto] 1`] = `'PropertyValue { id: URL "https://example.com/", name: "hello", value: "hello" }'`;

snapshot[`Deno.inspect(PropertyValue) [auto] 2`] = `'PropertyValue { name: "hello", value: "hello" }'`;
Expand Down
4 changes: 3 additions & 1 deletion vocab/announce.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ description: |
The `origin` typically has no defined meaning.
defaultContext:
- "https://www.w3.org/ns/activitystreams"
- sensitive: "as:sensitive"
- toot: "http://joinmastodon.org/ns#"
sensitive: "as:sensitive"
Emoji: "toot:Emoji"
Hashtag: "as:Hashtag"
properties: []
4 changes: 3 additions & 1 deletion vocab/article.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ entity: true
description: Represents any kind of multi-paragraph written work.
defaultContext:
- "https://www.w3.org/ns/activitystreams"
- sensitive: "as:sensitive"
- toot: "http://joinmastodon.org/ns#"
sensitive: "as:sensitive"
Emoji: "toot:Emoji"
Hashtag: "as:Hashtag"
properties: []
4 changes: 3 additions & 1 deletion vocab/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ entity: true
description: Indicates that the `actor` has created the `object`.
defaultContext:
- "https://www.w3.org/ns/activitystreams"
- sensitive: "as:sensitive"
- toot: "http://joinmastodon.org/ns#"
sensitive: "as:sensitive"
Emoji: "toot:Emoji"
Hashtag: "as:Hashtag"
properties: []
11 changes: 11 additions & 0 deletions vocab/emoji.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$schema: ../codegen/schema.yaml
name: Emoji
uri: "http://joinmastodon.org/ns#Emoji"
extends: "https://www.w3.org/ns/activitystreams#Object"
entity: true
description: Represents a custom emoji.
defaultContext:
- "https://www.w3.org/ns/activitystreams"
- toot: "http://joinmastodon.org/ns#"
Emoji: "toot:Emoji"
properties: []
4 changes: 3 additions & 1 deletion vocab/note.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ description: |
length.
defaultContext:
- "https://www.w3.org/ns/activitystreams"
- sensitive: "as:sensitive"
- toot: "http://joinmastodon.org/ns#"
sensitive: "as:sensitive"
Emoji: "toot:Emoji"
Hashtag: "as:Hashtag"
properties: []
4 changes: 3 additions & 1 deletion vocab/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ description: |
The `target` and `origin` typically have no defined meaning.
defaultContext:
- "https://www.w3.org/ns/activitystreams"
- sensitive: "as:sensitive"
- toot: "http://joinmastodon.org/ns#"
sensitive: "as:sensitive"
Emoji: "toot:Emoji"
Hashtag: "as:Hashtag"
properties: []

0 comments on commit 738f84b

Please sign in to comment.