@llun/activities.schema 0.2.20 → 0.2.22
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/dist/cjs/mastodon/{accountField.js → account/field.js} +2 -2
- package/dist/cjs/mastodon/account/source.js +23 -0
- package/dist/cjs/mastodon/account.js +7 -2
- package/dist/cjs/mastodon/index.js +2 -1
- package/dist/cjs/mastodon/mediaAttachment/audio.js +4 -4
- package/dist/cjs/mastodon/mediaAttachment/base.js +8 -4
- package/dist/cjs/mastodon/mediaAttachment/gifv.js +10 -8
- package/dist/cjs/mastodon/mediaAttachment/image.js +4 -2
- package/dist/cjs/mastodon/mediaAttachment/video.js +13 -11
- package/dist/cjs/mastodon/status/base.js +1 -1
- package/dist/esm/mastodon/{accountField.js → account/field.js} +1 -1
- package/dist/esm/mastodon/account/source.js +20 -0
- package/dist/esm/mastodon/account.js +7 -2
- package/dist/esm/mastodon/index.js +2 -1
- package/dist/esm/mastodon/mediaAttachment/audio.js +4 -4
- package/dist/esm/mastodon/mediaAttachment/base.js +8 -4
- package/dist/esm/mastodon/mediaAttachment/gifv.js +10 -8
- package/dist/esm/mastodon/mediaAttachment/image.js +4 -2
- package/dist/esm/mastodon/mediaAttachment/video.js +13 -11
- package/dist/esm/mastodon/status/base.js +1 -1
- package/dist/types/mastodon/{accountField.d.ts → account/field.d.ts} +2 -2
- package/dist/types/mastodon/account/source.d.ts +44 -0
- package/dist/types/mastodon/account.d.ts +200 -36
- package/dist/types/mastodon/filter/index.d.ts +2 -2
- package/dist/types/mastodon/filterResult.d.ts +4 -4
- package/dist/types/mastodon/index.d.ts +2 -1
- package/dist/types/mastodon/mediaAttachment/audio.d.ts +28 -28
- package/dist/types/mastodon/mediaAttachment/base.d.ts +6 -6
- package/dist/types/mastodon/mediaAttachment/gifv.d.ts +48 -48
- package/dist/types/mastodon/mediaAttachment/image.d.ts +12 -12
- package/dist/types/mastodon/mediaAttachment/index.d.ts +157 -157
- package/dist/types/mastodon/mediaAttachment/unknown.d.ts +6 -6
- package/dist/types/mastodon/mediaAttachment/video.d.ts +63 -63
- package/dist/types/mastodon/status/base.d.ts +515 -299
- package/dist/types/mastodon/status/index.d.ts +1184 -700
- package/package.json +1 -1
- package/src/mastodon/{accountField.ts → account/field.ts} +2 -2
- package/src/mastodon/account/source.ts +24 -0
- package/src/mastodon/account.ts +9 -2
- package/src/mastodon/index.ts +2 -1
- package/src/mastodon/mediaAttachment/audio.ts +4 -4
- package/src/mastodon/mediaAttachment/base.ts +11 -7
- package/src/mastodon/mediaAttachment/gifv.ts +28 -26
- package/src/mastodon/mediaAttachment/image.ts +20 -18
- package/src/mastodon/mediaAttachment/video.ts +32 -30
- package/src/mastodon/status/base.ts +1 -1
- /package/dist/cjs/mastodon/{status/visibility.js → visibility.js} +0 -0
- /package/dist/esm/mastodon/{status/visibility.js → visibility.js} +0 -0
- /package/dist/types/mastodon/{status/visibility.d.ts → visibility.d.ts} +0 -0
- /package/src/mastodon/{status/visibility.ts → visibility.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This schema is base on https://docs.joinmastodon.org/entities/Account/#Field
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const Field = z.object({
|
|
5
5
|
name: z.string({
|
|
6
6
|
description: "The key of a given field’s key-value pair",
|
|
7
7
|
}),
|
|
@@ -15,4 +15,4 @@ export const AccountField = z.object({
|
|
|
15
15
|
})
|
|
16
16
|
.nullable(),
|
|
17
17
|
});
|
|
18
|
-
export type
|
|
18
|
+
export type Field = z.infer<typeof Field>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Account/#source
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { Field } from "./field.js";
|
|
4
|
+
import { Visibility } from "../visibility.js";
|
|
5
|
+
|
|
6
|
+
export const Source = z.object({
|
|
7
|
+
note: z.string({
|
|
8
|
+
description: "Profile bio, in plain-text instead of in HTML",
|
|
9
|
+
}),
|
|
10
|
+
fields: Field.array().describe("Metadata about the account"),
|
|
11
|
+
privacy: Visibility.describe(
|
|
12
|
+
"The default post privacy to be used for new statuses."
|
|
13
|
+
),
|
|
14
|
+
sensitive: z.boolean({
|
|
15
|
+
description: "Whether new statuses should be marked sensitive by default",
|
|
16
|
+
}),
|
|
17
|
+
language: z.string({
|
|
18
|
+
description: "The default posting language for new statuses",
|
|
19
|
+
}),
|
|
20
|
+
follow_requests_count: z.number({
|
|
21
|
+
description: "The number of pending follow requests",
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
export type Source = z.infer<typeof Source>;
|
package/src/mastodon/account.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// This schema is base on https://docs.joinmastodon.org/entities/Account/
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import { Field } from "./account/field.js";
|
|
4
4
|
import { CustomEmoji } from "./customEmoji.js";
|
|
5
|
+
import { Source } from "./account/source.js";
|
|
5
6
|
|
|
6
7
|
const BaseAccount = z.object({
|
|
7
8
|
id: z.string({
|
|
@@ -18,6 +19,9 @@ const BaseAccount = z.object({
|
|
|
18
19
|
url: z.string({
|
|
19
20
|
description: "The location of the user's profile page",
|
|
20
21
|
}),
|
|
22
|
+
uri: z.string({
|
|
23
|
+
description: "The location of the actor's profile page",
|
|
24
|
+
}),
|
|
21
25
|
display_name: z.string({
|
|
22
26
|
description: "The profile's display name",
|
|
23
27
|
}),
|
|
@@ -43,7 +47,10 @@ const BaseAccount = z.object({
|
|
|
43
47
|
locked: z.boolean({
|
|
44
48
|
description: "Whether the actor manually approves follow requests",
|
|
45
49
|
}),
|
|
46
|
-
|
|
50
|
+
source: Source.describe(
|
|
51
|
+
"An extra attribute that contains source values to be used with API methods that verify credentials and update credentials"
|
|
52
|
+
),
|
|
53
|
+
fields: Field.array().describe(
|
|
47
54
|
"Additional metadata attached to a profile as name-value pairs"
|
|
48
55
|
),
|
|
49
56
|
emojis: CustomEmoji.array().describe(
|
package/src/mastodon/index.ts
CHANGED
|
@@ -7,12 +7,12 @@ export const Audio = BaseMediaAttachment.extend({
|
|
|
7
7
|
meta: z.object({
|
|
8
8
|
length: z.string(),
|
|
9
9
|
duration: z.number(),
|
|
10
|
-
audio_encode: z.string(),
|
|
11
|
-
audio_bitrate: z.string(),
|
|
12
|
-
audio_channels: z.string(),
|
|
10
|
+
audio_encode: z.string().nullish(),
|
|
11
|
+
audio_bitrate: z.string().nullish(),
|
|
12
|
+
audio_channels: z.string().nullish(),
|
|
13
13
|
original: z.object({
|
|
14
14
|
duration: z.number(),
|
|
15
|
-
bitrate: z.number(),
|
|
15
|
+
bitrate: z.number().nullish(),
|
|
16
16
|
}),
|
|
17
17
|
}),
|
|
18
18
|
});
|
|
@@ -9,9 +9,11 @@ export const BaseMediaAttachment = z.object({
|
|
|
9
9
|
url: z.string({
|
|
10
10
|
description: "The location of the original full-size attachment",
|
|
11
11
|
}),
|
|
12
|
-
preview_url: z
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
preview_url: z
|
|
13
|
+
.string({
|
|
14
|
+
description: "The location of a scaled-down preview of the attachment",
|
|
15
|
+
})
|
|
16
|
+
.nullable(),
|
|
15
17
|
remote_url: z
|
|
16
18
|
.string({
|
|
17
19
|
description:
|
|
@@ -26,9 +28,11 @@ export const BaseMediaAttachment = z.object({
|
|
|
26
28
|
})
|
|
27
29
|
.nullable(),
|
|
28
30
|
|
|
29
|
-
bluehash: z
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
bluehash: z
|
|
32
|
+
.string({
|
|
33
|
+
description:
|
|
34
|
+
"hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.",
|
|
35
|
+
})
|
|
36
|
+
.nullable(),
|
|
33
37
|
});
|
|
34
38
|
export type BaseMediaAttachment = z.infer<typeof BaseMediaAttachment>;
|
|
@@ -6,36 +6,38 @@ export const Gifv = BaseMediaAttachment.extend({
|
|
|
6
6
|
type: z
|
|
7
7
|
.literal("gifv")
|
|
8
8
|
.describe("The type of the attachment (Looping, soundless animation)"),
|
|
9
|
-
meta: z
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
meta: z
|
|
10
|
+
.object({
|
|
11
|
+
length: z.string().nullish(),
|
|
12
|
+
duration: z.number().nullish(),
|
|
13
|
+
fps: z.number().nullish(),
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
width: z.number(),
|
|
18
|
-
height: z.number(),
|
|
19
|
-
aspect: z.number({
|
|
20
|
-
description: "Aspect ratio of the video (width/height)",
|
|
21
|
-
}),
|
|
22
|
-
|
|
23
|
-
original: z.object({
|
|
15
|
+
size: z.string({
|
|
16
|
+
description: "Video width and height in string wxh format",
|
|
17
|
+
}),
|
|
24
18
|
width: z.number(),
|
|
25
19
|
height: z.number(),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.object({
|
|
20
|
+
aspect: z.number({
|
|
21
|
+
description: "Aspect ratio of the video (width/height)",
|
|
22
|
+
}),
|
|
23
|
+
|
|
24
|
+
original: z.object({
|
|
32
25
|
width: z.number(),
|
|
33
26
|
height: z.number(),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
frame_rate: z.string().nullish(),
|
|
28
|
+
duration: z.number().nullish(),
|
|
29
|
+
bitrate: z.number().nullish(),
|
|
30
|
+
}),
|
|
31
|
+
small: z
|
|
32
|
+
.object({
|
|
33
|
+
width: z.number(),
|
|
34
|
+
height: z.number(),
|
|
35
|
+
size: z.string(),
|
|
36
|
+
aspect: z.number(),
|
|
37
|
+
})
|
|
38
|
+
.describe("A video preview in static image")
|
|
39
|
+
.nullish(),
|
|
40
|
+
})
|
|
41
|
+
.nullish(),
|
|
40
42
|
});
|
|
41
43
|
export type Gifv = z.infer<typeof Gifv>;
|
|
@@ -6,27 +6,29 @@ export const Image = BaseMediaAttachment.extend({
|
|
|
6
6
|
type: z
|
|
7
7
|
.literal("image")
|
|
8
8
|
.describe("The type of the attachment (Static image)"),
|
|
9
|
-
meta: z
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
height: z.number(),
|
|
13
|
-
size: z.string(),
|
|
14
|
-
aspect: z.number(),
|
|
15
|
-
}),
|
|
16
|
-
small: z
|
|
17
|
-
.object({
|
|
9
|
+
meta: z
|
|
10
|
+
.object({
|
|
11
|
+
original: z.object({
|
|
18
12
|
width: z.number(),
|
|
19
13
|
height: z.number(),
|
|
20
14
|
size: z.string(),
|
|
21
15
|
aspect: z.number(),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
}),
|
|
17
|
+
small: z
|
|
18
|
+
.object({
|
|
19
|
+
width: z.number(),
|
|
20
|
+
height: z.number(),
|
|
21
|
+
size: z.string(),
|
|
22
|
+
aspect: z.number(),
|
|
23
|
+
})
|
|
24
|
+
.nullish(),
|
|
25
|
+
focus: z
|
|
26
|
+
.object({
|
|
27
|
+
x: z.number(),
|
|
28
|
+
y: z.number(),
|
|
29
|
+
})
|
|
30
|
+
.nullish(),
|
|
31
|
+
})
|
|
32
|
+
.nullish(),
|
|
31
33
|
});
|
|
32
34
|
export type Image = z.infer<typeof Image>;
|
|
@@ -4,40 +4,42 @@ import { BaseMediaAttachment } from "./base.js";
|
|
|
4
4
|
|
|
5
5
|
export const Video = BaseMediaAttachment.extend({
|
|
6
6
|
type: z.literal("video").describe("The type of the attachment (Video clip)"),
|
|
7
|
-
meta: z
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
meta: z
|
|
8
|
+
.object({
|
|
9
|
+
length: z.string().nullish(),
|
|
10
|
+
duration: z.number().nullish(),
|
|
11
|
+
fps: z.number().nullish(),
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
width: z.number(),
|
|
16
|
-
height: z.number(),
|
|
17
|
-
aspect: z.number({
|
|
18
|
-
description: "Aspect ratio of the video (width/height)",
|
|
19
|
-
}),
|
|
20
|
-
|
|
21
|
-
audio_encode: z.string(),
|
|
22
|
-
audio_bitrate: z.string(),
|
|
23
|
-
audio_channels: z.string(),
|
|
24
|
-
|
|
25
|
-
original: z.object({
|
|
13
|
+
size: z.string({
|
|
14
|
+
description: "Video width and height in string wxh format",
|
|
15
|
+
}),
|
|
26
16
|
width: z.number(),
|
|
27
17
|
height: z.number(),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.
|
|
18
|
+
aspect: z.number({
|
|
19
|
+
description: "Aspect ratio of the video (width/height)",
|
|
20
|
+
}),
|
|
21
|
+
|
|
22
|
+
audio_encode: z.string().nullish(),
|
|
23
|
+
audio_bitrate: z.string().nullish(),
|
|
24
|
+
audio_channels: z.string().nullish(),
|
|
25
|
+
|
|
26
|
+
original: z.object({
|
|
34
27
|
width: z.number(),
|
|
35
28
|
height: z.number(),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
frame_rate: z.string().nullish(),
|
|
30
|
+
duration: z.number().nullish(),
|
|
31
|
+
bitrate: z.number().nullish(),
|
|
32
|
+
}),
|
|
33
|
+
small: z
|
|
34
|
+
.object({
|
|
35
|
+
width: z.number(),
|
|
36
|
+
height: z.number(),
|
|
37
|
+
size: z.string(),
|
|
38
|
+
aspect: z.number(),
|
|
39
|
+
})
|
|
40
|
+
.describe("A video preview in static image")
|
|
41
|
+
.nullish(),
|
|
42
|
+
})
|
|
43
|
+
.nullish(),
|
|
42
44
|
});
|
|
43
45
|
export type Video = z.infer<typeof Video>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This schema is base on https://docs.joinmastodon.org/entities/Status/
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Account } from "../account.js";
|
|
4
|
-
import { Visibility } from "
|
|
4
|
+
import { Visibility } from "../visibility.js";
|
|
5
5
|
import { MediaAttachment } from "../mediaAttachment/index.js";
|
|
6
6
|
import { Application } from "./application.js";
|
|
7
7
|
import { CustomEmoji } from "../customEmoji.js";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|