@llun/activities.schema 0.2.20 → 0.2.21
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 +29 -0
- package/dist/cjs/mastodon/account.js +7 -2
- package/dist/cjs/mastodon/index.js +2 -1
- package/dist/esm/mastodon/{accountField.js → account/field.js} +1 -1
- package/dist/esm/mastodon/account/source.js +26 -0
- package/dist/esm/mastodon/account.js +7 -2
- package/dist/esm/mastodon/index.js +2 -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/status/base.d.ts +290 -74
- package/dist/types/mastodon/status/index.d.ts +666 -182
- package/package.json +1 -1
- package/src/mastodon/{accountField.ts → account/field.ts} +2 -2
- package/src/mastodon/account/source.ts +28 -0
- package/src/mastodon/account.ts +9 -2
- package/src/mastodon/index.ts +2 -1
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,28 @@
|
|
|
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
|
+
|
|
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: z
|
|
11
|
+
.union([
|
|
12
|
+
z.literal("public").describe("Public post"),
|
|
13
|
+
z.literal("unlisted").describe("Unlisted post"),
|
|
14
|
+
z.literal("private").describe("Followers-only post"),
|
|
15
|
+
z.literal("direct").describe("Direct post"),
|
|
16
|
+
])
|
|
17
|
+
.describe("The default post privacy to be used for new statuses."),
|
|
18
|
+
sensitive: z.boolean({
|
|
19
|
+
description: "Whether new statuses should be marked sensitive by default",
|
|
20
|
+
}),
|
|
21
|
+
language: z.string({
|
|
22
|
+
description: "The default posting language for new statuses",
|
|
23
|
+
}),
|
|
24
|
+
follow_requests_count: z.number({
|
|
25
|
+
description: "The number of pending follow requests",
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
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