@llun/activities.schema 0.1.1 → 0.2.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/dist/cjs/accept.js +11 -0
- package/dist/cjs/follow.js +10 -0
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/like.js +11 -0
- package/dist/cjs/mastodon/account.js +90 -0
- package/dist/cjs/mastodon/accountField.js +18 -0
- package/dist/cjs/mastodon/customEmoji.js +24 -0
- package/dist/cjs/mastodon/filter/index.js +27 -0
- package/dist/cjs/mastodon/filter/keyword.js +12 -0
- package/dist/cjs/mastodon/filter/status.js +11 -0
- package/dist/cjs/mastodon/filterResult.js +19 -0
- package/dist/cjs/mastodon/index.js +25 -0
- package/dist/cjs/mastodon/mediaAttachment/audio.js +20 -0
- package/dist/cjs/mastodon/mediaAttachment/base.js +29 -0
- package/dist/cjs/mastodon/mediaAttachment/gifv.js +40 -0
- package/dist/cjs/mastodon/mediaAttachment/image.js +33 -0
- package/dist/cjs/mastodon/mediaAttachment/index.js +11 -0
- package/dist/cjs/mastodon/mediaAttachment/unknown.js +11 -0
- package/dist/cjs/mastodon/mediaAttachment/video.js +41 -0
- package/dist/cjs/mastodon/poll/index.js +30 -0
- package/dist/cjs/mastodon/poll/option.js +13 -0
- package/dist/cjs/mastodon/previewCard.js +37 -0
- package/dist/cjs/mastodon/status/application.js +15 -0
- package/dist/cjs/mastodon/status/base.js +99 -0
- package/dist/cjs/mastodon/status/index.js +7 -0
- package/dist/cjs/mastodon/status/mention.js +15 -0
- package/dist/cjs/mastodon/status/tag.js +13 -0
- package/dist/cjs/mastodon/status/visibility.js +6 -0
- package/dist/cjs/note/attachment.js +7 -0
- package/dist/cjs/note/baseContent.js +27 -0
- package/dist/cjs/note/document.js +14 -0
- package/dist/cjs/note/emoji.js +11 -0
- package/dist/cjs/note/image.js +9 -0
- package/dist/cjs/note/mention.js +9 -0
- package/dist/cjs/note/propertyValue.js +9 -0
- package/dist/cjs/note.js +8 -0
- package/dist/cjs/reject.js +11 -0
- package/dist/cjs/undo.js +12 -0
- package/dist/{mastodon → esm/mastodon}/account.js +2 -2
- package/dist/{mastodon → types/mastodon}/account.d.ts +20 -20
- package/dist/{mastodon → types/mastodon}/status/base.d.ts +34 -34
- package/dist/{mastodon → types/mastodon}/status/index.d.ts +82 -82
- package/package.json +12 -4
- package/src/mastodon/account.ts +2 -2
- package/tsconfig.json +0 -3
- /package/dist/{accept.js → esm/accept.js} +0 -0
- /package/dist/{follow.js → esm/follow.js} +0 -0
- /package/dist/{index.js → esm/index.js} +0 -0
- /package/dist/{like.js → esm/like.js} +0 -0
- /package/dist/{mastodon → esm/mastodon}/accountField.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/customEmoji.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/filter/index.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/filter/keyword.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/filter/status.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/filterResult.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/index.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/mediaAttachment/audio.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/mediaAttachment/base.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/mediaAttachment/gifv.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/mediaAttachment/image.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/mediaAttachment/index.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/mediaAttachment/unknown.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/mediaAttachment/video.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/poll/index.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/poll/option.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/previewCard.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/status/application.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/status/base.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/status/index.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/status/mention.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/status/tag.js +0 -0
- /package/dist/{mastodon → esm/mastodon}/status/visibility.js +0 -0
- /package/dist/{note → esm/note}/attachment.js +0 -0
- /package/dist/{note → esm/note}/baseContent.js +0 -0
- /package/dist/{note → esm/note}/document.js +0 -0
- /package/dist/{note → esm/note}/emoji.js +0 -0
- /package/dist/{note → esm/note}/image.js +0 -0
- /package/dist/{note → esm/note}/mention.js +0 -0
- /package/dist/{note → esm/note}/propertyValue.js +0 -0
- /package/dist/{note.js → esm/note.js} +0 -0
- /package/dist/{reject.js → esm/reject.js} +0 -0
- /package/dist/{undo.js → esm/undo.js} +0 -0
- /package/dist/{accept.d.ts → types/accept.d.ts} +0 -0
- /package/dist/{follow.d.ts → types/follow.d.ts} +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{like.d.ts → types/like.d.ts} +0 -0
- /package/dist/{mastodon → types/mastodon}/accountField.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/customEmoji.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/filter/index.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/filter/keyword.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/filter/status.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/filterResult.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/index.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/mediaAttachment/audio.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/mediaAttachment/base.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/mediaAttachment/gifv.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/mediaAttachment/image.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/mediaAttachment/index.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/mediaAttachment/unknown.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/mediaAttachment/video.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/poll/index.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/poll/option.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/previewCard.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/status/application.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/status/mention.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/status/tag.d.ts +0 -0
- /package/dist/{mastodon → types/mastodon}/status/visibility.d.ts +0 -0
- /package/dist/{note → types/note}/attachment.d.ts +0 -0
- /package/dist/{note → types/note}/baseContent.d.ts +0 -0
- /package/dist/{note → types/note}/document.d.ts +0 -0
- /package/dist/{note → types/note}/emoji.d.ts +0 -0
- /package/dist/{note → types/note}/image.d.ts +0 -0
- /package/dist/{note → types/note}/mention.d.ts +0 -0
- /package/dist/{note → types/note}/propertyValue.d.ts +0 -0
- /package/dist/{note.d.ts → types/note.d.ts} +0 -0
- /package/dist/{reject.d.ts → types/reject.d.ts} +0 -0
- /package/dist/{undo.d.ts → types/undo.d.ts} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Accept = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const follow_js_1 = require("./follow.js");
|
|
6
|
+
exports.Accept = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
actor: zod_1.z.string(),
|
|
9
|
+
type: zod_1.z.literal("Accept"),
|
|
10
|
+
object: follow_js_1.Follow,
|
|
11
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Follow = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.Follow = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string(),
|
|
7
|
+
type: zod_1.z.literal("Follow"),
|
|
8
|
+
actor: zod_1.z.string(),
|
|
9
|
+
object: zod_1.z.string(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Mastodon = void 0;
|
|
18
|
+
__exportStar(require("./accept.js"), exports);
|
|
19
|
+
__exportStar(require("./follow.js"), exports);
|
|
20
|
+
__exportStar(require("./like.js"), exports);
|
|
21
|
+
__exportStar(require("./note.js"), exports);
|
|
22
|
+
__exportStar(require("./reject.js"), exports);
|
|
23
|
+
__exportStar(require("./undo.js"), exports);
|
|
24
|
+
exports.Mastodon = require("./mastodon/index.js");
|
package/dist/cjs/like.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Like = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const note_js_1 = require("./note.js");
|
|
6
|
+
exports.Like = zod_1.z.object({
|
|
7
|
+
type: zod_1.z.literal("Like"),
|
|
8
|
+
id: zod_1.z.string(),
|
|
9
|
+
actor: zod_1.z.string(),
|
|
10
|
+
object: zod_1.z.union([zod_1.z.string(), note_js_1.Note]),
|
|
11
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Account = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Account/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const accountField_js_1 = require("./accountField.js");
|
|
7
|
+
const customEmoji_js_1 = require("./customEmoji.js");
|
|
8
|
+
const BaseAccount = zod_1.z.object({
|
|
9
|
+
id: zod_1.z.string({
|
|
10
|
+
description: "This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI",
|
|
11
|
+
}),
|
|
12
|
+
username: zod_1.z.string({
|
|
13
|
+
description: "The username of the actor, not including domain",
|
|
14
|
+
}),
|
|
15
|
+
acct: zod_1.z.string({
|
|
16
|
+
description: "The Webfinger actor URI. Equal to username for local users, or username@domain for remote users",
|
|
17
|
+
}),
|
|
18
|
+
url: zod_1.z.string({
|
|
19
|
+
description: "The location of the user's profile page",
|
|
20
|
+
}),
|
|
21
|
+
display_name: zod_1.z.string({
|
|
22
|
+
description: "The profile's display name",
|
|
23
|
+
}),
|
|
24
|
+
note: zod_1.z.string({
|
|
25
|
+
description: "The profile's bio or description",
|
|
26
|
+
}),
|
|
27
|
+
avatar: zod_1.z.string({
|
|
28
|
+
description: "An image URL icon that is shown next to statuses and in the profile",
|
|
29
|
+
}),
|
|
30
|
+
avatar_static: zod_1.z.string({
|
|
31
|
+
description: "A static version of the `avatar`. Equal to `avatar` if its value is a static image; different if `avatar` is an animated GIF",
|
|
32
|
+
}),
|
|
33
|
+
header: zod_1.z.string({
|
|
34
|
+
description: "An image banner URL that is shown above the profile and in profile cards.",
|
|
35
|
+
}),
|
|
36
|
+
header_static: zod_1.z.string({
|
|
37
|
+
description: "A static version of the `header`. Equal to `header` if its value is a static image; different if `header` is an animated GIF",
|
|
38
|
+
}),
|
|
39
|
+
locked: zod_1.z.boolean({
|
|
40
|
+
description: "Whether the actor manually approves follow requests",
|
|
41
|
+
}),
|
|
42
|
+
fields: accountField_js_1.AccountField.array().describe("Additional metadata attached to a profile as name-value pairs"),
|
|
43
|
+
emojis: customEmoji_js_1.CustomEmoji.array().describe("Custom emoji entities to be used when rendering the profile"),
|
|
44
|
+
bot: zod_1.z.boolean({
|
|
45
|
+
description: "Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot",
|
|
46
|
+
}),
|
|
47
|
+
group: zod_1.z.boolean({
|
|
48
|
+
description: "Indicates that the actor represents a Group actor",
|
|
49
|
+
}),
|
|
50
|
+
discoverable: zod_1.z
|
|
51
|
+
.boolean({
|
|
52
|
+
description: "Whether the actor has opted into discovery features such as the profile directory",
|
|
53
|
+
})
|
|
54
|
+
.nullable(),
|
|
55
|
+
noindex: zod_1.z
|
|
56
|
+
.boolean({
|
|
57
|
+
description: "Whether the local user has opted out of being indexed by search engines",
|
|
58
|
+
})
|
|
59
|
+
.nullish(),
|
|
60
|
+
suspended: zod_1.z
|
|
61
|
+
.boolean({
|
|
62
|
+
description: "An extra attribute returned only when an actor is suspended",
|
|
63
|
+
})
|
|
64
|
+
.optional(),
|
|
65
|
+
limited: zod_1.z
|
|
66
|
+
.boolean({
|
|
67
|
+
description: "An extra attribute returned only when an actor is silenced. If true, indicates that the actor should be hidden behind a warning screen.",
|
|
68
|
+
})
|
|
69
|
+
.optional(),
|
|
70
|
+
created_at: zod_1.z.string({
|
|
71
|
+
description: "The time the actor was created in ISO 8601 Datetime format",
|
|
72
|
+
}),
|
|
73
|
+
last_status_at: zod_1.z
|
|
74
|
+
.string({
|
|
75
|
+
description: "The time when the most recent status was posted in ISO 8601 Datetime format",
|
|
76
|
+
})
|
|
77
|
+
.nullable(),
|
|
78
|
+
statuses_count: zod_1.z.number({
|
|
79
|
+
description: "How many statuses are attached to this actor",
|
|
80
|
+
}),
|
|
81
|
+
followers_count: zod_1.z.number({
|
|
82
|
+
description: "The reported followers of this profile",
|
|
83
|
+
}),
|
|
84
|
+
following_count: zod_1.z.number({
|
|
85
|
+
description: "The reported follows of this profile",
|
|
86
|
+
}),
|
|
87
|
+
});
|
|
88
|
+
exports.Account = BaseAccount.extend({
|
|
89
|
+
moved: BaseAccount.nullish().describe("Indicates that the profile is currently inactive and that its user has moved to a new account"),
|
|
90
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountField = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Account/#Field
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.AccountField = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string({
|
|
8
|
+
description: "The key of a given field’s key-value pair",
|
|
9
|
+
}),
|
|
10
|
+
value: zod_1.z.string({
|
|
11
|
+
description: "The value associated with the `name` key.",
|
|
12
|
+
}),
|
|
13
|
+
verified_at: zod_1.z
|
|
14
|
+
.string({
|
|
15
|
+
description: 'Timestamp of when the server verified a URL value for a rel="me" link in ISO 8601 Date time format',
|
|
16
|
+
})
|
|
17
|
+
.nullable(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomEmoji = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/CustomEmoji/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.CustomEmoji = zod_1.z.object({
|
|
7
|
+
shortcode: zod_1.z.string({
|
|
8
|
+
description: "The name of the custom emoji",
|
|
9
|
+
}),
|
|
10
|
+
static_url: zod_1.z.string({
|
|
11
|
+
description: "A link to a static copy of the custom emoji",
|
|
12
|
+
}),
|
|
13
|
+
url: zod_1.z.string({
|
|
14
|
+
description: "A link to the custom emoji",
|
|
15
|
+
}),
|
|
16
|
+
visible_in_picker: zod_1.z.boolean({
|
|
17
|
+
description: "Whether this Emoji should be visible in the picker or unlisted",
|
|
18
|
+
}),
|
|
19
|
+
category: zod_1.z
|
|
20
|
+
.string({
|
|
21
|
+
description: "Used for sorting custom emoji in the picker",
|
|
22
|
+
})
|
|
23
|
+
.nullable(),
|
|
24
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Filter = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Filter/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const keyword_js_1 = require("./keyword.js");
|
|
7
|
+
const status_js_1 = require("./status.js");
|
|
8
|
+
exports.Filter = zod_1.z.object({
|
|
9
|
+
id: zod_1.z.string({ description: "The ID of the Filter in the database" }),
|
|
10
|
+
title: zod_1.z.string({
|
|
11
|
+
description: "A title given by the user to name the filter",
|
|
12
|
+
}),
|
|
13
|
+
context: zod_1.z
|
|
14
|
+
.enum(["home", "notifications", "public", "thread", "account"])
|
|
15
|
+
.array()
|
|
16
|
+
.describe("The contexts in which the filter should be applied"),
|
|
17
|
+
expires_at: zod_1.z
|
|
18
|
+
.string({
|
|
19
|
+
description: "When the filter should no longer be applied in ISO 8601 Datetime format or null if the filter does not expire",
|
|
20
|
+
})
|
|
21
|
+
.nullable(),
|
|
22
|
+
filter_action: zod_1.z
|
|
23
|
+
.enum(["warn", "hide"])
|
|
24
|
+
.describe("The action to be taken when a status matches this filter"),
|
|
25
|
+
keywords: keyword_js_1.FilterKeyword.array().describe("The keywords grouped under this filter"),
|
|
26
|
+
statuses: status_js_1.FilterStatus.array().describe("The statuses grouped under this filter"),
|
|
27
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterKeyword = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/FilterKeyword/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.FilterKeyword = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string({ description: "The ID of the FilterKeyword in the database" }),
|
|
8
|
+
keyword: zod_1.z.string({ description: "The phrase to be matched against" }),
|
|
9
|
+
whole_word: zod_1.z.boolean({
|
|
10
|
+
description: "Should the filter consider word boundaries? See [implementation guidelines for filters](https://docs.joinmastodon.org/api/guidelines/#filters)",
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterStatus = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/FilterStatus/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.FilterStatus = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string({ description: "The ID of the FilterStatus in the database" }),
|
|
8
|
+
status_id: zod_1.z.string({
|
|
9
|
+
description: "The ID of the Status that will be filtered",
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterResult = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/FilterResult/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const index_js_1 = require("./filter/index.js");
|
|
7
|
+
exports.FilterResult = zod_1.z.object({
|
|
8
|
+
filter: index_js_1.Filter.describe("The filter that was matched"),
|
|
9
|
+
keyword_matches: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.array()
|
|
12
|
+
.nullable()
|
|
13
|
+
.describe("The keyword within the filter that was matched"),
|
|
14
|
+
status_matches: zod_1.z
|
|
15
|
+
.string()
|
|
16
|
+
.array()
|
|
17
|
+
.nullable()
|
|
18
|
+
.describe("The status ID within the filter that was matched"),
|
|
19
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./account.js"), exports);
|
|
18
|
+
__exportStar(require("./accountField.js"), exports);
|
|
19
|
+
__exportStar(require("./customEmoji.js"), exports);
|
|
20
|
+
__exportStar(require("./filterResult.js"), exports);
|
|
21
|
+
__exportStar(require("./previewCard.js"), exports);
|
|
22
|
+
__exportStar(require("./filter/index.js"), exports);
|
|
23
|
+
__exportStar(require("./mediaAttachment/index.js"), exports);
|
|
24
|
+
__exportStar(require("./poll/index.js"), exports);
|
|
25
|
+
__exportStar(require("./status/index.js"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Audio = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/#audio
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const base_js_1 = require("./base.js");
|
|
7
|
+
exports.Audio = base_js_1.BaseMediaAttachment.extend({
|
|
8
|
+
type: zod_1.z.literal("audio").describe("The type of the attachment (Audio track)"),
|
|
9
|
+
meta: zod_1.z.object({
|
|
10
|
+
length: zod_1.z.string(),
|
|
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(),
|
|
15
|
+
original: zod_1.z.object({
|
|
16
|
+
duration: zod_1.z.number(),
|
|
17
|
+
bitrate: zod_1.z.number(),
|
|
18
|
+
}),
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseMediaAttachment = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.BaseMediaAttachment = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string({
|
|
8
|
+
description: "The ID of the attachment in the database",
|
|
9
|
+
}),
|
|
10
|
+
url: zod_1.z.string({
|
|
11
|
+
description: "The location of the original full-size attachment",
|
|
12
|
+
}),
|
|
13
|
+
preview_url: zod_1.z.string({
|
|
14
|
+
description: "The location of a scaled-down preview of the attachment",
|
|
15
|
+
}),
|
|
16
|
+
remote_url: zod_1.z
|
|
17
|
+
.string({
|
|
18
|
+
description: "The location of the full-size original attachment on the remote website",
|
|
19
|
+
})
|
|
20
|
+
.nullable(),
|
|
21
|
+
description: zod_1.z
|
|
22
|
+
.string({
|
|
23
|
+
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
|
+
})
|
|
25
|
+
.nullable(),
|
|
26
|
+
bluehash: zod_1.z.string({
|
|
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.",
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Gifv = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/#gifv
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const base_js_1 = require("./base.js");
|
|
7
|
+
exports.Gifv = base_js_1.BaseMediaAttachment.extend({
|
|
8
|
+
type: zod_1.z
|
|
9
|
+
.literal("gifv")
|
|
10
|
+
.describe("The type of the attachment (Looping, soundless animation)"),
|
|
11
|
+
meta: zod_1.z.object({
|
|
12
|
+
length: zod_1.z.string(),
|
|
13
|
+
duration: zod_1.z.number(),
|
|
14
|
+
fps: zod_1.z.number(),
|
|
15
|
+
size: zod_1.z.string({
|
|
16
|
+
description: "Video width and height in string wxh format",
|
|
17
|
+
}),
|
|
18
|
+
width: zod_1.z.number(),
|
|
19
|
+
height: zod_1.z.number(),
|
|
20
|
+
aspect: zod_1.z.number({
|
|
21
|
+
description: "Aspect ratio of the video (width/height)",
|
|
22
|
+
}),
|
|
23
|
+
original: zod_1.z.object({
|
|
24
|
+
width: zod_1.z.number(),
|
|
25
|
+
height: zod_1.z.number(),
|
|
26
|
+
frame_rate: zod_1.z.string(),
|
|
27
|
+
duration: zod_1.z.number(),
|
|
28
|
+
bitrate: zod_1.z.number(),
|
|
29
|
+
}),
|
|
30
|
+
small: zod_1.z
|
|
31
|
+
.object({
|
|
32
|
+
width: zod_1.z.number(),
|
|
33
|
+
height: zod_1.z.number(),
|
|
34
|
+
size: zod_1.z.string(),
|
|
35
|
+
aspect: zod_1.z.number(),
|
|
36
|
+
})
|
|
37
|
+
.describe("A video preview in static image")
|
|
38
|
+
.nullish(),
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Image = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/#image
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const base_js_1 = require("./base.js");
|
|
7
|
+
exports.Image = base_js_1.BaseMediaAttachment.extend({
|
|
8
|
+
type: zod_1.z
|
|
9
|
+
.literal("image")
|
|
10
|
+
.describe("The type of the attachment (Static image)"),
|
|
11
|
+
meta: zod_1.z.object({
|
|
12
|
+
original: zod_1.z.object({
|
|
13
|
+
width: zod_1.z.number(),
|
|
14
|
+
height: zod_1.z.number(),
|
|
15
|
+
size: zod_1.z.string(),
|
|
16
|
+
aspect: zod_1.z.number(),
|
|
17
|
+
}),
|
|
18
|
+
small: zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
width: zod_1.z.number(),
|
|
21
|
+
height: zod_1.z.number(),
|
|
22
|
+
size: zod_1.z.string(),
|
|
23
|
+
aspect: zod_1.z.number(),
|
|
24
|
+
})
|
|
25
|
+
.nullish(),
|
|
26
|
+
focus: zod_1.z
|
|
27
|
+
.object({
|
|
28
|
+
x: zod_1.z.number(),
|
|
29
|
+
y: zod_1.z.number(),
|
|
30
|
+
})
|
|
31
|
+
.nullish(),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MediaAttachment = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const gifv_js_1 = require("./gifv.js");
|
|
7
|
+
const image_js_1 = require("./image.js");
|
|
8
|
+
const video_js_1 = require("./video.js");
|
|
9
|
+
const audio_js_1 = require("./audio.js");
|
|
10
|
+
const unknown_js_1 = require("./unknown.js");
|
|
11
|
+
exports.MediaAttachment = zod_1.z.union([image_js_1.Image, gifv_js_1.Gifv, video_js_1.Video, audio_js_1.Audio, unknown_js_1.Unknown]);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Unknown = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const base_js_1 = require("./base.js");
|
|
7
|
+
exports.Unknown = base_js_1.BaseMediaAttachment.extend({
|
|
8
|
+
type: zod_1.z
|
|
9
|
+
.literal("unknown")
|
|
10
|
+
.describe("The type of the attachment (unsupported or unrecognized file type)"),
|
|
11
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Video = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/#video
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const base_js_1 = require("./base.js");
|
|
7
|
+
exports.Video = base_js_1.BaseMediaAttachment.extend({
|
|
8
|
+
type: zod_1.z.literal("video").describe("The type of the attachment (Video clip)"),
|
|
9
|
+
meta: zod_1.z.object({
|
|
10
|
+
length: zod_1.z.string(),
|
|
11
|
+
duration: zod_1.z.number(),
|
|
12
|
+
fps: zod_1.z.number(),
|
|
13
|
+
size: zod_1.z.string({
|
|
14
|
+
description: "Video width and height in string wxh format",
|
|
15
|
+
}),
|
|
16
|
+
width: zod_1.z.number(),
|
|
17
|
+
height: zod_1.z.number(),
|
|
18
|
+
aspect: zod_1.z.number({
|
|
19
|
+
description: "Aspect ratio of the video (width/height)",
|
|
20
|
+
}),
|
|
21
|
+
audio_encode: zod_1.z.string(),
|
|
22
|
+
audio_bitrate: zod_1.z.string(),
|
|
23
|
+
audio_channels: zod_1.z.string(),
|
|
24
|
+
original: zod_1.z.object({
|
|
25
|
+
width: zod_1.z.number(),
|
|
26
|
+
height: zod_1.z.number(),
|
|
27
|
+
frame_rate: zod_1.z.string(),
|
|
28
|
+
duration: zod_1.z.number(),
|
|
29
|
+
bitrate: zod_1.z.number(),
|
|
30
|
+
}),
|
|
31
|
+
small: zod_1.z
|
|
32
|
+
.object({
|
|
33
|
+
width: zod_1.z.number(),
|
|
34
|
+
height: zod_1.z.number(),
|
|
35
|
+
size: zod_1.z.string(),
|
|
36
|
+
aspect: zod_1.z.number(),
|
|
37
|
+
})
|
|
38
|
+
.describe("A video preview in static image")
|
|
39
|
+
.nullish(),
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Poll = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Poll/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const customEmoji_js_1 = require("../customEmoji.js");
|
|
7
|
+
const option_js_1 = require("./option.js");
|
|
8
|
+
exports.Poll = zod_1.z.object({
|
|
9
|
+
id: zod_1.z.string({ description: "The ID of the poll in the database" }),
|
|
10
|
+
expires_at: zod_1.z
|
|
11
|
+
.string({
|
|
12
|
+
description: "The time the poll ends in ISO 8601 datetime or null if the poll does not end",
|
|
13
|
+
})
|
|
14
|
+
.nullable(),
|
|
15
|
+
expired: zod_1.z.boolean({ description: "Whether the poll has expired" }),
|
|
16
|
+
multiple: zod_1.z.boolean({ description: "Whether multiple choices are allowed" }),
|
|
17
|
+
votes_count: zod_1.z.number({ description: "The number of votes the poll has" }),
|
|
18
|
+
voters_count: zod_1.z.number({ description: "The number of actors that voted" }),
|
|
19
|
+
options: option_js_1.Option.array().describe("Possible answers for the poll"),
|
|
20
|
+
emojis: customEmoji_js_1.CustomEmoji.array().describe("Custom emoji to be used for rendering poll options"),
|
|
21
|
+
voted: zod_1.z
|
|
22
|
+
.boolean({
|
|
23
|
+
description: "When called with a user token, has the authorized user voted?",
|
|
24
|
+
})
|
|
25
|
+
.optional(),
|
|
26
|
+
own_votes: zod_1.z
|
|
27
|
+
.number()
|
|
28
|
+
.array()
|
|
29
|
+
.describe("When called with a user token, which options has the authorized user chosen? Contains an array of index values for `options`"),
|
|
30
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Option = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Poll/#Option
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.Option = zod_1.z.object({
|
|
7
|
+
title: zod_1.z.string({ description: "The text value of the poll option" }),
|
|
8
|
+
votes_count: zod_1.z
|
|
9
|
+
.number({
|
|
10
|
+
description: "The number of votes the poll option has or null if the results are not published yet",
|
|
11
|
+
})
|
|
12
|
+
.nullable(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreviewCard = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/PreviewCard/
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.PreviewCard = zod_1.z.object({
|
|
7
|
+
url: zod_1.z.string({ description: "Location of linked resource" }),
|
|
8
|
+
title: zod_1.z.string({ description: "Title of linked resource" }),
|
|
9
|
+
description: zod_1.z.string({ description: "Description of preview" }),
|
|
10
|
+
type: zod_1.z.enum(["link", "photo", "video", "rich"], {
|
|
11
|
+
description: "The type of the preview card",
|
|
12
|
+
}),
|
|
13
|
+
author_name: zod_1.z.string({ description: "The author of the original resource" }),
|
|
14
|
+
author_url: zod_1.z.string({
|
|
15
|
+
description: "A link to the author of the original resource",
|
|
16
|
+
}),
|
|
17
|
+
provider_name: zod_1.z.string({
|
|
18
|
+
description: "The provider of the original resource",
|
|
19
|
+
}),
|
|
20
|
+
provider_url: zod_1.z.string({
|
|
21
|
+
description: "A link to the provider of the original resource",
|
|
22
|
+
}),
|
|
23
|
+
html: zod_1.z.string({
|
|
24
|
+
description: "HTML to be used for generating the preview card",
|
|
25
|
+
}),
|
|
26
|
+
width: zod_1.z.number({ description: "Width of preview, in pixels" }),
|
|
27
|
+
height: zod_1.z.number({ description: "Height of preview, in pixels" }),
|
|
28
|
+
image: zod_1.z.string({ description: "Preview thumbnail url" }).nullable(),
|
|
29
|
+
embed_url: zod_1.z.string({
|
|
30
|
+
description: "Used for photo embeds, instead of custom html",
|
|
31
|
+
}),
|
|
32
|
+
blurhash: zod_1.z
|
|
33
|
+
.string({
|
|
34
|
+
description: "A 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(),
|
|
37
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Application = void 0;
|
|
4
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Status/#application
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.Application = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string({
|
|
8
|
+
description: "The name of the application that posted this status",
|
|
9
|
+
}),
|
|
10
|
+
website: zod_1.z
|
|
11
|
+
.string({
|
|
12
|
+
description: "The website associated with the application that posted this status",
|
|
13
|
+
})
|
|
14
|
+
.nullable(),
|
|
15
|
+
});
|