@llun/activities.schema 0.2.33 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +22 -0
- package/.yarn/install-state.gz +0 -0
- package/CLAUDE.md +46 -0
- package/dist/cjs/announce.js +1 -1
- package/dist/cjs/mastodon/account/field.js +4 -9
- package/dist/cjs/mastodon/account/source.js +4 -12
- package/dist/cjs/mastodon/account.js +27 -66
- package/dist/cjs/mastodon/customEmoji.js +6 -15
- package/dist/cjs/mastodon/filter/index.js +4 -7
- package/dist/cjs/mastodon/filter/keyword.js +3 -5
- package/dist/cjs/mastodon/filter/status.js +2 -4
- package/dist/cjs/mastodon/mediaAttachment/base.js +10 -18
- package/dist/cjs/mastodon/mediaAttachment/gifv.js +2 -6
- package/dist/cjs/mastodon/mediaAttachment/video.js +2 -6
- package/dist/cjs/mastodon/poll/index.js +9 -11
- package/dist/cjs/mastodon/poll/option.js +3 -4
- package/dist/cjs/mastodon/previewCard.js +15 -28
- package/dist/cjs/mastodon/status/application.js +3 -6
- package/dist/cjs/mastodon/status/base.js +31 -54
- package/dist/cjs/mastodon/status/mention.js +4 -8
- package/dist/cjs/mastodon/status/tag.js +2 -6
- package/dist/cjs/note/baseContent.js +11 -12
- package/dist/cjs/question.js +1 -1
- package/dist/esm/announce.js +1 -1
- package/dist/esm/mastodon/account/field.js +4 -9
- package/dist/esm/mastodon/account/source.js +4 -12
- package/dist/esm/mastodon/account.js +27 -66
- package/dist/esm/mastodon/customEmoji.js +6 -15
- package/dist/esm/mastodon/filter/index.js +4 -7
- package/dist/esm/mastodon/filter/keyword.js +3 -5
- package/dist/esm/mastodon/filter/status.js +2 -4
- package/dist/esm/mastodon/mediaAttachment/base.js +10 -18
- package/dist/esm/mastodon/mediaAttachment/gifv.js +2 -6
- package/dist/esm/mastodon/mediaAttachment/video.js +2 -6
- package/dist/esm/mastodon/poll/index.js +9 -11
- package/dist/esm/mastodon/poll/option.js +3 -4
- package/dist/esm/mastodon/previewCard.js +15 -28
- package/dist/esm/mastodon/status/application.js +3 -6
- package/dist/esm/mastodon/status/base.js +31 -54
- package/dist/esm/mastodon/status/mention.js +4 -8
- package/dist/esm/mastodon/status/tag.js +2 -6
- package/dist/esm/note/baseContent.js +11 -12
- package/dist/esm/question.js +1 -1
- package/dist/types/accept.d.ts +2 -32
- package/dist/types/actor.d.ts +18 -288
- package/dist/types/announce.d.ts +3 -19
- package/dist/types/collection.d.ts +11 -87
- package/dist/types/follow.d.ts +1 -11
- package/dist/types/image.d.ts +1 -9
- package/dist/types/like.d.ts +27 -576
- package/dist/types/mastodon/account/field.d.ts +1 -9
- package/dist/types/mastodon/account/relationship.d.ts +2 -34
- package/dist/types/mastodon/account/source.d.ts +8 -33
- package/dist/types/mastodon/account.d.ts +22 -397
- package/dist/types/mastodon/customEmoji.d.ts +1 -13
- package/dist/types/mastodon/filter/index.d.ts +14 -49
- package/dist/types/mastodon/filter/keyword.d.ts +1 -9
- package/dist/types/mastodon/filter/status.d.ts +1 -7
- package/dist/types/mastodon/filterResult.d.ts +17 -90
- package/dist/types/mastodon/mediaAttachment/audio.d.ts +3 -68
- package/dist/types/mastodon/mediaAttachment/base.d.ts +1 -15
- package/dist/types/mastodon/mediaAttachment/gifv.d.ts +4 -129
- package/dist/types/mastodon/mediaAttachment/image.d.ts +5 -118
- package/dist/types/mastodon/mediaAttachment/index.d.ts +35 -949
- package/dist/types/mastodon/mediaAttachment/unknown.d.ts +1 -18
- package/dist/types/mastodon/mediaAttachment/video.d.ts +4 -141
- package/dist/types/mastodon/poll/index.d.ts +4 -62
- package/dist/types/mastodon/poll/option.d.ts +1 -7
- package/dist/types/mastodon/previewCard.d.ts +7 -32
- package/dist/types/mastodon/status/application.d.ts +1 -7
- package/dist/types/mastodon/status/base.d.ts +79 -1722
- package/dist/types/mastodon/status/index.d.ts +158 -4073
- package/dist/types/mastodon/status/mention.d.ts +1 -11
- package/dist/types/mastodon/status/tag.d.ts +1 -7
- package/dist/types/mastodon/visibility.d.ts +6 -1
- package/dist/types/note/attachment.d.ts +3 -29
- package/dist/types/note/baseContent.d.ts +25 -379
- package/dist/types/note/document.d.ts +1 -19
- package/dist/types/note/emoji.d.ts +2 -28
- package/dist/types/note/hashtag.d.ts +1 -9
- package/dist/types/note/mention.d.ts +1 -9
- package/dist/types/note/propertyValue.d.ts +1 -9
- package/dist/types/note/tag.d.ts +5 -47
- package/dist/types/note.d.ts +25 -382
- package/dist/types/question/note.d.ts +2 -22
- package/dist/types/question.d.ts +27 -422
- package/dist/types/reject.d.ts +2 -32
- package/dist/types/tombstone.d.ts +1 -7
- package/dist/types/undo.d.ts +30 -801
- package/package.json +3 -3
- package/src/announce.ts +1 -1
- package/src/mastodon/account/field.ts +6 -10
- package/src/mastodon/account/source.ts +4 -12
- package/src/mastodon/account.ts +71 -78
- package/src/mastodon/customEmoji.ts +8 -16
- package/src/mastodon/filter/index.ts +6 -8
- package/src/mastodon/filter/keyword.ts +5 -6
- package/src/mastodon/filter/status.ts +2 -4
- package/src/mastodon/mediaAttachment/base.ts +16 -21
- package/src/mastodon/mediaAttachment/gifv.ts +2 -6
- package/src/mastodon/mediaAttachment/video.ts +2 -6
- package/src/mastodon/poll/index.ts +13 -13
- package/src/mastodon/poll/option.ts +5 -5
- package/src/mastodon/previewCard.ts +17 -29
- package/src/mastodon/status/application.ts +5 -7
- package/src/mastodon/status/base.ts +53 -65
- package/src/mastodon/status/mention.ts +6 -9
- package/src/mastodon/status/tag.ts +2 -6
- package/src/note/baseContent.ts +13 -13
- package/src/question.ts +1 -1
|
@@ -1,34 +1,21 @@
|
|
|
1
1
|
// This schema is base on https://docs.joinmastodon.org/entities/PreviewCard/
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export const PreviewCard = z.object({
|
|
4
|
-
url: z.string(
|
|
5
|
-
title: z.string(
|
|
6
|
-
description: z.string(
|
|
7
|
-
type: z.enum(["link", "photo", "video", "rich"],
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
provider_url: z.string({
|
|
18
|
-
description: "A link to the provider of the original resource",
|
|
19
|
-
}),
|
|
20
|
-
html: z.string({
|
|
21
|
-
description: "HTML to be used for generating the preview card",
|
|
22
|
-
}),
|
|
23
|
-
width: z.number({ description: "Width of preview, in pixels" }),
|
|
24
|
-
height: z.number({ description: "Height of preview, in pixels" }),
|
|
25
|
-
image: z.string({ description: "Preview thumbnail url" }).nullable(),
|
|
26
|
-
embed_url: z.string({
|
|
27
|
-
description: "Used for photo embeds, instead of custom html",
|
|
28
|
-
}),
|
|
4
|
+
url: z.string().describe("Location of linked resource"),
|
|
5
|
+
title: z.string().describe("Title of linked resource"),
|
|
6
|
+
description: z.string().describe("Description of preview"),
|
|
7
|
+
type: z.enum(["link", "photo", "video", "rich"]).describe("The type of the preview card"),
|
|
8
|
+
author_name: z.string().describe("The author of the original resource"),
|
|
9
|
+
author_url: z.string().describe("A link to the author of the original resource"),
|
|
10
|
+
provider_name: z.string().describe("The provider of the original resource"),
|
|
11
|
+
provider_url: z.string().describe("A link to the provider of the original resource"),
|
|
12
|
+
html: z.string().describe("HTML to be used for generating the preview card"),
|
|
13
|
+
width: z.number().describe("Width of preview, in pixels"),
|
|
14
|
+
height: z.number().describe("Height of preview, in pixels"),
|
|
15
|
+
image: z.string().describe("Preview thumbnail url").nullable(),
|
|
16
|
+
embed_url: z.string().describe("Used for photo embeds, instead of custom html"),
|
|
29
17
|
blurhash: z
|
|
30
|
-
.string(
|
|
31
|
-
|
|
32
|
-
})
|
|
18
|
+
.string()
|
|
19
|
+
.describe("A hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet")
|
|
33
20
|
.nullable(),
|
|
34
21
|
});
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
// This schema is base on https://docs.joinmastodon.org/entities/Status/#application
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export const Application = z.object({
|
|
4
|
-
name: z.string(
|
|
5
|
-
description: "The name of the application that posted this status",
|
|
6
|
-
}),
|
|
4
|
+
name: z.string().describe("The name of the application that posted this status"),
|
|
7
5
|
website: z
|
|
8
|
-
.string(
|
|
9
|
-
|
|
10
|
-
})
|
|
6
|
+
.string()
|
|
7
|
+
.describe("The website associated with the application that posted this status")
|
|
11
8
|
.nullable(),
|
|
12
9
|
});
|
|
@@ -11,90 +11,67 @@ import { FilterResult } from "../filterResult.js";
|
|
|
11
11
|
import { Mention } from "./mention.js";
|
|
12
12
|
import { Tag } from "./tag.js";
|
|
13
13
|
export const BaseStatus = z.object({
|
|
14
|
-
id: z.string(
|
|
15
|
-
|
|
16
|
-
}),
|
|
17
|
-
uri: z.string({
|
|
18
|
-
description: "URI of the status used for federation",
|
|
19
|
-
}),
|
|
14
|
+
id: z.string().describe("ID of the status in the database, for Mastodon, it is numeric casting to string. For Activities.next, this is equal to status URI"),
|
|
15
|
+
uri: z.string().describe("URI of the status used for federation"),
|
|
20
16
|
account: Account.describe("The actor that authored the status"),
|
|
21
|
-
content: z.string(
|
|
17
|
+
content: z.string().describe("HTML-encoded status content"),
|
|
22
18
|
visibility: Visibility.describe("Visibility of this status"),
|
|
23
|
-
sensitive: z.boolean(
|
|
24
|
-
|
|
25
|
-
}),
|
|
26
|
-
spoiler_text: z.string({
|
|
27
|
-
description: "Subject or summary line, below which status content is collapsed until expanded",
|
|
28
|
-
}),
|
|
19
|
+
sensitive: z.boolean().describe("Is this status marked as sensitive content?"),
|
|
20
|
+
spoiler_text: z.string().describe("Subject or summary line, below which status content is collapsed until expanded"),
|
|
29
21
|
media_attachments: MediaAttachment.array(),
|
|
30
22
|
application: Application.optional(),
|
|
31
23
|
emojis: CustomEmoji.array().describe("Custom emoji to be used when rendering status content"),
|
|
32
24
|
mentions: Mention.array().describe("Mentions of users within the status content"),
|
|
33
25
|
tags: Tag.array().describe("Hashtags used within the status content"),
|
|
34
|
-
reblogs_count: z.number(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
favourites_count: z.number({
|
|
38
|
-
description: "How many favourites this status has received",
|
|
39
|
-
}),
|
|
40
|
-
replies_count: z.number({
|
|
41
|
-
description: "How many replies this status has received",
|
|
42
|
-
}),
|
|
26
|
+
reblogs_count: z.number().describe("How many boosts this status has received"),
|
|
27
|
+
favourites_count: z.number().describe("How many favourites this status has received"),
|
|
28
|
+
replies_count: z.number().describe("How many replies this status has received"),
|
|
43
29
|
url: z
|
|
44
|
-
.string(
|
|
30
|
+
.string()
|
|
31
|
+
.describe("A link to the status's HTML representation")
|
|
45
32
|
.nullable(),
|
|
46
33
|
in_reply_to_id: z
|
|
47
|
-
.string(
|
|
34
|
+
.string()
|
|
35
|
+
.describe("ID of the status being replied to")
|
|
48
36
|
.nullable(),
|
|
49
37
|
in_reply_to_account_id: z
|
|
50
|
-
.string(
|
|
51
|
-
|
|
52
|
-
})
|
|
38
|
+
.string()
|
|
39
|
+
.describe("ID of the actor that authored the status being replied to")
|
|
53
40
|
.nullable(),
|
|
54
41
|
poll: Poll.nullable().describe("The poll attached to the status"),
|
|
55
42
|
card: PreviewCard.nullable().describe("Preview card for links included within status content"),
|
|
56
43
|
language: z
|
|
57
|
-
.string(
|
|
58
|
-
|
|
59
|
-
})
|
|
44
|
+
.string()
|
|
45
|
+
.describe("Primary language of this status in ISO 639 Part 1 two-letter language code")
|
|
60
46
|
.nullable(),
|
|
61
47
|
text: z
|
|
62
|
-
.string(
|
|
63
|
-
|
|
64
|
-
})
|
|
48
|
+
.string()
|
|
49
|
+
.describe("Plain-text source of a status. Returned instead of `content` when status is deleted, so the user may redraft from the source text without the client having to reverse-engineer the original text from the HTML content")
|
|
65
50
|
.nullable(),
|
|
66
|
-
created_at: z.string(
|
|
67
|
-
description: "The date when this status was created in ISO 8601 Datetime format",
|
|
68
|
-
}),
|
|
51
|
+
created_at: z.string().describe("The date when this status was created in ISO 8601 Datetime format"),
|
|
69
52
|
edited_at: z
|
|
70
|
-
.string(
|
|
71
|
-
|
|
72
|
-
})
|
|
53
|
+
.string()
|
|
54
|
+
.describe("Timestamp of when the status was last edited in ISO 8601 Datetime format")
|
|
73
55
|
.nullable(),
|
|
74
56
|
favourited: z
|
|
75
|
-
.boolean(
|
|
76
|
-
|
|
77
|
-
})
|
|
57
|
+
.boolean()
|
|
58
|
+
.describe("If the current token has an authorized user: Have you favourited this status?")
|
|
78
59
|
.optional(),
|
|
79
60
|
reblogged: z
|
|
80
|
-
.boolean(
|
|
81
|
-
|
|
82
|
-
})
|
|
61
|
+
.boolean()
|
|
62
|
+
.describe("If the current token has an authorized user: Have you boosted this status?")
|
|
83
63
|
.optional(),
|
|
84
64
|
muted: z
|
|
85
|
-
.boolean(
|
|
86
|
-
|
|
87
|
-
})
|
|
65
|
+
.boolean()
|
|
66
|
+
.describe("If the current token has an authorized user: Have you muted notifications for this status's conversation?")
|
|
88
67
|
.optional(),
|
|
89
68
|
bookmarked: z
|
|
90
|
-
.boolean(
|
|
91
|
-
|
|
92
|
-
})
|
|
69
|
+
.boolean()
|
|
70
|
+
.describe("If the current token has an authorized user: Have you bookmarked this status?")
|
|
93
71
|
.optional(),
|
|
94
72
|
pinned: z
|
|
95
|
-
.boolean(
|
|
96
|
-
|
|
97
|
-
})
|
|
73
|
+
.boolean()
|
|
74
|
+
.describe("If the current token has an authorized user: Have you pinned this status? Only appears if the status is pinnable")
|
|
98
75
|
.optional(),
|
|
99
76
|
filtered: FilterResult.optional().describe("If the current token has an authorized user: The filter and keywords that matched this status"),
|
|
100
77
|
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
// This schema is base on https://docs.joinmastodon.org/entities/Status/#Mention
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export const Mention = z.object({
|
|
4
|
-
id: z.string(
|
|
5
|
-
username: z.string(
|
|
6
|
-
url: z.string(
|
|
7
|
-
|
|
8
|
-
}),
|
|
9
|
-
acct: z.string({
|
|
10
|
-
description: "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users",
|
|
11
|
-
}),
|
|
4
|
+
id: z.string().describe("The actor ID of the mentioned user"),
|
|
5
|
+
username: z.string().describe("The username of the mentioned user"),
|
|
6
|
+
url: z.string().describe("The location of the mentioned user's profile"),
|
|
7
|
+
acct: z.string().describe("The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users"),
|
|
12
8
|
});
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// This schema is base on https://docs.joinmastodon.org/entities/Status/#Tag
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export const Tag = z.object({
|
|
4
|
-
name: z.string(
|
|
5
|
-
|
|
6
|
-
}),
|
|
7
|
-
url: z.string({
|
|
8
|
-
description: "A link to the hashtag on the instance",
|
|
9
|
-
}),
|
|
4
|
+
name: z.string().describe("The value of the hashtag after the `#` sign"),
|
|
5
|
+
url: z.string().describe("A link to the hashtag on the instance"),
|
|
10
6
|
});
|
|
@@ -5,35 +5,34 @@ import { Collection } from "../collection.js";
|
|
|
5
5
|
export const BaseContent = z.object({
|
|
6
6
|
id: z.string(),
|
|
7
7
|
url: z
|
|
8
|
-
.string(
|
|
8
|
+
.string().describe("Note URL. This is optional for Pleloma")
|
|
9
9
|
.nullish(),
|
|
10
|
-
attributedTo: z.string(
|
|
10
|
+
attributedTo: z.string().describe("Note publisher"),
|
|
11
11
|
to: z.union([z.string(), z.string().array()]),
|
|
12
12
|
cc: z.union([z.string(), z.string().array()]),
|
|
13
13
|
inReplyTo: z.string().nullish(),
|
|
14
|
-
summary: z.string(
|
|
14
|
+
summary: z.string().describe("Note short summary").nullish(),
|
|
15
15
|
summaryMap: z
|
|
16
|
-
.record(z.string(),
|
|
16
|
+
.record(z.string(), z.string()).describe("Note short summary in each locale")
|
|
17
17
|
.nullish(),
|
|
18
18
|
content: z
|
|
19
19
|
.union([
|
|
20
|
-
z.string(
|
|
21
|
-
z.string(
|
|
20
|
+
z.string().describe("Note content"),
|
|
21
|
+
z.string().describe("Note content in array from Wordpress").array(),
|
|
22
22
|
])
|
|
23
23
|
.nullish(),
|
|
24
24
|
contentMap: z
|
|
25
25
|
.union([
|
|
26
|
-
z.record(z.string(),
|
|
26
|
+
z.record(z.string(), z.string()).describe("Note content in each locale"),
|
|
27
27
|
z
|
|
28
|
-
.string(
|
|
29
|
-
|
|
30
|
-
})
|
|
28
|
+
.string()
|
|
29
|
+
.describe("Some activity pub server use content map as array with content in the first element")
|
|
31
30
|
.array(),
|
|
32
31
|
])
|
|
33
32
|
.nullish(),
|
|
34
33
|
replies: Collection.nullish(),
|
|
35
34
|
attachment: z.union([Attachment, Attachment.array()]).nullish(),
|
|
36
35
|
tag: z.union([Tag, Tag.array()]),
|
|
37
|
-
published: z.string(
|
|
38
|
-
updated: z.string(
|
|
36
|
+
published: z.string().describe("Object published datetime"),
|
|
37
|
+
updated: z.string().describe("Object updated datetime").nullish(),
|
|
39
38
|
});
|
package/dist/esm/question.js
CHANGED
|
@@ -4,6 +4,6 @@ import { Note } from "./question/note.js";
|
|
|
4
4
|
export const ENTITY_TYPE_QUESTION = "Question";
|
|
5
5
|
export const Question = BaseContent.extend({
|
|
6
6
|
type: z.literal(ENTITY_TYPE_QUESTION),
|
|
7
|
-
endTime: z.string(
|
|
7
|
+
endTime: z.string().describe("Question end time"),
|
|
8
8
|
oneOf: Note.array(),
|
|
9
9
|
});
|
package/dist/types/accept.d.ts
CHANGED
|
@@ -8,36 +8,6 @@ export declare const Accept: z.ZodObject<{
|
|
|
8
8
|
type: z.ZodLiteral<"Follow">;
|
|
9
9
|
actor: z.ZodString;
|
|
10
10
|
object: z.ZodString;
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
id: string;
|
|
14
|
-
type: "Follow";
|
|
15
|
-
actor: string;
|
|
16
|
-
}, {
|
|
17
|
-
object: string;
|
|
18
|
-
id: string;
|
|
19
|
-
type: "Follow";
|
|
20
|
-
actor: string;
|
|
21
|
-
}>;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
object: {
|
|
24
|
-
object: string;
|
|
25
|
-
id: string;
|
|
26
|
-
type: "Follow";
|
|
27
|
-
actor: string;
|
|
28
|
-
};
|
|
29
|
-
id: string;
|
|
30
|
-
type: "Accept";
|
|
31
|
-
actor: string;
|
|
32
|
-
}, {
|
|
33
|
-
object: {
|
|
34
|
-
object: string;
|
|
35
|
-
id: string;
|
|
36
|
-
type: "Follow";
|
|
37
|
-
actor: string;
|
|
38
|
-
};
|
|
39
|
-
id: string;
|
|
40
|
-
type: "Accept";
|
|
41
|
-
actor: string;
|
|
42
|
-
}>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
}, z.core.$strip>;
|
|
43
13
|
export type Accept = z.infer<typeof Accept>;
|