@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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Field = void 0;
|
|
4
4
|
// This schema is base on https://docs.joinmastodon.org/entities/Account/#Field
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
exports.
|
|
6
|
+
exports.Field = zod_1.z.object({
|
|
7
7
|
name: zod_1.z.string({
|
|
8
8
|
description: "The key of a given field’s key-value pair",
|
|
9
9
|
}),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Source = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Account/#source
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const field_js_1 = require("./field.js");
|
|
7
|
+
const visibility_js_1 = require("../visibility.js");
|
|
8
|
+
exports.Source = zod_1.z.object({
|
|
9
|
+
note: zod_1.z.string({
|
|
10
|
+
description: "Profile bio, in plain-text instead of in HTML",
|
|
11
|
+
}),
|
|
12
|
+
fields: field_js_1.Field.array().describe("Metadata about the account"),
|
|
13
|
+
privacy: visibility_js_1.Visibility.describe("The default post privacy to be used for new statuses."),
|
|
14
|
+
sensitive: zod_1.z.boolean({
|
|
15
|
+
description: "Whether new statuses should be marked sensitive by default",
|
|
16
|
+
}),
|
|
17
|
+
language: zod_1.z.string({
|
|
18
|
+
description: "The default posting language for new statuses",
|
|
19
|
+
}),
|
|
20
|
+
follow_requests_count: zod_1.z.number({
|
|
21
|
+
description: "The number of pending follow requests",
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Account = void 0;
|
|
4
4
|
// This schema is base on https://docs.joinmastodon.org/entities/Account/
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
|
-
const
|
|
6
|
+
const field_js_1 = require("./account/field.js");
|
|
7
7
|
const customEmoji_js_1 = require("./customEmoji.js");
|
|
8
|
+
const source_js_1 = require("./account/source.js");
|
|
8
9
|
const BaseAccount = zod_1.z.object({
|
|
9
10
|
id: zod_1.z.string({
|
|
10
11
|
description: "This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI",
|
|
@@ -18,6 +19,9 @@ const BaseAccount = zod_1.z.object({
|
|
|
18
19
|
url: zod_1.z.string({
|
|
19
20
|
description: "The location of the user's profile page",
|
|
20
21
|
}),
|
|
22
|
+
uri: zod_1.z.string({
|
|
23
|
+
description: "The location of the actor's profile page",
|
|
24
|
+
}),
|
|
21
25
|
display_name: zod_1.z.string({
|
|
22
26
|
description: "The profile's display name",
|
|
23
27
|
}),
|
|
@@ -39,7 +43,8 @@ const BaseAccount = zod_1.z.object({
|
|
|
39
43
|
locked: zod_1.z.boolean({
|
|
40
44
|
description: "Whether the actor manually approves follow requests",
|
|
41
45
|
}),
|
|
42
|
-
|
|
46
|
+
source: source_js_1.Source.describe("An extra attribute that contains source values to be used with API methods that verify credentials and update credentials"),
|
|
47
|
+
fields: field_js_1.Field.array().describe("Additional metadata attached to a profile as name-value pairs"),
|
|
43
48
|
emojis: customEmoji_js_1.CustomEmoji.array().describe("Custom emoji entities to be used when rendering the profile"),
|
|
44
49
|
bot: zod_1.z.boolean({
|
|
45
50
|
description: "Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot",
|
|
@@ -15,7 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./account.js"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./account/field.js"), exports);
|
|
19
|
+
__exportStar(require("./account/source.js"), exports);
|
|
19
20
|
__exportStar(require("./customEmoji.js"), exports);
|
|
20
21
|
__exportStar(require("./filterResult.js"), exports);
|
|
21
22
|
__exportStar(require("./previewCard.js"), exports);
|
|
@@ -9,12 +9,12 @@ exports.Audio = base_js_1.BaseMediaAttachment.extend({
|
|
|
9
9
|
meta: zod_1.z.object({
|
|
10
10
|
length: zod_1.z.string(),
|
|
11
11
|
duration: zod_1.z.number(),
|
|
12
|
-
audio_encode: zod_1.z.string(),
|
|
13
|
-
audio_bitrate: zod_1.z.string(),
|
|
14
|
-
audio_channels: zod_1.z.string(),
|
|
12
|
+
audio_encode: zod_1.z.string().nullish(),
|
|
13
|
+
audio_bitrate: zod_1.z.string().nullish(),
|
|
14
|
+
audio_channels: zod_1.z.string().nullish(),
|
|
15
15
|
original: zod_1.z.object({
|
|
16
16
|
duration: zod_1.z.number(),
|
|
17
|
-
bitrate: zod_1.z.number(),
|
|
17
|
+
bitrate: zod_1.z.number().nullish(),
|
|
18
18
|
}),
|
|
19
19
|
}),
|
|
20
20
|
});
|
|
@@ -10,9 +10,11 @@ exports.BaseMediaAttachment = zod_1.z.object({
|
|
|
10
10
|
url: zod_1.z.string({
|
|
11
11
|
description: "The location of the original full-size attachment",
|
|
12
12
|
}),
|
|
13
|
-
preview_url: zod_1.z
|
|
13
|
+
preview_url: zod_1.z
|
|
14
|
+
.string({
|
|
14
15
|
description: "The location of a scaled-down preview of the attachment",
|
|
15
|
-
})
|
|
16
|
+
})
|
|
17
|
+
.nullable(),
|
|
16
18
|
remote_url: zod_1.z
|
|
17
19
|
.string({
|
|
18
20
|
description: "The location of the full-size original attachment on the remote website",
|
|
@@ -23,7 +25,9 @@ exports.BaseMediaAttachment = zod_1.z.object({
|
|
|
23
25
|
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",
|
|
24
26
|
})
|
|
25
27
|
.nullable(),
|
|
26
|
-
bluehash: zod_1.z
|
|
28
|
+
bluehash: zod_1.z
|
|
29
|
+
.string({
|
|
27
30
|
description: "hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.",
|
|
28
|
-
})
|
|
31
|
+
})
|
|
32
|
+
.nullable(),
|
|
29
33
|
});
|
|
@@ -8,10 +8,11 @@ exports.Gifv = base_js_1.BaseMediaAttachment.extend({
|
|
|
8
8
|
type: zod_1.z
|
|
9
9
|
.literal("gifv")
|
|
10
10
|
.describe("The type of the attachment (Looping, soundless animation)"),
|
|
11
|
-
meta: zod_1.z
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
meta: zod_1.z
|
|
12
|
+
.object({
|
|
13
|
+
length: zod_1.z.string().nullish(),
|
|
14
|
+
duration: zod_1.z.number().nullish(),
|
|
15
|
+
fps: zod_1.z.number().nullish(),
|
|
15
16
|
size: zod_1.z.string({
|
|
16
17
|
description: "Video width and height in string wxh format",
|
|
17
18
|
}),
|
|
@@ -23,9 +24,9 @@ exports.Gifv = base_js_1.BaseMediaAttachment.extend({
|
|
|
23
24
|
original: zod_1.z.object({
|
|
24
25
|
width: zod_1.z.number(),
|
|
25
26
|
height: zod_1.z.number(),
|
|
26
|
-
frame_rate: zod_1.z.string(),
|
|
27
|
-
duration: zod_1.z.number(),
|
|
28
|
-
bitrate: zod_1.z.number(),
|
|
27
|
+
frame_rate: zod_1.z.string().nullish(),
|
|
28
|
+
duration: zod_1.z.number().nullish(),
|
|
29
|
+
bitrate: zod_1.z.number().nullish(),
|
|
29
30
|
}),
|
|
30
31
|
small: zod_1.z
|
|
31
32
|
.object({
|
|
@@ -36,5 +37,6 @@ exports.Gifv = base_js_1.BaseMediaAttachment.extend({
|
|
|
36
37
|
})
|
|
37
38
|
.describe("A video preview in static image")
|
|
38
39
|
.nullish(),
|
|
39
|
-
})
|
|
40
|
+
})
|
|
41
|
+
.nullish(),
|
|
40
42
|
});
|
|
@@ -8,7 +8,8 @@ exports.Image = base_js_1.BaseMediaAttachment.extend({
|
|
|
8
8
|
type: zod_1.z
|
|
9
9
|
.literal("image")
|
|
10
10
|
.describe("The type of the attachment (Static image)"),
|
|
11
|
-
meta: zod_1.z
|
|
11
|
+
meta: zod_1.z
|
|
12
|
+
.object({
|
|
12
13
|
original: zod_1.z.object({
|
|
13
14
|
width: zod_1.z.number(),
|
|
14
15
|
height: zod_1.z.number(),
|
|
@@ -29,5 +30,6 @@ exports.Image = base_js_1.BaseMediaAttachment.extend({
|
|
|
29
30
|
y: zod_1.z.number(),
|
|
30
31
|
})
|
|
31
32
|
.nullish(),
|
|
32
|
-
})
|
|
33
|
+
})
|
|
34
|
+
.nullish(),
|
|
33
35
|
});
|
|
@@ -6,10 +6,11 @@ const zod_1 = require("zod");
|
|
|
6
6
|
const base_js_1 = require("./base.js");
|
|
7
7
|
exports.Video = base_js_1.BaseMediaAttachment.extend({
|
|
8
8
|
type: zod_1.z.literal("video").describe("The type of the attachment (Video clip)"),
|
|
9
|
-
meta: zod_1.z
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
meta: zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
length: zod_1.z.string().nullish(),
|
|
12
|
+
duration: zod_1.z.number().nullish(),
|
|
13
|
+
fps: zod_1.z.number().nullish(),
|
|
13
14
|
size: zod_1.z.string({
|
|
14
15
|
description: "Video width and height in string wxh format",
|
|
15
16
|
}),
|
|
@@ -18,15 +19,15 @@ exports.Video = base_js_1.BaseMediaAttachment.extend({
|
|
|
18
19
|
aspect: zod_1.z.number({
|
|
19
20
|
description: "Aspect ratio of the video (width/height)",
|
|
20
21
|
}),
|
|
21
|
-
audio_encode: zod_1.z.string(),
|
|
22
|
-
audio_bitrate: zod_1.z.string(),
|
|
23
|
-
audio_channels: zod_1.z.string(),
|
|
22
|
+
audio_encode: zod_1.z.string().nullish(),
|
|
23
|
+
audio_bitrate: zod_1.z.string().nullish(),
|
|
24
|
+
audio_channels: zod_1.z.string().nullish(),
|
|
24
25
|
original: zod_1.z.object({
|
|
25
26
|
width: zod_1.z.number(),
|
|
26
27
|
height: zod_1.z.number(),
|
|
27
|
-
frame_rate: zod_1.z.string(),
|
|
28
|
-
duration: zod_1.z.number(),
|
|
29
|
-
bitrate: zod_1.z.number(),
|
|
28
|
+
frame_rate: zod_1.z.string().nullish(),
|
|
29
|
+
duration: zod_1.z.number().nullish(),
|
|
30
|
+
bitrate: zod_1.z.number().nullish(),
|
|
30
31
|
}),
|
|
31
32
|
small: zod_1.z
|
|
32
33
|
.object({
|
|
@@ -37,5 +38,6 @@ exports.Video = base_js_1.BaseMediaAttachment.extend({
|
|
|
37
38
|
})
|
|
38
39
|
.describe("A video preview in static image")
|
|
39
40
|
.nullish(),
|
|
40
|
-
})
|
|
41
|
+
})
|
|
42
|
+
.nullish(),
|
|
41
43
|
});
|
|
@@ -4,7 +4,7 @@ exports.BaseStatus = void 0;
|
|
|
4
4
|
// This schema is base on https://docs.joinmastodon.org/entities/Status/
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const account_js_1 = require("../account.js");
|
|
7
|
-
const visibility_js_1 = require("
|
|
7
|
+
const visibility_js_1 = require("../visibility.js");
|
|
8
8
|
const index_js_1 = require("../mediaAttachment/index.js");
|
|
9
9
|
const application_js_1 = require("./application.js");
|
|
10
10
|
const customEmoji_js_1 = require("../customEmoji.js");
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
export const Source = z.object({
|
|
6
|
+
note: z.string({
|
|
7
|
+
description: "Profile bio, in plain-text instead of in HTML",
|
|
8
|
+
}),
|
|
9
|
+
fields: Field.array().describe("Metadata about the account"),
|
|
10
|
+
privacy: Visibility.describe("The default post privacy to be used for new statuses."),
|
|
11
|
+
sensitive: z.boolean({
|
|
12
|
+
description: "Whether new statuses should be marked sensitive by default",
|
|
13
|
+
}),
|
|
14
|
+
language: z.string({
|
|
15
|
+
description: "The default posting language for new statuses",
|
|
16
|
+
}),
|
|
17
|
+
follow_requests_count: z.number({
|
|
18
|
+
description: "The number of pending follow requests",
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
@@ -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
|
const BaseAccount = z.object({
|
|
6
7
|
id: z.string({
|
|
7
8
|
description: "This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI",
|
|
@@ -15,6 +16,9 @@ const BaseAccount = z.object({
|
|
|
15
16
|
url: z.string({
|
|
16
17
|
description: "The location of the user's profile page",
|
|
17
18
|
}),
|
|
19
|
+
uri: z.string({
|
|
20
|
+
description: "The location of the actor's profile page",
|
|
21
|
+
}),
|
|
18
22
|
display_name: z.string({
|
|
19
23
|
description: "The profile's display name",
|
|
20
24
|
}),
|
|
@@ -36,7 +40,8 @@ const BaseAccount = z.object({
|
|
|
36
40
|
locked: z.boolean({
|
|
37
41
|
description: "Whether the actor manually approves follow requests",
|
|
38
42
|
}),
|
|
39
|
-
|
|
43
|
+
source: Source.describe("An extra attribute that contains source values to be used with API methods that verify credentials and update credentials"),
|
|
44
|
+
fields: Field.array().describe("Additional metadata attached to a profile as name-value pairs"),
|
|
40
45
|
emojis: CustomEmoji.array().describe("Custom emoji entities to be used when rendering the profile"),
|
|
41
46
|
bot: z.boolean({
|
|
42
47
|
description: "Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot",
|
|
@@ -6,12 +6,12 @@ export const Audio = BaseMediaAttachment.extend({
|
|
|
6
6
|
meta: z.object({
|
|
7
7
|
length: z.string(),
|
|
8
8
|
duration: z.number(),
|
|
9
|
-
audio_encode: z.string(),
|
|
10
|
-
audio_bitrate: z.string(),
|
|
11
|
-
audio_channels: z.string(),
|
|
9
|
+
audio_encode: z.string().nullish(),
|
|
10
|
+
audio_bitrate: z.string().nullish(),
|
|
11
|
+
audio_channels: z.string().nullish(),
|
|
12
12
|
original: z.object({
|
|
13
13
|
duration: z.number(),
|
|
14
|
-
bitrate: z.number(),
|
|
14
|
+
bitrate: z.number().nullish(),
|
|
15
15
|
}),
|
|
16
16
|
}),
|
|
17
17
|
});
|
|
@@ -7,9 +7,11 @@ export const BaseMediaAttachment = z.object({
|
|
|
7
7
|
url: z.string({
|
|
8
8
|
description: "The location of the original full-size attachment",
|
|
9
9
|
}),
|
|
10
|
-
preview_url: z
|
|
10
|
+
preview_url: z
|
|
11
|
+
.string({
|
|
11
12
|
description: "The location of a scaled-down preview of the attachment",
|
|
12
|
-
})
|
|
13
|
+
})
|
|
14
|
+
.nullable(),
|
|
13
15
|
remote_url: z
|
|
14
16
|
.string({
|
|
15
17
|
description: "The location of the full-size original attachment on the remote website",
|
|
@@ -20,7 +22,9 @@ export const BaseMediaAttachment = z.object({
|
|
|
20
22
|
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
23
|
})
|
|
22
24
|
.nullable(),
|
|
23
|
-
bluehash: z
|
|
25
|
+
bluehash: z
|
|
26
|
+
.string({
|
|
24
27
|
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
|
-
})
|
|
28
|
+
})
|
|
29
|
+
.nullable(),
|
|
26
30
|
});
|
|
@@ -5,10 +5,11 @@ export const Gifv = BaseMediaAttachment.extend({
|
|
|
5
5
|
type: z
|
|
6
6
|
.literal("gifv")
|
|
7
7
|
.describe("The type of the attachment (Looping, soundless animation)"),
|
|
8
|
-
meta: z
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
meta: z
|
|
9
|
+
.object({
|
|
10
|
+
length: z.string().nullish(),
|
|
11
|
+
duration: z.number().nullish(),
|
|
12
|
+
fps: z.number().nullish(),
|
|
12
13
|
size: z.string({
|
|
13
14
|
description: "Video width and height in string wxh format",
|
|
14
15
|
}),
|
|
@@ -20,9 +21,9 @@ export const Gifv = BaseMediaAttachment.extend({
|
|
|
20
21
|
original: z.object({
|
|
21
22
|
width: z.number(),
|
|
22
23
|
height: z.number(),
|
|
23
|
-
frame_rate: z.string(),
|
|
24
|
-
duration: z.number(),
|
|
25
|
-
bitrate: z.number(),
|
|
24
|
+
frame_rate: z.string().nullish(),
|
|
25
|
+
duration: z.number().nullish(),
|
|
26
|
+
bitrate: z.number().nullish(),
|
|
26
27
|
}),
|
|
27
28
|
small: z
|
|
28
29
|
.object({
|
|
@@ -33,5 +34,6 @@ export const Gifv = BaseMediaAttachment.extend({
|
|
|
33
34
|
})
|
|
34
35
|
.describe("A video preview in static image")
|
|
35
36
|
.nullish(),
|
|
36
|
-
})
|
|
37
|
+
})
|
|
38
|
+
.nullish(),
|
|
37
39
|
});
|
|
@@ -5,7 +5,8 @@ export const Image = BaseMediaAttachment.extend({
|
|
|
5
5
|
type: z
|
|
6
6
|
.literal("image")
|
|
7
7
|
.describe("The type of the attachment (Static image)"),
|
|
8
|
-
meta: z
|
|
8
|
+
meta: z
|
|
9
|
+
.object({
|
|
9
10
|
original: z.object({
|
|
10
11
|
width: z.number(),
|
|
11
12
|
height: z.number(),
|
|
@@ -26,5 +27,6 @@ export const Image = BaseMediaAttachment.extend({
|
|
|
26
27
|
y: z.number(),
|
|
27
28
|
})
|
|
28
29
|
.nullish(),
|
|
29
|
-
})
|
|
30
|
+
})
|
|
31
|
+
.nullish(),
|
|
30
32
|
});
|
|
@@ -3,10 +3,11 @@ import { z } from "zod";
|
|
|
3
3
|
import { BaseMediaAttachment } from "./base.js";
|
|
4
4
|
export const Video = BaseMediaAttachment.extend({
|
|
5
5
|
type: z.literal("video").describe("The type of the attachment (Video clip)"),
|
|
6
|
-
meta: z
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
meta: z
|
|
7
|
+
.object({
|
|
8
|
+
length: z.string().nullish(),
|
|
9
|
+
duration: z.number().nullish(),
|
|
10
|
+
fps: z.number().nullish(),
|
|
10
11
|
size: z.string({
|
|
11
12
|
description: "Video width and height in string wxh format",
|
|
12
13
|
}),
|
|
@@ -15,15 +16,15 @@ export const Video = BaseMediaAttachment.extend({
|
|
|
15
16
|
aspect: z.number({
|
|
16
17
|
description: "Aspect ratio of the video (width/height)",
|
|
17
18
|
}),
|
|
18
|
-
audio_encode: z.string(),
|
|
19
|
-
audio_bitrate: z.string(),
|
|
20
|
-
audio_channels: z.string(),
|
|
19
|
+
audio_encode: z.string().nullish(),
|
|
20
|
+
audio_bitrate: z.string().nullish(),
|
|
21
|
+
audio_channels: z.string().nullish(),
|
|
21
22
|
original: z.object({
|
|
22
23
|
width: z.number(),
|
|
23
24
|
height: z.number(),
|
|
24
|
-
frame_rate: z.string(),
|
|
25
|
-
duration: z.number(),
|
|
26
|
-
bitrate: z.number(),
|
|
25
|
+
frame_rate: z.string().nullish(),
|
|
26
|
+
duration: z.number().nullish(),
|
|
27
|
+
bitrate: z.number().nullish(),
|
|
27
28
|
}),
|
|
28
29
|
small: z
|
|
29
30
|
.object({
|
|
@@ -34,5 +35,6 @@ export const Video = BaseMediaAttachment.extend({
|
|
|
34
35
|
})
|
|
35
36
|
.describe("A video preview in static image")
|
|
36
37
|
.nullish(),
|
|
37
|
-
})
|
|
38
|
+
})
|
|
39
|
+
.nullish(),
|
|
38
40
|
});
|
|
@@ -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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const Field: z.ZodObject<{
|
|
3
3
|
name: z.ZodString;
|
|
4
4
|
value: z.ZodString;
|
|
5
5
|
verified_at: z.ZodNullable<z.ZodString>;
|
|
@@ -12,4 +12,4 @@ export declare const AccountField: z.ZodObject<{
|
|
|
12
12
|
name: string;
|
|
13
13
|
verified_at: string | null;
|
|
14
14
|
}>;
|
|
15
|
-
export type
|
|
15
|
+
export type Field = z.infer<typeof Field>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const Source: z.ZodObject<{
|
|
3
|
+
note: z.ZodString;
|
|
4
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
value: z.ZodString;
|
|
7
|
+
verified_at: z.ZodNullable<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
value: string;
|
|
10
|
+
name: string;
|
|
11
|
+
verified_at: string | null;
|
|
12
|
+
}, {
|
|
13
|
+
value: string;
|
|
14
|
+
name: string;
|
|
15
|
+
verified_at: string | null;
|
|
16
|
+
}>, "many">;
|
|
17
|
+
privacy: z.ZodEnum<["public", "unlist", "private", "direct"]>;
|
|
18
|
+
sensitive: z.ZodBoolean;
|
|
19
|
+
language: z.ZodString;
|
|
20
|
+
follow_requests_count: z.ZodNumber;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
note: string;
|
|
23
|
+
fields: {
|
|
24
|
+
value: string;
|
|
25
|
+
name: string;
|
|
26
|
+
verified_at: string | null;
|
|
27
|
+
}[];
|
|
28
|
+
privacy: "public" | "unlist" | "private" | "direct";
|
|
29
|
+
sensitive: boolean;
|
|
30
|
+
language: string;
|
|
31
|
+
follow_requests_count: number;
|
|
32
|
+
}, {
|
|
33
|
+
note: string;
|
|
34
|
+
fields: {
|
|
35
|
+
value: string;
|
|
36
|
+
name: string;
|
|
37
|
+
verified_at: string | null;
|
|
38
|
+
}[];
|
|
39
|
+
privacy: "public" | "unlist" | "private" | "direct";
|
|
40
|
+
sensitive: boolean;
|
|
41
|
+
language: string;
|
|
42
|
+
follow_requests_count: number;
|
|
43
|
+
}>;
|
|
44
|
+
export type Source = z.infer<typeof Source>;
|