@llun/activities.schema 0.0.8 → 0.1.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/.yarn/install-state.gz +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/like.d.ts +16 -125
- package/dist/mastodon/account.d.ts +327 -0
- package/dist/mastodon/account.js +87 -0
- package/dist/mastodon/accountField.d.ts +15 -0
- package/dist/mastodon/accountField.js +15 -0
- package/dist/mastodon/customEmoji.d.ts +21 -0
- package/dist/mastodon/customEmoji.js +21 -0
- package/dist/mastodon/filter/index.d.ts +62 -0
- package/dist/mastodon/filter/index.js +24 -0
- package/dist/mastodon/filter/keyword.d.ts +15 -0
- package/dist/mastodon/filter/keyword.js +9 -0
- package/dist/mastodon/filter/status.d.ts +12 -0
- package/dist/mastodon/filter/status.js +8 -0
- package/dist/mastodon/filterResult.d.ts +104 -0
- package/dist/mastodon/filterResult.js +16 -0
- package/dist/mastodon/index.d.ts +3 -0
- package/dist/mastodon/index.js +3 -0
- package/dist/mastodon/mediaAttachment/audio.d.ts +87 -0
- package/dist/mastodon/mediaAttachment/audio.js +17 -0
- package/dist/mastodon/mediaAttachment/base.d.ts +24 -0
- package/dist/mastodon/mediaAttachment/base.js +26 -0
- package/dist/mastodon/mediaAttachment/gifv.d.ts +158 -0
- package/dist/mastodon/mediaAttachment/gifv.js +37 -0
- package/dist/mastodon/mediaAttachment/image.d.ts +142 -0
- package/dist/mastodon/mediaAttachment/image.js +30 -0
- package/dist/mastodon/mediaAttachment/index.d.ts +576 -0
- package/dist/mastodon/mediaAttachment/index.js +8 -0
- package/dist/mastodon/mediaAttachment/unknown.d.ts +28 -0
- package/dist/mastodon/mediaAttachment/unknown.js +8 -0
- package/dist/mastodon/mediaAttachment/video.d.ts +173 -0
- package/dist/mastodon/mediaAttachment/video.js +38 -0
- package/dist/mastodon/poll/index.d.ts +81 -0
- package/dist/mastodon/poll/index.js +27 -0
- package/dist/mastodon/poll/option.d.ts +12 -0
- package/dist/mastodon/poll/option.js +10 -0
- package/dist/mastodon/previewCard.d.ts +48 -0
- package/dist/mastodon/previewCard.js +34 -0
- package/dist/mastodon/status/application.d.ts +12 -0
- package/dist/mastodon/status/application.js +12 -0
- package/dist/mastodon/status/base.d.ts +1738 -0
- package/dist/mastodon/status/base.js +96 -0
- package/dist/mastodon/status/index.d.ts +4035 -0
- package/dist/mastodon/status/index.js +4 -0
- package/dist/mastodon/status/mention.d.ts +18 -0
- package/dist/mastodon/status/mention.js +12 -0
- package/dist/mastodon/status/tag.d.ts +12 -0
- package/dist/mastodon/status/tag.js +10 -0
- package/dist/mastodon/status/visibility.d.ts +3 -0
- package/dist/mastodon/status/visibility.js +3 -0
- package/dist/note/baseContent.d.ts +251 -0
- package/dist/note/baseContent.js +24 -0
- package/dist/note.d.ts +8 -7
- package/dist/note.js +1 -23
- package/dist/undo.d.ts +24 -243
- package/package.json +4 -4
- package/src/mastodon/filter/index.ts +31 -0
- package/src/mastodon/filter/keyword.ts +12 -0
- package/src/mastodon/filter/status.ts +10 -0
- package/src/mastodon/filterResult.ts +18 -0
- package/src/mastodon/mediaAttachment/audio.ts +19 -0
- package/src/mastodon/mediaAttachment/base.ts +34 -0
- package/src/mastodon/mediaAttachment/gifv.ts +41 -0
- package/src/mastodon/mediaAttachment/image.ts +32 -0
- package/src/mastodon/mediaAttachment/index.ts +10 -0
- package/src/mastodon/mediaAttachment/unknown.ts +12 -0
- package/src/mastodon/mediaAttachment/video.ts +43 -0
- package/src/mastodon/poll/index.ts +35 -0
- package/src/mastodon/poll/option.ts +13 -0
- package/src/mastodon/previewCard.ts +41 -0
- package/src/mastodon/status/application.ts +15 -0
- package/src/mastodon/status/base.ts +125 -0
- package/src/mastodon/status/index.ts +8 -0
- package/src/mastodon/status/mention.ts +15 -0
- package/src/mastodon/status/tag.ts +12 -0
- package/src/mastodon/status/visibility.ts +5 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/CustomEmoji/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const CustomEmoji = z.object({
|
|
4
|
+
shortcode: z.string({
|
|
5
|
+
description: "The name of the custom emoji",
|
|
6
|
+
}),
|
|
7
|
+
static_url: z.string({
|
|
8
|
+
description: "A link to a static copy of the custom emoji",
|
|
9
|
+
}),
|
|
10
|
+
url: z.string({
|
|
11
|
+
description: "A link to the custom emoji",
|
|
12
|
+
}),
|
|
13
|
+
visible_in_picker: z.boolean({
|
|
14
|
+
description: "Whether this Emoji should be visible in the picker or unlisted",
|
|
15
|
+
}),
|
|
16
|
+
category: z
|
|
17
|
+
.string({
|
|
18
|
+
description: "Used for sorting custom emoji in the picker",
|
|
19
|
+
})
|
|
20
|
+
.nullable(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const Filter: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
context: z.ZodArray<z.ZodEnum<["home", "notifications", "public", "thread", "account"]>, "many">;
|
|
6
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
7
|
+
filter_action: z.ZodEnum<["warn", "hide"]>;
|
|
8
|
+
keywords: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
keyword: z.ZodString;
|
|
11
|
+
whole_word: z.ZodBoolean;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
id: string;
|
|
14
|
+
keyword: string;
|
|
15
|
+
whole_word: boolean;
|
|
16
|
+
}, {
|
|
17
|
+
id: string;
|
|
18
|
+
keyword: string;
|
|
19
|
+
whole_word: boolean;
|
|
20
|
+
}>, "many">;
|
|
21
|
+
statuses: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
status_id: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
id: string;
|
|
26
|
+
status_id: string;
|
|
27
|
+
}, {
|
|
28
|
+
id: string;
|
|
29
|
+
status_id: string;
|
|
30
|
+
}>, "many">;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
context: ("home" | "notifications" | "public" | "thread" | "account")[];
|
|
35
|
+
expires_at: string | null;
|
|
36
|
+
filter_action: "warn" | "hide";
|
|
37
|
+
keywords: {
|
|
38
|
+
id: string;
|
|
39
|
+
keyword: string;
|
|
40
|
+
whole_word: boolean;
|
|
41
|
+
}[];
|
|
42
|
+
statuses: {
|
|
43
|
+
id: string;
|
|
44
|
+
status_id: string;
|
|
45
|
+
}[];
|
|
46
|
+
}, {
|
|
47
|
+
id: string;
|
|
48
|
+
title: string;
|
|
49
|
+
context: ("home" | "notifications" | "public" | "thread" | "account")[];
|
|
50
|
+
expires_at: string | null;
|
|
51
|
+
filter_action: "warn" | "hide";
|
|
52
|
+
keywords: {
|
|
53
|
+
id: string;
|
|
54
|
+
keyword: string;
|
|
55
|
+
whole_word: boolean;
|
|
56
|
+
}[];
|
|
57
|
+
statuses: {
|
|
58
|
+
id: string;
|
|
59
|
+
status_id: string;
|
|
60
|
+
}[];
|
|
61
|
+
}>;
|
|
62
|
+
export type Filter = z.infer<typeof Filter>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Filter/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { FilterKeyword } from "./keyword.js";
|
|
4
|
+
import { FilterStatus } from "./status.js";
|
|
5
|
+
export const Filter = z.object({
|
|
6
|
+
id: z.string({ description: "The ID of the Filter in the database" }),
|
|
7
|
+
title: z.string({
|
|
8
|
+
description: "A title given by the user to name the filter",
|
|
9
|
+
}),
|
|
10
|
+
context: z
|
|
11
|
+
.enum(["home", "notifications", "public", "thread", "account"])
|
|
12
|
+
.array()
|
|
13
|
+
.describe("The contexts in which the filter should be applied"),
|
|
14
|
+
expires_at: z
|
|
15
|
+
.string({
|
|
16
|
+
description: "When the filter should no longer be applied in ISO 8601 Datetime format or null if the filter does not expire",
|
|
17
|
+
})
|
|
18
|
+
.nullable(),
|
|
19
|
+
filter_action: z
|
|
20
|
+
.enum(["warn", "hide"])
|
|
21
|
+
.describe("The action to be taken when a status matches this filter"),
|
|
22
|
+
keywords: FilterKeyword.array().describe("The keywords grouped under this filter"),
|
|
23
|
+
statuses: FilterStatus.array().describe("The statuses grouped under this filter"),
|
|
24
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FilterKeyword: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
keyword: z.ZodString;
|
|
5
|
+
whole_word: z.ZodBoolean;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
id: string;
|
|
8
|
+
keyword: string;
|
|
9
|
+
whole_word: boolean;
|
|
10
|
+
}, {
|
|
11
|
+
id: string;
|
|
12
|
+
keyword: string;
|
|
13
|
+
whole_word: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
export type FilterKeyword = z.infer<typeof FilterKeyword>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/FilterKeyword/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const FilterKeyword = z.object({
|
|
4
|
+
id: z.string({ description: "The ID of the FilterKeyword in the database" }),
|
|
5
|
+
keyword: z.string({ description: "The phrase to be matched against" }),
|
|
6
|
+
whole_word: z.boolean({
|
|
7
|
+
description: "Should the filter consider word boundaries? See [implementation guidelines for filters](https://docs.joinmastodon.org/api/guidelines/#filters)",
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FilterStatus: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
status_id: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
id: string;
|
|
7
|
+
status_id: string;
|
|
8
|
+
}, {
|
|
9
|
+
id: string;
|
|
10
|
+
status_id: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type FilterStatus = z.infer<typeof FilterStatus>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/FilterStatus/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const FilterStatus = z.object({
|
|
4
|
+
id: z.string({ description: "The ID of the FilterStatus in the database" }),
|
|
5
|
+
status_id: z.string({
|
|
6
|
+
description: "The ID of the Status that will be filtered",
|
|
7
|
+
}),
|
|
8
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FilterResult: z.ZodObject<{
|
|
3
|
+
filter: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
context: z.ZodArray<z.ZodEnum<["home", "notifications", "public", "thread", "account"]>, "many">;
|
|
7
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
8
|
+
filter_action: z.ZodEnum<["warn", "hide"]>;
|
|
9
|
+
keywords: z.ZodArray<z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
keyword: z.ZodString;
|
|
12
|
+
whole_word: z.ZodBoolean;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
id: string;
|
|
15
|
+
keyword: string;
|
|
16
|
+
whole_word: boolean;
|
|
17
|
+
}, {
|
|
18
|
+
id: string;
|
|
19
|
+
keyword: string;
|
|
20
|
+
whole_word: boolean;
|
|
21
|
+
}>, "many">;
|
|
22
|
+
statuses: z.ZodArray<z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
status_id: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
id: string;
|
|
27
|
+
status_id: string;
|
|
28
|
+
}, {
|
|
29
|
+
id: string;
|
|
30
|
+
status_id: string;
|
|
31
|
+
}>, "many">;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
context: ("home" | "notifications" | "public" | "thread" | "account")[];
|
|
36
|
+
expires_at: string | null;
|
|
37
|
+
filter_action: "warn" | "hide";
|
|
38
|
+
keywords: {
|
|
39
|
+
id: string;
|
|
40
|
+
keyword: string;
|
|
41
|
+
whole_word: boolean;
|
|
42
|
+
}[];
|
|
43
|
+
statuses: {
|
|
44
|
+
id: string;
|
|
45
|
+
status_id: string;
|
|
46
|
+
}[];
|
|
47
|
+
}, {
|
|
48
|
+
id: string;
|
|
49
|
+
title: string;
|
|
50
|
+
context: ("home" | "notifications" | "public" | "thread" | "account")[];
|
|
51
|
+
expires_at: string | null;
|
|
52
|
+
filter_action: "warn" | "hide";
|
|
53
|
+
keywords: {
|
|
54
|
+
id: string;
|
|
55
|
+
keyword: string;
|
|
56
|
+
whole_word: boolean;
|
|
57
|
+
}[];
|
|
58
|
+
statuses: {
|
|
59
|
+
id: string;
|
|
60
|
+
status_id: string;
|
|
61
|
+
}[];
|
|
62
|
+
}>;
|
|
63
|
+
keyword_matches: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
|
|
64
|
+
status_matches: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
filter: {
|
|
67
|
+
id: string;
|
|
68
|
+
title: string;
|
|
69
|
+
context: ("home" | "notifications" | "public" | "thread" | "account")[];
|
|
70
|
+
expires_at: string | null;
|
|
71
|
+
filter_action: "warn" | "hide";
|
|
72
|
+
keywords: {
|
|
73
|
+
id: string;
|
|
74
|
+
keyword: string;
|
|
75
|
+
whole_word: boolean;
|
|
76
|
+
}[];
|
|
77
|
+
statuses: {
|
|
78
|
+
id: string;
|
|
79
|
+
status_id: string;
|
|
80
|
+
}[];
|
|
81
|
+
};
|
|
82
|
+
keyword_matches: string[] | null;
|
|
83
|
+
status_matches: string[] | null;
|
|
84
|
+
}, {
|
|
85
|
+
filter: {
|
|
86
|
+
id: string;
|
|
87
|
+
title: string;
|
|
88
|
+
context: ("home" | "notifications" | "public" | "thread" | "account")[];
|
|
89
|
+
expires_at: string | null;
|
|
90
|
+
filter_action: "warn" | "hide";
|
|
91
|
+
keywords: {
|
|
92
|
+
id: string;
|
|
93
|
+
keyword: string;
|
|
94
|
+
whole_word: boolean;
|
|
95
|
+
}[];
|
|
96
|
+
statuses: {
|
|
97
|
+
id: string;
|
|
98
|
+
status_id: string;
|
|
99
|
+
}[];
|
|
100
|
+
};
|
|
101
|
+
keyword_matches: string[] | null;
|
|
102
|
+
status_matches: string[] | null;
|
|
103
|
+
}>;
|
|
104
|
+
export type FilterResult = z.infer<typeof FilterResult>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/FilterResult/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { Filter } from "./filter/index.js";
|
|
4
|
+
export const FilterResult = z.object({
|
|
5
|
+
filter: Filter.describe("The filter that was matched"),
|
|
6
|
+
keyword_matches: z
|
|
7
|
+
.string()
|
|
8
|
+
.array()
|
|
9
|
+
.nullable()
|
|
10
|
+
.describe("The keyword within the filter that was matched"),
|
|
11
|
+
status_matches: z
|
|
12
|
+
.string()
|
|
13
|
+
.array()
|
|
14
|
+
.nullable()
|
|
15
|
+
.describe("The status ID within the filter that was matched"),
|
|
16
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const Audio: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
preview_url: z.ZodString;
|
|
6
|
+
remote_url: z.ZodNullable<z.ZodString>;
|
|
7
|
+
description: z.ZodNullable<z.ZodString>;
|
|
8
|
+
bluehash: z.ZodString;
|
|
9
|
+
}, {
|
|
10
|
+
type: z.ZodLiteral<"audio">;
|
|
11
|
+
meta: z.ZodObject<{
|
|
12
|
+
length: z.ZodString;
|
|
13
|
+
duration: z.ZodNumber;
|
|
14
|
+
audio_encode: z.ZodString;
|
|
15
|
+
audio_bitrate: z.ZodString;
|
|
16
|
+
audio_channels: z.ZodString;
|
|
17
|
+
original: z.ZodObject<{
|
|
18
|
+
duration: z.ZodNumber;
|
|
19
|
+
bitrate: z.ZodNumber;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
duration: number;
|
|
22
|
+
bitrate: number;
|
|
23
|
+
}, {
|
|
24
|
+
duration: number;
|
|
25
|
+
bitrate: number;
|
|
26
|
+
}>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
length: string;
|
|
29
|
+
duration: number;
|
|
30
|
+
audio_encode: string;
|
|
31
|
+
audio_bitrate: string;
|
|
32
|
+
audio_channels: string;
|
|
33
|
+
original: {
|
|
34
|
+
duration: number;
|
|
35
|
+
bitrate: number;
|
|
36
|
+
};
|
|
37
|
+
}, {
|
|
38
|
+
length: string;
|
|
39
|
+
duration: number;
|
|
40
|
+
audio_encode: string;
|
|
41
|
+
audio_bitrate: string;
|
|
42
|
+
audio_channels: string;
|
|
43
|
+
original: {
|
|
44
|
+
duration: number;
|
|
45
|
+
bitrate: number;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
}>, "strip", z.ZodTypeAny, {
|
|
49
|
+
id: string;
|
|
50
|
+
type: "audio";
|
|
51
|
+
url: string;
|
|
52
|
+
description: string | null;
|
|
53
|
+
preview_url: string;
|
|
54
|
+
remote_url: string | null;
|
|
55
|
+
bluehash: string;
|
|
56
|
+
meta: {
|
|
57
|
+
length: string;
|
|
58
|
+
duration: number;
|
|
59
|
+
audio_encode: string;
|
|
60
|
+
audio_bitrate: string;
|
|
61
|
+
audio_channels: string;
|
|
62
|
+
original: {
|
|
63
|
+
duration: number;
|
|
64
|
+
bitrate: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}, {
|
|
68
|
+
id: string;
|
|
69
|
+
type: "audio";
|
|
70
|
+
url: string;
|
|
71
|
+
description: string | null;
|
|
72
|
+
preview_url: string;
|
|
73
|
+
remote_url: string | null;
|
|
74
|
+
bluehash: string;
|
|
75
|
+
meta: {
|
|
76
|
+
length: string;
|
|
77
|
+
duration: number;
|
|
78
|
+
audio_encode: string;
|
|
79
|
+
audio_bitrate: string;
|
|
80
|
+
audio_channels: string;
|
|
81
|
+
original: {
|
|
82
|
+
duration: number;
|
|
83
|
+
bitrate: number;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
export type Audio = z.infer<typeof Audio>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/#audio
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { BaseMediaAttachment } from "./base.js";
|
|
4
|
+
export const Audio = BaseMediaAttachment.extend({
|
|
5
|
+
type: z.literal("audio").describe("The type of the attachment (Audio track)"),
|
|
6
|
+
meta: z.object({
|
|
7
|
+
length: z.string(),
|
|
8
|
+
duration: z.number(),
|
|
9
|
+
audio_encode: z.string(),
|
|
10
|
+
audio_bitrate: z.string(),
|
|
11
|
+
audio_channels: z.string(),
|
|
12
|
+
original: z.object({
|
|
13
|
+
duration: z.number(),
|
|
14
|
+
bitrate: z.number(),
|
|
15
|
+
}),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BaseMediaAttachment: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
preview_url: z.ZodString;
|
|
6
|
+
remote_url: z.ZodNullable<z.ZodString>;
|
|
7
|
+
description: z.ZodNullable<z.ZodString>;
|
|
8
|
+
bluehash: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
id: string;
|
|
11
|
+
url: string;
|
|
12
|
+
description: string | null;
|
|
13
|
+
preview_url: string;
|
|
14
|
+
remote_url: string | null;
|
|
15
|
+
bluehash: string;
|
|
16
|
+
}, {
|
|
17
|
+
id: string;
|
|
18
|
+
url: string;
|
|
19
|
+
description: string | null;
|
|
20
|
+
preview_url: string;
|
|
21
|
+
remote_url: string | null;
|
|
22
|
+
bluehash: string;
|
|
23
|
+
}>;
|
|
24
|
+
export type BaseMediaAttachment = z.infer<typeof BaseMediaAttachment>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const BaseMediaAttachment = z.object({
|
|
4
|
+
id: z.string({
|
|
5
|
+
description: "The ID of the attachment in the database",
|
|
6
|
+
}),
|
|
7
|
+
url: z.string({
|
|
8
|
+
description: "The location of the original full-size attachment",
|
|
9
|
+
}),
|
|
10
|
+
preview_url: z.string({
|
|
11
|
+
description: "The location of a scaled-down preview of the attachment",
|
|
12
|
+
}),
|
|
13
|
+
remote_url: z
|
|
14
|
+
.string({
|
|
15
|
+
description: "The location of the full-size original attachment on the remote website",
|
|
16
|
+
})
|
|
17
|
+
.nullable(),
|
|
18
|
+
description: z
|
|
19
|
+
.string({
|
|
20
|
+
description: "Alternate text that describes what is in the media attachment, to be used for the visually impaired or when media attachments do not load",
|
|
21
|
+
})
|
|
22
|
+
.nullable(),
|
|
23
|
+
bluehash: z.string({
|
|
24
|
+
description: "hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.",
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const Gifv: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
url: z.ZodString;
|
|
5
|
+
preview_url: z.ZodString;
|
|
6
|
+
remote_url: z.ZodNullable<z.ZodString>;
|
|
7
|
+
description: z.ZodNullable<z.ZodString>;
|
|
8
|
+
bluehash: z.ZodString;
|
|
9
|
+
}, {
|
|
10
|
+
type: z.ZodLiteral<"gifv">;
|
|
11
|
+
meta: z.ZodObject<{
|
|
12
|
+
length: z.ZodString;
|
|
13
|
+
duration: z.ZodNumber;
|
|
14
|
+
fps: z.ZodNumber;
|
|
15
|
+
size: z.ZodString;
|
|
16
|
+
width: z.ZodNumber;
|
|
17
|
+
height: z.ZodNumber;
|
|
18
|
+
aspect: z.ZodNumber;
|
|
19
|
+
original: z.ZodObject<{
|
|
20
|
+
width: z.ZodNumber;
|
|
21
|
+
height: z.ZodNumber;
|
|
22
|
+
frame_rate: z.ZodString;
|
|
23
|
+
duration: z.ZodNumber;
|
|
24
|
+
bitrate: z.ZodNumber;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
duration: number;
|
|
29
|
+
bitrate: number;
|
|
30
|
+
frame_rate: string;
|
|
31
|
+
}, {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
duration: number;
|
|
35
|
+
bitrate: number;
|
|
36
|
+
frame_rate: string;
|
|
37
|
+
}>;
|
|
38
|
+
small: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
39
|
+
width: z.ZodNumber;
|
|
40
|
+
height: z.ZodNumber;
|
|
41
|
+
size: z.ZodString;
|
|
42
|
+
aspect: z.ZodNumber;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
size: string;
|
|
47
|
+
aspect: number;
|
|
48
|
+
}, {
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
size: string;
|
|
52
|
+
aspect: number;
|
|
53
|
+
}>>>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
length: string;
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
duration: number;
|
|
59
|
+
original: {
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
duration: number;
|
|
63
|
+
bitrate: number;
|
|
64
|
+
frame_rate: string;
|
|
65
|
+
};
|
|
66
|
+
fps: number;
|
|
67
|
+
size: string;
|
|
68
|
+
aspect: number;
|
|
69
|
+
small?: {
|
|
70
|
+
width: number;
|
|
71
|
+
height: number;
|
|
72
|
+
size: string;
|
|
73
|
+
aspect: number;
|
|
74
|
+
} | null | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
length: string;
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
duration: number;
|
|
80
|
+
original: {
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
duration: number;
|
|
84
|
+
bitrate: number;
|
|
85
|
+
frame_rate: string;
|
|
86
|
+
};
|
|
87
|
+
fps: number;
|
|
88
|
+
size: string;
|
|
89
|
+
aspect: number;
|
|
90
|
+
small?: {
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
size: string;
|
|
94
|
+
aspect: number;
|
|
95
|
+
} | null | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
}>, "strip", z.ZodTypeAny, {
|
|
98
|
+
id: string;
|
|
99
|
+
type: "gifv";
|
|
100
|
+
url: string;
|
|
101
|
+
description: string | null;
|
|
102
|
+
preview_url: string;
|
|
103
|
+
remote_url: string | null;
|
|
104
|
+
bluehash: string;
|
|
105
|
+
meta: {
|
|
106
|
+
length: string;
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
duration: number;
|
|
110
|
+
original: {
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
duration: number;
|
|
114
|
+
bitrate: number;
|
|
115
|
+
frame_rate: string;
|
|
116
|
+
};
|
|
117
|
+
fps: number;
|
|
118
|
+
size: string;
|
|
119
|
+
aspect: number;
|
|
120
|
+
small?: {
|
|
121
|
+
width: number;
|
|
122
|
+
height: number;
|
|
123
|
+
size: string;
|
|
124
|
+
aspect: number;
|
|
125
|
+
} | null | undefined;
|
|
126
|
+
};
|
|
127
|
+
}, {
|
|
128
|
+
id: string;
|
|
129
|
+
type: "gifv";
|
|
130
|
+
url: string;
|
|
131
|
+
description: string | null;
|
|
132
|
+
preview_url: string;
|
|
133
|
+
remote_url: string | null;
|
|
134
|
+
bluehash: string;
|
|
135
|
+
meta: {
|
|
136
|
+
length: string;
|
|
137
|
+
width: number;
|
|
138
|
+
height: number;
|
|
139
|
+
duration: number;
|
|
140
|
+
original: {
|
|
141
|
+
width: number;
|
|
142
|
+
height: number;
|
|
143
|
+
duration: number;
|
|
144
|
+
bitrate: number;
|
|
145
|
+
frame_rate: string;
|
|
146
|
+
};
|
|
147
|
+
fps: number;
|
|
148
|
+
size: string;
|
|
149
|
+
aspect: number;
|
|
150
|
+
small?: {
|
|
151
|
+
width: number;
|
|
152
|
+
height: number;
|
|
153
|
+
size: string;
|
|
154
|
+
aspect: number;
|
|
155
|
+
} | null | undefined;
|
|
156
|
+
};
|
|
157
|
+
}>;
|
|
158
|
+
export type Gifv = z.infer<typeof Gifv>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/#gifv
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { BaseMediaAttachment } from "./base.js";
|
|
4
|
+
export const Gifv = BaseMediaAttachment.extend({
|
|
5
|
+
type: z
|
|
6
|
+
.literal("gifv")
|
|
7
|
+
.describe("The type of the attachment (Looping, soundless animation)"),
|
|
8
|
+
meta: z.object({
|
|
9
|
+
length: z.string(),
|
|
10
|
+
duration: z.number(),
|
|
11
|
+
fps: z.number(),
|
|
12
|
+
size: z.string({
|
|
13
|
+
description: "Video width and height in string wxh format",
|
|
14
|
+
}),
|
|
15
|
+
width: z.number(),
|
|
16
|
+
height: z.number(),
|
|
17
|
+
aspect: z.number({
|
|
18
|
+
description: "Aspect ratio of the video (width/height)",
|
|
19
|
+
}),
|
|
20
|
+
original: z.object({
|
|
21
|
+
width: z.number(),
|
|
22
|
+
height: z.number(),
|
|
23
|
+
frame_rate: z.string(),
|
|
24
|
+
duration: z.number(),
|
|
25
|
+
bitrate: z.number(),
|
|
26
|
+
}),
|
|
27
|
+
small: z
|
|
28
|
+
.object({
|
|
29
|
+
width: z.number(),
|
|
30
|
+
height: z.number(),
|
|
31
|
+
size: z.string(),
|
|
32
|
+
aspect: z.number(),
|
|
33
|
+
})
|
|
34
|
+
.describe("A video preview in static image")
|
|
35
|
+
.nullish(),
|
|
36
|
+
}),
|
|
37
|
+
});
|