@llun/activities.schema 0.2.34 → 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/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 +2 -2
- 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
|
@@ -12,25 +12,19 @@ import { Mention } from "./mention.js";
|
|
|
12
12
|
import { Tag } from "./tag.js";
|
|
13
13
|
|
|
14
14
|
export const BaseStatus = z.object({
|
|
15
|
-
id: z.string(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
uri: z.string({
|
|
20
|
-
description: "URI of the status used for federation",
|
|
21
|
-
}),
|
|
15
|
+
id: z.string().describe(
|
|
16
|
+
"ID of the status in the database, for Mastodon, it is numeric casting to string. For Activities.next, this is equal to status URI"
|
|
17
|
+
),
|
|
18
|
+
uri: z.string().describe("URI of the status used for federation"),
|
|
22
19
|
|
|
23
20
|
account: Account.describe("The actor that authored the status"),
|
|
24
21
|
|
|
25
|
-
content: z.string(
|
|
22
|
+
content: z.string().describe("HTML-encoded status content"),
|
|
26
23
|
visibility: Visibility.describe("Visibility of this status"),
|
|
27
|
-
sensitive: z.boolean(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
description:
|
|
32
|
-
"Subject or summary line, below which status content is collapsed until expanded",
|
|
33
|
-
}),
|
|
24
|
+
sensitive: z.boolean().describe("Is this status marked as sensitive content?"),
|
|
25
|
+
spoiler_text: z.string().describe(
|
|
26
|
+
"Subject or summary line, below which status content is collapsed until expanded"
|
|
27
|
+
),
|
|
34
28
|
|
|
35
29
|
media_attachments: MediaAttachment.array(),
|
|
36
30
|
application: Application.optional(),
|
|
@@ -43,26 +37,21 @@ export const BaseStatus = z.object({
|
|
|
43
37
|
),
|
|
44
38
|
tags: Tag.array().describe("Hashtags used within the status content"),
|
|
45
39
|
|
|
46
|
-
reblogs_count: z.number(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
favourites_count: z.number({
|
|
50
|
-
description: "How many favourites this status has received",
|
|
51
|
-
}),
|
|
52
|
-
replies_count: z.number({
|
|
53
|
-
description: "How many replies this status has received",
|
|
54
|
-
}),
|
|
40
|
+
reblogs_count: z.number().describe("How many boosts this status has received"),
|
|
41
|
+
favourites_count: z.number().describe("How many favourites this status has received"),
|
|
42
|
+
replies_count: z.number().describe("How many replies this status has received"),
|
|
55
43
|
|
|
56
44
|
url: z
|
|
57
|
-
.string(
|
|
45
|
+
.string()
|
|
46
|
+
.describe("A link to the status's HTML representation")
|
|
58
47
|
.nullable(),
|
|
59
48
|
in_reply_to_id: z
|
|
60
|
-
.string(
|
|
49
|
+
.string()
|
|
50
|
+
.describe("ID of the status being replied to")
|
|
61
51
|
.nullable(),
|
|
62
52
|
in_reply_to_account_id: z
|
|
63
|
-
.string(
|
|
64
|
-
|
|
65
|
-
})
|
|
53
|
+
.string()
|
|
54
|
+
.describe("ID of the actor that authored the status being replied to")
|
|
66
55
|
.nullable(),
|
|
67
56
|
|
|
68
57
|
poll: Poll.nullable().describe("The poll attached to the status"),
|
|
@@ -71,59 +60,58 @@ export const BaseStatus = z.object({
|
|
|
71
60
|
),
|
|
72
61
|
|
|
73
62
|
language: z
|
|
74
|
-
.string(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
.string()
|
|
64
|
+
.describe(
|
|
65
|
+
"Primary language of this status in ISO 639 Part 1 two-letter language code"
|
|
66
|
+
)
|
|
78
67
|
.nullable(),
|
|
79
68
|
|
|
80
69
|
text: z
|
|
81
|
-
.string(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
.string()
|
|
71
|
+
.describe(
|
|
72
|
+
"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"
|
|
73
|
+
)
|
|
85
74
|
.nullable(),
|
|
86
75
|
|
|
87
|
-
created_at: z.string(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}),
|
|
76
|
+
created_at: z.string().describe(
|
|
77
|
+
"The date when this status was created in ISO 8601 Datetime format"
|
|
78
|
+
),
|
|
91
79
|
edited_at: z
|
|
92
|
-
.string(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
80
|
+
.string()
|
|
81
|
+
.describe(
|
|
82
|
+
"Timestamp of when the status was last edited in ISO 8601 Datetime format"
|
|
83
|
+
)
|
|
96
84
|
.nullable(),
|
|
97
85
|
|
|
98
86
|
favourited: z
|
|
99
|
-
.boolean(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
87
|
+
.boolean()
|
|
88
|
+
.describe(
|
|
89
|
+
"If the current token has an authorized user: Have you favourited this status?"
|
|
90
|
+
)
|
|
103
91
|
.optional(),
|
|
104
92
|
reblogged: z
|
|
105
|
-
.boolean(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
.boolean()
|
|
94
|
+
.describe(
|
|
95
|
+
"If the current token has an authorized user: Have you boosted this status?"
|
|
96
|
+
)
|
|
109
97
|
.optional(),
|
|
110
98
|
muted: z
|
|
111
|
-
.boolean(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
99
|
+
.boolean()
|
|
100
|
+
.describe(
|
|
101
|
+
"If the current token has an authorized user: Have you muted notifications for this status's conversation?"
|
|
102
|
+
)
|
|
115
103
|
.optional(),
|
|
116
104
|
bookmarked: z
|
|
117
|
-
.boolean(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
.boolean()
|
|
106
|
+
.describe(
|
|
107
|
+
"If the current token has an authorized user: Have you bookmarked this status?"
|
|
108
|
+
)
|
|
121
109
|
.optional(),
|
|
122
110
|
pinned: z
|
|
123
|
-
.boolean(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
111
|
+
.boolean()
|
|
112
|
+
.describe(
|
|
113
|
+
"If the current token has an authorized user: Have you pinned this status? Only appears if the status is pinnable"
|
|
114
|
+
)
|
|
127
115
|
.optional(),
|
|
128
116
|
filtered: FilterResult.optional().describe(
|
|
129
117
|
"If the current token has an authorized user: The filter and keywords that matched this status"
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
export const Mention = z.object({
|
|
5
|
-
id: z.string(
|
|
6
|
-
username: z.string(
|
|
7
|
-
url: z.string(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
description:
|
|
12
|
-
"The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users",
|
|
13
|
-
}),
|
|
5
|
+
id: z.string().describe("The actor ID of the mentioned user"),
|
|
6
|
+
username: z.string().describe("The username of the mentioned user"),
|
|
7
|
+
url: z.string().describe("The location of the mentioned user's profile"),
|
|
8
|
+
acct: z.string().describe(
|
|
9
|
+
"The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users"
|
|
10
|
+
),
|
|
14
11
|
});
|
|
15
12
|
export type Mention = z.infer<typeof Mention>;
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
export const Tag = z.object({
|
|
5
|
-
name: z.string(
|
|
6
|
-
|
|
7
|
-
}),
|
|
8
|
-
url: z.string({
|
|
9
|
-
description: "A link to the hashtag on the instance",
|
|
10
|
-
}),
|
|
5
|
+
name: z.string().describe("The value of the hashtag after the `#` sign"),
|
|
6
|
+
url: z.string().describe("A link to the hashtag on the instance"),
|
|
11
7
|
});
|
|
12
8
|
export type Tag = z.infer<typeof Tag>;
|
package/src/note/baseContent.ts
CHANGED
|
@@ -6,34 +6,34 @@ import { Collection } from "../collection.js";
|
|
|
6
6
|
export const BaseContent = z.object({
|
|
7
7
|
id: z.string(),
|
|
8
8
|
url: z
|
|
9
|
-
.string(
|
|
9
|
+
.string().describe("Note URL. This is optional for Pleloma")
|
|
10
10
|
.nullish(),
|
|
11
|
-
attributedTo: z.string(
|
|
11
|
+
attributedTo: z.string().describe("Note publisher"),
|
|
12
12
|
|
|
13
13
|
to: z.union([z.string(), z.string().array()]),
|
|
14
14
|
cc: z.union([z.string(), z.string().array()]),
|
|
15
15
|
|
|
16
16
|
inReplyTo: z.string().nullish(),
|
|
17
17
|
|
|
18
|
-
summary: z.string(
|
|
18
|
+
summary: z.string().describe("Note short summary").nullish(),
|
|
19
19
|
summaryMap: z
|
|
20
|
-
.record(z.string(),
|
|
20
|
+
.record(z.string(), z.string()).describe("Note short summary in each locale")
|
|
21
21
|
.nullish(),
|
|
22
22
|
|
|
23
23
|
content: z
|
|
24
24
|
.union([
|
|
25
|
-
z.string(
|
|
26
|
-
z.string(
|
|
25
|
+
z.string().describe("Note content"),
|
|
26
|
+
z.string().describe("Note content in array from Wordpress").array(),
|
|
27
27
|
])
|
|
28
28
|
.nullish(),
|
|
29
29
|
contentMap: z
|
|
30
30
|
.union([
|
|
31
|
-
z.record(z.string(),
|
|
31
|
+
z.record(z.string(), z.string()).describe("Note content in each locale"),
|
|
32
32
|
z
|
|
33
|
-
.string(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
.string()
|
|
34
|
+
.describe(
|
|
35
|
+
"Some activity pub server use content map as array with content in the first element"
|
|
36
|
+
)
|
|
37
37
|
.array(),
|
|
38
38
|
])
|
|
39
39
|
.nullish(),
|
|
@@ -42,8 +42,8 @@ export const BaseContent = z.object({
|
|
|
42
42
|
attachment: z.union([Attachment, Attachment.array()]).nullish(),
|
|
43
43
|
tag: z.union([Tag, Tag.array()]),
|
|
44
44
|
|
|
45
|
-
published: z.string(
|
|
46
|
-
updated: z.string(
|
|
45
|
+
published: z.string().describe("Object published datetime"),
|
|
46
|
+
updated: z.string().describe("Object updated datetime").nullish(),
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
export type BaseContent = z.infer<typeof BaseContent>;
|
package/src/question.ts
CHANGED
|
@@ -6,7 +6,7 @@ export const ENTITY_TYPE_QUESTION = "Question";
|
|
|
6
6
|
export const Question = BaseContent.extend({
|
|
7
7
|
type: z.literal(ENTITY_TYPE_QUESTION),
|
|
8
8
|
|
|
9
|
-
endTime: z.string(
|
|
9
|
+
endTime: z.string().describe("Question end time"),
|
|
10
10
|
oneOf: Note.array(),
|
|
11
11
|
});
|
|
12
12
|
export type Question = z.infer<typeof Question>;
|