@llun/activities.schema 0.4.1 → 0.4.2
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/cjs/content.js +86 -0
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/like.js +2 -2
- package/dist/esm/content.js +83 -0
- package/dist/esm/index.js +1 -2
- package/dist/esm/like.js +1 -1
- package/dist/types/content.d.ts +619 -0
- package/dist/types/index.d.ts +1 -2
- package/package.json +2 -2
- package/src/content.ts +100 -0
- package/src/index.ts +1 -2
- package/src/like.ts +1 -1
- package/dist/cjs/note.js +0 -9
- package/dist/cjs/question.js +0 -31
- package/dist/esm/note.js +0 -6
- package/dist/esm/question.js +0 -28
- package/dist/types/note.d.ts +0 -95
- package/dist/types/question.d.ts +0 -114
- package/src/note.ts +0 -8
- package/src/question.ts +0 -35
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VideoContent = exports.ArticleContent = exports.PageContent = exports.ImageContent = exports.Question = exports.ENTITY_TYPE_QUESTION = exports.Note = exports.ENTITY_TYPE_NOTE = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const baseContent_js_1 = require("./note/baseContent.js");
|
|
6
|
+
const note_js_1 = require("./question/note.js");
|
|
7
|
+
/**
|
|
8
|
+
* Note content type - the standard ActivityPub content type.
|
|
9
|
+
*/
|
|
10
|
+
exports.ENTITY_TYPE_NOTE = "Note";
|
|
11
|
+
exports.Note = baseContent_js_1.BaseContent.extend({
|
|
12
|
+
type: zod_1.z.literal(exports.ENTITY_TYPE_NOTE),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Question content type for polls.
|
|
16
|
+
*/
|
|
17
|
+
exports.ENTITY_TYPE_QUESTION = "Question";
|
|
18
|
+
exports.Question = baseContent_js_1.BaseContent.extend({
|
|
19
|
+
type: zod_1.z.literal(exports.ENTITY_TYPE_QUESTION),
|
|
20
|
+
endTime: zod_1.z
|
|
21
|
+
.string()
|
|
22
|
+
.describe("Question end time in ISO 8601 datetime format")
|
|
23
|
+
.optional(),
|
|
24
|
+
closed: zod_1.z
|
|
25
|
+
.string()
|
|
26
|
+
.describe("The datetime when the poll was closed, in ISO 8601 format. Used when a poll is closed early")
|
|
27
|
+
.nullish(),
|
|
28
|
+
// Single-choice poll options (mutually exclusive with anyOf)
|
|
29
|
+
oneOf: note_js_1.Note.array()
|
|
30
|
+
.describe("Poll options for single-choice polls")
|
|
31
|
+
.optional(),
|
|
32
|
+
// Multiple-choice poll options (mutually exclusive with oneOf)
|
|
33
|
+
anyOf: note_js_1.Note.array()
|
|
34
|
+
.describe("Poll options for multiple-choice polls")
|
|
35
|
+
.optional(),
|
|
36
|
+
// Misskey extension for total unique voters
|
|
37
|
+
votersCount: zod_1.z
|
|
38
|
+
.number()
|
|
39
|
+
.describe("Total number of unique voters (Misskey extension)")
|
|
40
|
+
.optional(),
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Image content type used by Pixelfed and similar services.
|
|
44
|
+
* Extends BaseContent with image-specific properties.
|
|
45
|
+
*/
|
|
46
|
+
exports.ImageContent = baseContent_js_1.BaseContent.extend({
|
|
47
|
+
type: zod_1.z.literal("Image"),
|
|
48
|
+
name: zod_1.z.string().nullish(),
|
|
49
|
+
mediaType: zod_1.z.string().nullish(),
|
|
50
|
+
width: zod_1.z.number().nullish(),
|
|
51
|
+
height: zod_1.z.number().nullish(),
|
|
52
|
+
blurhash: zod_1.z.string().nullish(),
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Page content type used by WriteFreely and similar services.
|
|
56
|
+
*/
|
|
57
|
+
exports.PageContent = baseContent_js_1.BaseContent.extend({
|
|
58
|
+
type: zod_1.z.literal("Page"),
|
|
59
|
+
name: zod_1.z.string().nullish(),
|
|
60
|
+
mediaType: zod_1.z.string().nullish(),
|
|
61
|
+
width: zod_1.z.number().nullish(),
|
|
62
|
+
height: zod_1.z.number().nullish(),
|
|
63
|
+
blurhash: zod_1.z.string().nullish(),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Article content type used by blogs and similar services.
|
|
67
|
+
*/
|
|
68
|
+
exports.ArticleContent = baseContent_js_1.BaseContent.extend({
|
|
69
|
+
type: zod_1.z.literal("Article"),
|
|
70
|
+
name: zod_1.z.string().nullish(),
|
|
71
|
+
mediaType: zod_1.z.string().nullish(),
|
|
72
|
+
width: zod_1.z.number().nullish(),
|
|
73
|
+
height: zod_1.z.number().nullish(),
|
|
74
|
+
blurhash: zod_1.z.string().nullish(),
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Video content type used by PeerTube and similar services.
|
|
78
|
+
*/
|
|
79
|
+
exports.VideoContent = baseContent_js_1.BaseContent.extend({
|
|
80
|
+
type: zod_1.z.literal("Video"),
|
|
81
|
+
name: zod_1.z.string().nullish(),
|
|
82
|
+
mediaType: zod_1.z.string().nullish(),
|
|
83
|
+
width: zod_1.z.number().nullish(),
|
|
84
|
+
height: zod_1.z.number().nullish(),
|
|
85
|
+
blurhash: zod_1.z.string().nullish(),
|
|
86
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,9 +18,8 @@ exports.Mastodon = exports.QuestionOption = void 0;
|
|
|
18
18
|
__exportStar(require("./accept.js"), exports);
|
|
19
19
|
__exportStar(require("./follow.js"), exports);
|
|
20
20
|
__exportStar(require("./like.js"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./content.js"), exports);
|
|
22
22
|
__exportStar(require("./collection.js"), exports);
|
|
23
|
-
__exportStar(require("./question.js"), exports);
|
|
24
23
|
__exportStar(require("./reject.js"), exports);
|
|
25
24
|
__exportStar(require("./undo.js"), exports);
|
|
26
25
|
__exportStar(require("./announce.js"), exports);
|
package/dist/cjs/like.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Like = exports.ENTITY_TYPE_LIKE = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const content_js_1 = require("./content.js");
|
|
6
6
|
exports.ENTITY_TYPE_LIKE = "Like";
|
|
7
7
|
exports.Like = zod_1.z.object({
|
|
8
8
|
type: zod_1.z.literal(exports.ENTITY_TYPE_LIKE),
|
|
9
9
|
id: zod_1.z.string(),
|
|
10
10
|
actor: zod_1.z.string(),
|
|
11
|
-
object: zod_1.z.union([zod_1.z.string(),
|
|
11
|
+
object: zod_1.z.union([zod_1.z.string(), content_js_1.Note]),
|
|
12
12
|
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseContent } from "./note/baseContent.js";
|
|
3
|
+
import { Note as QuestionOptionNote } from "./question/note.js";
|
|
4
|
+
/**
|
|
5
|
+
* Note content type - the standard ActivityPub content type.
|
|
6
|
+
*/
|
|
7
|
+
export const ENTITY_TYPE_NOTE = "Note";
|
|
8
|
+
export const Note = BaseContent.extend({
|
|
9
|
+
type: z.literal(ENTITY_TYPE_NOTE),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Question content type for polls.
|
|
13
|
+
*/
|
|
14
|
+
export const ENTITY_TYPE_QUESTION = "Question";
|
|
15
|
+
export const Question = BaseContent.extend({
|
|
16
|
+
type: z.literal(ENTITY_TYPE_QUESTION),
|
|
17
|
+
endTime: z
|
|
18
|
+
.string()
|
|
19
|
+
.describe("Question end time in ISO 8601 datetime format")
|
|
20
|
+
.optional(),
|
|
21
|
+
closed: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe("The datetime when the poll was closed, in ISO 8601 format. Used when a poll is closed early")
|
|
24
|
+
.nullish(),
|
|
25
|
+
// Single-choice poll options (mutually exclusive with anyOf)
|
|
26
|
+
oneOf: QuestionOptionNote.array()
|
|
27
|
+
.describe("Poll options for single-choice polls")
|
|
28
|
+
.optional(),
|
|
29
|
+
// Multiple-choice poll options (mutually exclusive with oneOf)
|
|
30
|
+
anyOf: QuestionOptionNote.array()
|
|
31
|
+
.describe("Poll options for multiple-choice polls")
|
|
32
|
+
.optional(),
|
|
33
|
+
// Misskey extension for total unique voters
|
|
34
|
+
votersCount: z
|
|
35
|
+
.number()
|
|
36
|
+
.describe("Total number of unique voters (Misskey extension)")
|
|
37
|
+
.optional(),
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Image content type used by Pixelfed and similar services.
|
|
41
|
+
* Extends BaseContent with image-specific properties.
|
|
42
|
+
*/
|
|
43
|
+
export const ImageContent = BaseContent.extend({
|
|
44
|
+
type: z.literal("Image"),
|
|
45
|
+
name: z.string().nullish(),
|
|
46
|
+
mediaType: z.string().nullish(),
|
|
47
|
+
width: z.number().nullish(),
|
|
48
|
+
height: z.number().nullish(),
|
|
49
|
+
blurhash: z.string().nullish(),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Page content type used by WriteFreely and similar services.
|
|
53
|
+
*/
|
|
54
|
+
export const PageContent = BaseContent.extend({
|
|
55
|
+
type: z.literal("Page"),
|
|
56
|
+
name: z.string().nullish(),
|
|
57
|
+
mediaType: z.string().nullish(),
|
|
58
|
+
width: z.number().nullish(),
|
|
59
|
+
height: z.number().nullish(),
|
|
60
|
+
blurhash: z.string().nullish(),
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* Article content type used by blogs and similar services.
|
|
64
|
+
*/
|
|
65
|
+
export const ArticleContent = BaseContent.extend({
|
|
66
|
+
type: z.literal("Article"),
|
|
67
|
+
name: z.string().nullish(),
|
|
68
|
+
mediaType: z.string().nullish(),
|
|
69
|
+
width: z.number().nullish(),
|
|
70
|
+
height: z.number().nullish(),
|
|
71
|
+
blurhash: z.string().nullish(),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Video content type used by PeerTube and similar services.
|
|
75
|
+
*/
|
|
76
|
+
export const VideoContent = BaseContent.extend({
|
|
77
|
+
type: z.literal("Video"),
|
|
78
|
+
name: z.string().nullish(),
|
|
79
|
+
mediaType: z.string().nullish(),
|
|
80
|
+
width: z.number().nullish(),
|
|
81
|
+
height: z.number().nullish(),
|
|
82
|
+
blurhash: z.string().nullish(),
|
|
83
|
+
});
|
package/dist/esm/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from "./accept.js";
|
|
2
2
|
export * from "./follow.js";
|
|
3
3
|
export * from "./like.js";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./content.js";
|
|
5
5
|
export * from "./collection.js";
|
|
6
|
-
export * from "./question.js";
|
|
7
6
|
export * from "./reject.js";
|
|
8
7
|
export * from "./undo.js";
|
|
9
8
|
export * from "./announce.js";
|
package/dist/esm/like.js
CHANGED
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Note content type - the standard ActivityPub content type.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENTITY_TYPE_NOTE = "Note";
|
|
6
|
+
export declare const Note: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
attributedTo: z.ZodString;
|
|
10
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
11
|
+
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
12
|
+
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
15
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
16
|
+
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
17
|
+
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
type: z.ZodLiteral<"Collection">;
|
|
20
|
+
first: z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"CollectionPage">;
|
|
22
|
+
next: z.ZodString;
|
|
23
|
+
partOf: z.ZodString;
|
|
24
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
type: z.ZodLiteral<"Collection">;
|
|
29
|
+
totalItems: z.ZodNumber;
|
|
30
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
31
|
+
}, z.core.$strip>]>>>;
|
|
32
|
+
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
33
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
value: z.ZodString;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
type: z.ZodLiteral<"Document">;
|
|
38
|
+
mediaType: z.ZodString;
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
41
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
44
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
45
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
value: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"Document">;
|
|
51
|
+
mediaType: z.ZodString;
|
|
52
|
+
url: z.ZodString;
|
|
53
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
54
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
57
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
58
|
+
}, z.core.$strip>]>>]>>>;
|
|
59
|
+
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"Mention">;
|
|
61
|
+
href: z.ZodString;
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"Emoji">;
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
updated: z.ZodString;
|
|
67
|
+
icon: z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"Image">;
|
|
69
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
url: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
74
|
+
href: z.ZodString;
|
|
75
|
+
name: z.ZodString;
|
|
76
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
77
|
+
type: z.ZodLiteral<"Mention">;
|
|
78
|
+
href: z.ZodString;
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"Emoji">;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
updated: z.ZodString;
|
|
84
|
+
icon: z.ZodObject<{
|
|
85
|
+
type: z.ZodLiteral<"Image">;
|
|
86
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
url: z.ZodString;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
91
|
+
href: z.ZodString;
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
}, z.core.$strip>]>>]>;
|
|
94
|
+
published: z.ZodString;
|
|
95
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
type: z.ZodLiteral<"Note">;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export type Note = z.infer<typeof Note>;
|
|
99
|
+
/**
|
|
100
|
+
* Question content type for polls.
|
|
101
|
+
*/
|
|
102
|
+
export declare const ENTITY_TYPE_QUESTION = "Question";
|
|
103
|
+
export declare const Question: z.ZodObject<{
|
|
104
|
+
id: z.ZodString;
|
|
105
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
attributedTo: z.ZodString;
|
|
107
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
108
|
+
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
109
|
+
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
112
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
113
|
+
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
114
|
+
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
type: z.ZodLiteral<"Collection">;
|
|
117
|
+
first: z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"CollectionPage">;
|
|
119
|
+
next: z.ZodString;
|
|
120
|
+
partOf: z.ZodString;
|
|
121
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
type: z.ZodLiteral<"Collection">;
|
|
126
|
+
totalItems: z.ZodNumber;
|
|
127
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
128
|
+
}, z.core.$strip>]>>>;
|
|
129
|
+
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
130
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
131
|
+
name: z.ZodString;
|
|
132
|
+
value: z.ZodString;
|
|
133
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
134
|
+
type: z.ZodLiteral<"Document">;
|
|
135
|
+
mediaType: z.ZodString;
|
|
136
|
+
url: z.ZodString;
|
|
137
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
138
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
141
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
142
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
value: z.ZodString;
|
|
146
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
147
|
+
type: z.ZodLiteral<"Document">;
|
|
148
|
+
mediaType: z.ZodString;
|
|
149
|
+
url: z.ZodString;
|
|
150
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
151
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
154
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
155
|
+
}, z.core.$strip>]>>]>>>;
|
|
156
|
+
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
157
|
+
type: z.ZodLiteral<"Mention">;
|
|
158
|
+
href: z.ZodString;
|
|
159
|
+
name: z.ZodString;
|
|
160
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
161
|
+
type: z.ZodLiteral<"Emoji">;
|
|
162
|
+
name: z.ZodString;
|
|
163
|
+
updated: z.ZodString;
|
|
164
|
+
icon: z.ZodObject<{
|
|
165
|
+
type: z.ZodLiteral<"Image">;
|
|
166
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
167
|
+
url: z.ZodString;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
170
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
171
|
+
href: z.ZodString;
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
174
|
+
type: z.ZodLiteral<"Mention">;
|
|
175
|
+
href: z.ZodString;
|
|
176
|
+
name: z.ZodString;
|
|
177
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
178
|
+
type: z.ZodLiteral<"Emoji">;
|
|
179
|
+
name: z.ZodString;
|
|
180
|
+
updated: z.ZodString;
|
|
181
|
+
icon: z.ZodObject<{
|
|
182
|
+
type: z.ZodLiteral<"Image">;
|
|
183
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
url: z.ZodString;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
188
|
+
href: z.ZodString;
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
}, z.core.$strip>]>>]>;
|
|
191
|
+
published: z.ZodString;
|
|
192
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
|
+
type: z.ZodLiteral<"Question">;
|
|
194
|
+
endTime: z.ZodOptional<z.ZodString>;
|
|
195
|
+
closed: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
+
oneOf: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
197
|
+
type: z.ZodLiteral<"Note">;
|
|
198
|
+
name: z.ZodString;
|
|
199
|
+
replies: z.ZodObject<{
|
|
200
|
+
type: z.ZodLiteral<"Collection">;
|
|
201
|
+
totalItems: z.ZodNumber;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
}, z.core.$strip>>>;
|
|
204
|
+
anyOf: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
205
|
+
type: z.ZodLiteral<"Note">;
|
|
206
|
+
name: z.ZodString;
|
|
207
|
+
replies: z.ZodObject<{
|
|
208
|
+
type: z.ZodLiteral<"Collection">;
|
|
209
|
+
totalItems: z.ZodNumber;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
}, z.core.$strip>>>;
|
|
212
|
+
votersCount: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
export type Question = z.infer<typeof Question>;
|
|
215
|
+
/**
|
|
216
|
+
* Image content type used by Pixelfed and similar services.
|
|
217
|
+
* Extends BaseContent with image-specific properties.
|
|
218
|
+
*/
|
|
219
|
+
export declare const ImageContent: z.ZodObject<{
|
|
220
|
+
id: z.ZodString;
|
|
221
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
222
|
+
attributedTo: z.ZodString;
|
|
223
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
224
|
+
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
225
|
+
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
228
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
229
|
+
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
230
|
+
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
type: z.ZodLiteral<"Collection">;
|
|
233
|
+
first: z.ZodObject<{
|
|
234
|
+
type: z.ZodLiteral<"CollectionPage">;
|
|
235
|
+
next: z.ZodString;
|
|
236
|
+
partOf: z.ZodString;
|
|
237
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
240
|
+
id: z.ZodString;
|
|
241
|
+
type: z.ZodLiteral<"Collection">;
|
|
242
|
+
totalItems: z.ZodNumber;
|
|
243
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
244
|
+
}, z.core.$strip>]>>>;
|
|
245
|
+
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
246
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
247
|
+
name: z.ZodString;
|
|
248
|
+
value: z.ZodString;
|
|
249
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
250
|
+
type: z.ZodLiteral<"Document">;
|
|
251
|
+
mediaType: z.ZodString;
|
|
252
|
+
url: z.ZodString;
|
|
253
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
254
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
257
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
258
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
259
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
260
|
+
name: z.ZodString;
|
|
261
|
+
value: z.ZodString;
|
|
262
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
263
|
+
type: z.ZodLiteral<"Document">;
|
|
264
|
+
mediaType: z.ZodString;
|
|
265
|
+
url: z.ZodString;
|
|
266
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
267
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
268
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
269
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
270
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
271
|
+
}, z.core.$strip>]>>]>>>;
|
|
272
|
+
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
273
|
+
type: z.ZodLiteral<"Mention">;
|
|
274
|
+
href: z.ZodString;
|
|
275
|
+
name: z.ZodString;
|
|
276
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
277
|
+
type: z.ZodLiteral<"Emoji">;
|
|
278
|
+
name: z.ZodString;
|
|
279
|
+
updated: z.ZodString;
|
|
280
|
+
icon: z.ZodObject<{
|
|
281
|
+
type: z.ZodLiteral<"Image">;
|
|
282
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
283
|
+
url: z.ZodString;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
286
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
287
|
+
href: z.ZodString;
|
|
288
|
+
name: z.ZodString;
|
|
289
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
290
|
+
type: z.ZodLiteral<"Mention">;
|
|
291
|
+
href: z.ZodString;
|
|
292
|
+
name: z.ZodString;
|
|
293
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
294
|
+
type: z.ZodLiteral<"Emoji">;
|
|
295
|
+
name: z.ZodString;
|
|
296
|
+
updated: z.ZodString;
|
|
297
|
+
icon: z.ZodObject<{
|
|
298
|
+
type: z.ZodLiteral<"Image">;
|
|
299
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
300
|
+
url: z.ZodString;
|
|
301
|
+
}, z.core.$strip>;
|
|
302
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
303
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
304
|
+
href: z.ZodString;
|
|
305
|
+
name: z.ZodString;
|
|
306
|
+
}, z.core.$strip>]>>]>;
|
|
307
|
+
published: z.ZodString;
|
|
308
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
309
|
+
type: z.ZodLiteral<"Image">;
|
|
310
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
311
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
312
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
313
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
314
|
+
blurhash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
export type ImageContent = z.infer<typeof ImageContent>;
|
|
317
|
+
/**
|
|
318
|
+
* Page content type used by WriteFreely and similar services.
|
|
319
|
+
*/
|
|
320
|
+
export declare const PageContent: z.ZodObject<{
|
|
321
|
+
id: z.ZodString;
|
|
322
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
attributedTo: z.ZodString;
|
|
324
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
325
|
+
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
326
|
+
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
327
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
328
|
+
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
329
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
330
|
+
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
331
|
+
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
type: z.ZodLiteral<"Collection">;
|
|
334
|
+
first: z.ZodObject<{
|
|
335
|
+
type: z.ZodLiteral<"CollectionPage">;
|
|
336
|
+
next: z.ZodString;
|
|
337
|
+
partOf: z.ZodString;
|
|
338
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
341
|
+
id: z.ZodString;
|
|
342
|
+
type: z.ZodLiteral<"Collection">;
|
|
343
|
+
totalItems: z.ZodNumber;
|
|
344
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
345
|
+
}, z.core.$strip>]>>>;
|
|
346
|
+
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
347
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
348
|
+
name: z.ZodString;
|
|
349
|
+
value: z.ZodString;
|
|
350
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
351
|
+
type: z.ZodLiteral<"Document">;
|
|
352
|
+
mediaType: z.ZodString;
|
|
353
|
+
url: z.ZodString;
|
|
354
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
355
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
356
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
357
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
358
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
359
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
360
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
361
|
+
name: z.ZodString;
|
|
362
|
+
value: z.ZodString;
|
|
363
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
364
|
+
type: z.ZodLiteral<"Document">;
|
|
365
|
+
mediaType: z.ZodString;
|
|
366
|
+
url: z.ZodString;
|
|
367
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
368
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
370
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
371
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
372
|
+
}, z.core.$strip>]>>]>>>;
|
|
373
|
+
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
374
|
+
type: z.ZodLiteral<"Mention">;
|
|
375
|
+
href: z.ZodString;
|
|
376
|
+
name: z.ZodString;
|
|
377
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
378
|
+
type: z.ZodLiteral<"Emoji">;
|
|
379
|
+
name: z.ZodString;
|
|
380
|
+
updated: z.ZodString;
|
|
381
|
+
icon: z.ZodObject<{
|
|
382
|
+
type: z.ZodLiteral<"Image">;
|
|
383
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
384
|
+
url: z.ZodString;
|
|
385
|
+
}, z.core.$strip>;
|
|
386
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
387
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
388
|
+
href: z.ZodString;
|
|
389
|
+
name: z.ZodString;
|
|
390
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
391
|
+
type: z.ZodLiteral<"Mention">;
|
|
392
|
+
href: z.ZodString;
|
|
393
|
+
name: z.ZodString;
|
|
394
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
395
|
+
type: z.ZodLiteral<"Emoji">;
|
|
396
|
+
name: z.ZodString;
|
|
397
|
+
updated: z.ZodString;
|
|
398
|
+
icon: z.ZodObject<{
|
|
399
|
+
type: z.ZodLiteral<"Image">;
|
|
400
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
401
|
+
url: z.ZodString;
|
|
402
|
+
}, z.core.$strip>;
|
|
403
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
404
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
405
|
+
href: z.ZodString;
|
|
406
|
+
name: z.ZodString;
|
|
407
|
+
}, z.core.$strip>]>>]>;
|
|
408
|
+
published: z.ZodString;
|
|
409
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
410
|
+
type: z.ZodLiteral<"Page">;
|
|
411
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
412
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
414
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
415
|
+
blurhash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
416
|
+
}, z.core.$strip>;
|
|
417
|
+
export type PageContent = z.infer<typeof PageContent>;
|
|
418
|
+
/**
|
|
419
|
+
* Article content type used by blogs and similar services.
|
|
420
|
+
*/
|
|
421
|
+
export declare const ArticleContent: z.ZodObject<{
|
|
422
|
+
id: z.ZodString;
|
|
423
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
424
|
+
attributedTo: z.ZodString;
|
|
425
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
426
|
+
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
427
|
+
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
428
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
429
|
+
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
430
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
431
|
+
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
432
|
+
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
433
|
+
id: z.ZodString;
|
|
434
|
+
type: z.ZodLiteral<"Collection">;
|
|
435
|
+
first: z.ZodObject<{
|
|
436
|
+
type: z.ZodLiteral<"CollectionPage">;
|
|
437
|
+
next: z.ZodString;
|
|
438
|
+
partOf: z.ZodString;
|
|
439
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
440
|
+
}, z.core.$strip>;
|
|
441
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
442
|
+
id: z.ZodString;
|
|
443
|
+
type: z.ZodLiteral<"Collection">;
|
|
444
|
+
totalItems: z.ZodNumber;
|
|
445
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
446
|
+
}, z.core.$strip>]>>>;
|
|
447
|
+
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
448
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
449
|
+
name: z.ZodString;
|
|
450
|
+
value: z.ZodString;
|
|
451
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
452
|
+
type: z.ZodLiteral<"Document">;
|
|
453
|
+
mediaType: z.ZodString;
|
|
454
|
+
url: z.ZodString;
|
|
455
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
456
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
457
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
458
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
459
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
460
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
461
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
462
|
+
name: z.ZodString;
|
|
463
|
+
value: z.ZodString;
|
|
464
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
465
|
+
type: z.ZodLiteral<"Document">;
|
|
466
|
+
mediaType: z.ZodString;
|
|
467
|
+
url: z.ZodString;
|
|
468
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
469
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
470
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
471
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
472
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
473
|
+
}, z.core.$strip>]>>]>>>;
|
|
474
|
+
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
475
|
+
type: z.ZodLiteral<"Mention">;
|
|
476
|
+
href: z.ZodString;
|
|
477
|
+
name: z.ZodString;
|
|
478
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
479
|
+
type: z.ZodLiteral<"Emoji">;
|
|
480
|
+
name: z.ZodString;
|
|
481
|
+
updated: z.ZodString;
|
|
482
|
+
icon: z.ZodObject<{
|
|
483
|
+
type: z.ZodLiteral<"Image">;
|
|
484
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
485
|
+
url: z.ZodString;
|
|
486
|
+
}, z.core.$strip>;
|
|
487
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
488
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
489
|
+
href: z.ZodString;
|
|
490
|
+
name: z.ZodString;
|
|
491
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
492
|
+
type: z.ZodLiteral<"Mention">;
|
|
493
|
+
href: z.ZodString;
|
|
494
|
+
name: z.ZodString;
|
|
495
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
496
|
+
type: z.ZodLiteral<"Emoji">;
|
|
497
|
+
name: z.ZodString;
|
|
498
|
+
updated: z.ZodString;
|
|
499
|
+
icon: z.ZodObject<{
|
|
500
|
+
type: z.ZodLiteral<"Image">;
|
|
501
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
502
|
+
url: z.ZodString;
|
|
503
|
+
}, z.core.$strip>;
|
|
504
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
505
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
506
|
+
href: z.ZodString;
|
|
507
|
+
name: z.ZodString;
|
|
508
|
+
}, z.core.$strip>]>>]>;
|
|
509
|
+
published: z.ZodString;
|
|
510
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
511
|
+
type: z.ZodLiteral<"Article">;
|
|
512
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
513
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
514
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
515
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
516
|
+
blurhash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
517
|
+
}, z.core.$strip>;
|
|
518
|
+
export type ArticleContent = z.infer<typeof ArticleContent>;
|
|
519
|
+
/**
|
|
520
|
+
* Video content type used by PeerTube and similar services.
|
|
521
|
+
*/
|
|
522
|
+
export declare const VideoContent: z.ZodObject<{
|
|
523
|
+
id: z.ZodString;
|
|
524
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
525
|
+
attributedTo: z.ZodString;
|
|
526
|
+
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
527
|
+
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
528
|
+
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
529
|
+
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
530
|
+
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
531
|
+
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
532
|
+
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
533
|
+
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
534
|
+
id: z.ZodString;
|
|
535
|
+
type: z.ZodLiteral<"Collection">;
|
|
536
|
+
first: z.ZodObject<{
|
|
537
|
+
type: z.ZodLiteral<"CollectionPage">;
|
|
538
|
+
next: z.ZodString;
|
|
539
|
+
partOf: z.ZodString;
|
|
540
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
541
|
+
}, z.core.$strip>;
|
|
542
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
543
|
+
id: z.ZodString;
|
|
544
|
+
type: z.ZodLiteral<"Collection">;
|
|
545
|
+
totalItems: z.ZodNumber;
|
|
546
|
+
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
547
|
+
}, z.core.$strip>]>>>;
|
|
548
|
+
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
549
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
550
|
+
name: z.ZodString;
|
|
551
|
+
value: z.ZodString;
|
|
552
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
553
|
+
type: z.ZodLiteral<"Document">;
|
|
554
|
+
mediaType: z.ZodString;
|
|
555
|
+
url: z.ZodString;
|
|
556
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
557
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
558
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
559
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
560
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
561
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
562
|
+
type: z.ZodLiteral<"PropertyValue">;
|
|
563
|
+
name: z.ZodString;
|
|
564
|
+
value: z.ZodString;
|
|
565
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
566
|
+
type: z.ZodLiteral<"Document">;
|
|
567
|
+
mediaType: z.ZodString;
|
|
568
|
+
url: z.ZodString;
|
|
569
|
+
blurhash: z.ZodOptional<z.ZodString>;
|
|
570
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
571
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
572
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
573
|
+
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
574
|
+
}, z.core.$strip>]>>]>>>;
|
|
575
|
+
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
576
|
+
type: z.ZodLiteral<"Mention">;
|
|
577
|
+
href: z.ZodString;
|
|
578
|
+
name: z.ZodString;
|
|
579
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
580
|
+
type: z.ZodLiteral<"Emoji">;
|
|
581
|
+
name: z.ZodString;
|
|
582
|
+
updated: z.ZodString;
|
|
583
|
+
icon: z.ZodObject<{
|
|
584
|
+
type: z.ZodLiteral<"Image">;
|
|
585
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
586
|
+
url: z.ZodString;
|
|
587
|
+
}, z.core.$strip>;
|
|
588
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
589
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
590
|
+
href: z.ZodString;
|
|
591
|
+
name: z.ZodString;
|
|
592
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
593
|
+
type: z.ZodLiteral<"Mention">;
|
|
594
|
+
href: z.ZodString;
|
|
595
|
+
name: z.ZodString;
|
|
596
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
597
|
+
type: z.ZodLiteral<"Emoji">;
|
|
598
|
+
name: z.ZodString;
|
|
599
|
+
updated: z.ZodString;
|
|
600
|
+
icon: z.ZodObject<{
|
|
601
|
+
type: z.ZodLiteral<"Image">;
|
|
602
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
603
|
+
url: z.ZodString;
|
|
604
|
+
}, z.core.$strip>;
|
|
605
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
606
|
+
type: z.ZodLiteral<"Hashtag">;
|
|
607
|
+
href: z.ZodString;
|
|
608
|
+
name: z.ZodString;
|
|
609
|
+
}, z.core.$strip>]>>]>;
|
|
610
|
+
published: z.ZodString;
|
|
611
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
612
|
+
type: z.ZodLiteral<"Video">;
|
|
613
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
614
|
+
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
615
|
+
width: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
616
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
617
|
+
blurhash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
618
|
+
}, z.core.$strip>;
|
|
619
|
+
export type VideoContent = z.infer<typeof VideoContent>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from "./accept.js";
|
|
2
2
|
export * from "./follow.js";
|
|
3
3
|
export * from "./like.js";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./content.js";
|
|
5
5
|
export * from "./collection.js";
|
|
6
|
-
export * from "./question.js";
|
|
7
6
|
export * from "./reject.js";
|
|
8
7
|
export * from "./undo.js";
|
|
9
8
|
export * from "./announce.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llun/activities.schema",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Validate ActivityPub and Mastodon with Zod",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"author": "Maythee Anegboonlap <null@llun.dev>",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"zod": "^4.
|
|
16
|
+
"zod": "^4.3.4"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"typescript": "^5.9.3"
|
package/src/content.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BaseContent } from "./note/baseContent.js";
|
|
3
|
+
import { Note as QuestionOptionNote } from "./question/note.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Note content type - the standard ActivityPub content type.
|
|
7
|
+
*/
|
|
8
|
+
export const ENTITY_TYPE_NOTE = "Note";
|
|
9
|
+
export const Note = BaseContent.extend({
|
|
10
|
+
type: z.literal(ENTITY_TYPE_NOTE),
|
|
11
|
+
});
|
|
12
|
+
export type Note = z.infer<typeof Note>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Question content type for polls.
|
|
16
|
+
*/
|
|
17
|
+
export const ENTITY_TYPE_QUESTION = "Question";
|
|
18
|
+
export const Question = BaseContent.extend({
|
|
19
|
+
type: z.literal(ENTITY_TYPE_QUESTION),
|
|
20
|
+
|
|
21
|
+
endTime: z
|
|
22
|
+
.string()
|
|
23
|
+
.describe("Question end time in ISO 8601 datetime format")
|
|
24
|
+
.optional(),
|
|
25
|
+
closed: z
|
|
26
|
+
.string()
|
|
27
|
+
.describe(
|
|
28
|
+
"The datetime when the poll was closed, in ISO 8601 format. Used when a poll is closed early"
|
|
29
|
+
)
|
|
30
|
+
.nullish(),
|
|
31
|
+
|
|
32
|
+
// Single-choice poll options (mutually exclusive with anyOf)
|
|
33
|
+
oneOf: QuestionOptionNote.array()
|
|
34
|
+
.describe("Poll options for single-choice polls")
|
|
35
|
+
.optional(),
|
|
36
|
+
// Multiple-choice poll options (mutually exclusive with oneOf)
|
|
37
|
+
anyOf: QuestionOptionNote.array()
|
|
38
|
+
.describe("Poll options for multiple-choice polls")
|
|
39
|
+
.optional(),
|
|
40
|
+
|
|
41
|
+
// Misskey extension for total unique voters
|
|
42
|
+
votersCount: z
|
|
43
|
+
.number()
|
|
44
|
+
.describe("Total number of unique voters (Misskey extension)")
|
|
45
|
+
.optional(),
|
|
46
|
+
});
|
|
47
|
+
export type Question = z.infer<typeof Question>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Image content type used by Pixelfed and similar services.
|
|
51
|
+
* Extends BaseContent with image-specific properties.
|
|
52
|
+
*/
|
|
53
|
+
export const ImageContent = BaseContent.extend({
|
|
54
|
+
type: z.literal("Image"),
|
|
55
|
+
name: z.string().nullish(),
|
|
56
|
+
mediaType: z.string().nullish(),
|
|
57
|
+
width: z.number().nullish(),
|
|
58
|
+
height: z.number().nullish(),
|
|
59
|
+
blurhash: z.string().nullish(),
|
|
60
|
+
});
|
|
61
|
+
export type ImageContent = z.infer<typeof ImageContent>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Page content type used by WriteFreely and similar services.
|
|
65
|
+
*/
|
|
66
|
+
export const PageContent = BaseContent.extend({
|
|
67
|
+
type: z.literal("Page"),
|
|
68
|
+
name: z.string().nullish(),
|
|
69
|
+
mediaType: z.string().nullish(),
|
|
70
|
+
width: z.number().nullish(),
|
|
71
|
+
height: z.number().nullish(),
|
|
72
|
+
blurhash: z.string().nullish(),
|
|
73
|
+
});
|
|
74
|
+
export type PageContent = z.infer<typeof PageContent>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Article content type used by blogs and similar services.
|
|
78
|
+
*/
|
|
79
|
+
export const ArticleContent = BaseContent.extend({
|
|
80
|
+
type: z.literal("Article"),
|
|
81
|
+
name: z.string().nullish(),
|
|
82
|
+
mediaType: z.string().nullish(),
|
|
83
|
+
width: z.number().nullish(),
|
|
84
|
+
height: z.number().nullish(),
|
|
85
|
+
blurhash: z.string().nullish(),
|
|
86
|
+
});
|
|
87
|
+
export type ArticleContent = z.infer<typeof ArticleContent>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Video content type used by PeerTube and similar services.
|
|
91
|
+
*/
|
|
92
|
+
export const VideoContent = BaseContent.extend({
|
|
93
|
+
type: z.literal("Video"),
|
|
94
|
+
name: z.string().nullish(),
|
|
95
|
+
mediaType: z.string().nullish(),
|
|
96
|
+
width: z.number().nullish(),
|
|
97
|
+
height: z.number().nullish(),
|
|
98
|
+
blurhash: z.string().nullish(),
|
|
99
|
+
});
|
|
100
|
+
export type VideoContent = z.infer<typeof VideoContent>;
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export * from "./accept.js";
|
|
2
2
|
export * from "./follow.js";
|
|
3
3
|
export * from "./like.js";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./content.js";
|
|
5
5
|
export * from "./collection.js";
|
|
6
|
-
export * from "./question.js";
|
|
7
6
|
export * from "./reject.js";
|
|
8
7
|
export * from "./undo.js";
|
|
9
8
|
export * from "./announce.js";
|
package/src/like.ts
CHANGED
package/dist/cjs/note.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Note = exports.ENTITY_TYPE_NOTE = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const baseContent_js_1 = require("./note/baseContent.js");
|
|
6
|
-
exports.ENTITY_TYPE_NOTE = "Note";
|
|
7
|
-
exports.Note = baseContent_js_1.BaseContent.extend({
|
|
8
|
-
type: zod_1.z.literal(exports.ENTITY_TYPE_NOTE),
|
|
9
|
-
});
|
package/dist/cjs/question.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Question = exports.ENTITY_TYPE_QUESTION = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const baseContent_js_1 = require("./note/baseContent.js");
|
|
6
|
-
const note_js_1 = require("./question/note.js");
|
|
7
|
-
exports.ENTITY_TYPE_QUESTION = "Question";
|
|
8
|
-
exports.Question = baseContent_js_1.BaseContent.extend({
|
|
9
|
-
type: zod_1.z.literal(exports.ENTITY_TYPE_QUESTION),
|
|
10
|
-
endTime: zod_1.z
|
|
11
|
-
.string()
|
|
12
|
-
.describe("Question end time in ISO 8601 datetime format")
|
|
13
|
-
.optional(),
|
|
14
|
-
closed: zod_1.z
|
|
15
|
-
.string()
|
|
16
|
-
.describe("The datetime when the poll was closed, in ISO 8601 format. Used when a poll is closed early")
|
|
17
|
-
.nullish(),
|
|
18
|
-
// Single-choice poll options (mutually exclusive with anyOf)
|
|
19
|
-
oneOf: note_js_1.Note.array()
|
|
20
|
-
.describe("Poll options for single-choice polls")
|
|
21
|
-
.optional(),
|
|
22
|
-
// Multiple-choice poll options (mutually exclusive with oneOf)
|
|
23
|
-
anyOf: note_js_1.Note.array()
|
|
24
|
-
.describe("Poll options for multiple-choice polls")
|
|
25
|
-
.optional(),
|
|
26
|
-
// Misskey extension for total unique voters
|
|
27
|
-
votersCount: zod_1.z
|
|
28
|
-
.number()
|
|
29
|
-
.describe("Total number of unique voters (Misskey extension)")
|
|
30
|
-
.optional(),
|
|
31
|
-
});
|
package/dist/esm/note.js
DELETED
package/dist/esm/question.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { BaseContent } from "./note/baseContent.js";
|
|
3
|
-
import { Note } from "./question/note.js";
|
|
4
|
-
export const ENTITY_TYPE_QUESTION = "Question";
|
|
5
|
-
export const Question = BaseContent.extend({
|
|
6
|
-
type: z.literal(ENTITY_TYPE_QUESTION),
|
|
7
|
-
endTime: z
|
|
8
|
-
.string()
|
|
9
|
-
.describe("Question end time in ISO 8601 datetime format")
|
|
10
|
-
.optional(),
|
|
11
|
-
closed: z
|
|
12
|
-
.string()
|
|
13
|
-
.describe("The datetime when the poll was closed, in ISO 8601 format. Used when a poll is closed early")
|
|
14
|
-
.nullish(),
|
|
15
|
-
// Single-choice poll options (mutually exclusive with anyOf)
|
|
16
|
-
oneOf: Note.array()
|
|
17
|
-
.describe("Poll options for single-choice polls")
|
|
18
|
-
.optional(),
|
|
19
|
-
// Multiple-choice poll options (mutually exclusive with oneOf)
|
|
20
|
-
anyOf: Note.array()
|
|
21
|
-
.describe("Poll options for multiple-choice polls")
|
|
22
|
-
.optional(),
|
|
23
|
-
// Misskey extension for total unique voters
|
|
24
|
-
votersCount: z
|
|
25
|
-
.number()
|
|
26
|
-
.describe("Total number of unique voters (Misskey extension)")
|
|
27
|
-
.optional(),
|
|
28
|
-
});
|
package/dist/types/note.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ENTITY_TYPE_NOTE = "Note";
|
|
3
|
-
export declare const Note: z.ZodObject<{
|
|
4
|
-
id: z.ZodString;
|
|
5
|
-
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
-
attributedTo: z.ZodString;
|
|
7
|
-
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
8
|
-
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
9
|
-
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
-
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
-
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
12
|
-
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
13
|
-
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
14
|
-
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
-
id: z.ZodString;
|
|
16
|
-
type: z.ZodLiteral<"Collection">;
|
|
17
|
-
first: z.ZodObject<{
|
|
18
|
-
type: z.ZodLiteral<"CollectionPage">;
|
|
19
|
-
next: z.ZodString;
|
|
20
|
-
partOf: z.ZodString;
|
|
21
|
-
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
-
id: z.ZodString;
|
|
25
|
-
type: z.ZodLiteral<"Collection">;
|
|
26
|
-
totalItems: z.ZodNumber;
|
|
27
|
-
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
28
|
-
}, z.core.$strip>]>>>;
|
|
29
|
-
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
30
|
-
type: z.ZodLiteral<"PropertyValue">;
|
|
31
|
-
name: z.ZodString;
|
|
32
|
-
value: z.ZodString;
|
|
33
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
-
type: z.ZodLiteral<"Document">;
|
|
35
|
-
mediaType: z.ZodString;
|
|
36
|
-
url: z.ZodString;
|
|
37
|
-
blurhash: z.ZodOptional<z.ZodString>;
|
|
38
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
41
|
-
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
42
|
-
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
43
|
-
type: z.ZodLiteral<"PropertyValue">;
|
|
44
|
-
name: z.ZodString;
|
|
45
|
-
value: z.ZodString;
|
|
46
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
-
type: z.ZodLiteral<"Document">;
|
|
48
|
-
mediaType: z.ZodString;
|
|
49
|
-
url: z.ZodString;
|
|
50
|
-
blurhash: z.ZodOptional<z.ZodString>;
|
|
51
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
53
|
-
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
54
|
-
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
55
|
-
}, z.core.$strip>]>>]>>>;
|
|
56
|
-
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
57
|
-
type: z.ZodLiteral<"Mention">;
|
|
58
|
-
href: z.ZodString;
|
|
59
|
-
name: z.ZodString;
|
|
60
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
-
type: z.ZodLiteral<"Emoji">;
|
|
62
|
-
name: z.ZodString;
|
|
63
|
-
updated: z.ZodString;
|
|
64
|
-
icon: z.ZodObject<{
|
|
65
|
-
type: z.ZodLiteral<"Image">;
|
|
66
|
-
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
-
url: z.ZodString;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
-
type: z.ZodLiteral<"Hashtag">;
|
|
71
|
-
href: z.ZodString;
|
|
72
|
-
name: z.ZodString;
|
|
73
|
-
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
74
|
-
type: z.ZodLiteral<"Mention">;
|
|
75
|
-
href: z.ZodString;
|
|
76
|
-
name: z.ZodString;
|
|
77
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
-
type: z.ZodLiteral<"Emoji">;
|
|
79
|
-
name: z.ZodString;
|
|
80
|
-
updated: z.ZodString;
|
|
81
|
-
icon: z.ZodObject<{
|
|
82
|
-
type: z.ZodLiteral<"Image">;
|
|
83
|
-
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
-
url: z.ZodString;
|
|
85
|
-
}, z.core.$strip>;
|
|
86
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
87
|
-
type: z.ZodLiteral<"Hashtag">;
|
|
88
|
-
href: z.ZodString;
|
|
89
|
-
name: z.ZodString;
|
|
90
|
-
}, z.core.$strip>]>>]>;
|
|
91
|
-
published: z.ZodString;
|
|
92
|
-
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
-
type: z.ZodLiteral<"Note">;
|
|
94
|
-
}, z.core.$strip>;
|
|
95
|
-
export type Note = z.infer<typeof Note>;
|
package/dist/types/question.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ENTITY_TYPE_QUESTION = "Question";
|
|
3
|
-
export declare const Question: z.ZodObject<{
|
|
4
|
-
id: z.ZodString;
|
|
5
|
-
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
-
attributedTo: z.ZodString;
|
|
7
|
-
to: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
8
|
-
cc: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
9
|
-
inReplyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
-
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
-
summaryMap: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
12
|
-
content: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
13
|
-
contentMap: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodArray<z.ZodString>]>>>;
|
|
14
|
-
replies: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
-
id: z.ZodString;
|
|
16
|
-
type: z.ZodLiteral<"Collection">;
|
|
17
|
-
first: z.ZodObject<{
|
|
18
|
-
type: z.ZodLiteral<"CollectionPage">;
|
|
19
|
-
next: z.ZodString;
|
|
20
|
-
partOf: z.ZodString;
|
|
21
|
-
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
-
id: z.ZodString;
|
|
25
|
-
type: z.ZodLiteral<"Collection">;
|
|
26
|
-
totalItems: z.ZodNumber;
|
|
27
|
-
items: z.ZodUnion<readonly [z.ZodAny, z.ZodArray<z.ZodAny>]>;
|
|
28
|
-
}, z.core.$strip>]>>>;
|
|
29
|
-
attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
30
|
-
type: z.ZodLiteral<"PropertyValue">;
|
|
31
|
-
name: z.ZodString;
|
|
32
|
-
value: z.ZodString;
|
|
33
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
-
type: z.ZodLiteral<"Document">;
|
|
35
|
-
mediaType: z.ZodString;
|
|
36
|
-
url: z.ZodString;
|
|
37
|
-
blurhash: z.ZodOptional<z.ZodString>;
|
|
38
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
41
|
-
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
42
|
-
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
43
|
-
type: z.ZodLiteral<"PropertyValue">;
|
|
44
|
-
name: z.ZodString;
|
|
45
|
-
value: z.ZodString;
|
|
46
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
-
type: z.ZodLiteral<"Document">;
|
|
48
|
-
mediaType: z.ZodString;
|
|
49
|
-
url: z.ZodString;
|
|
50
|
-
blurhash: z.ZodOptional<z.ZodString>;
|
|
51
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
53
|
-
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
54
|
-
focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
55
|
-
}, z.core.$strip>]>>]>>>;
|
|
56
|
-
tag: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
57
|
-
type: z.ZodLiteral<"Mention">;
|
|
58
|
-
href: z.ZodString;
|
|
59
|
-
name: z.ZodString;
|
|
60
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
-
type: z.ZodLiteral<"Emoji">;
|
|
62
|
-
name: z.ZodString;
|
|
63
|
-
updated: z.ZodString;
|
|
64
|
-
icon: z.ZodObject<{
|
|
65
|
-
type: z.ZodLiteral<"Image">;
|
|
66
|
-
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
-
url: z.ZodString;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
-
type: z.ZodLiteral<"Hashtag">;
|
|
71
|
-
href: z.ZodString;
|
|
72
|
-
name: z.ZodString;
|
|
73
|
-
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
74
|
-
type: z.ZodLiteral<"Mention">;
|
|
75
|
-
href: z.ZodString;
|
|
76
|
-
name: z.ZodString;
|
|
77
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
-
type: z.ZodLiteral<"Emoji">;
|
|
79
|
-
name: z.ZodString;
|
|
80
|
-
updated: z.ZodString;
|
|
81
|
-
icon: z.ZodObject<{
|
|
82
|
-
type: z.ZodLiteral<"Image">;
|
|
83
|
-
mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
-
url: z.ZodString;
|
|
85
|
-
}, z.core.$strip>;
|
|
86
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
87
|
-
type: z.ZodLiteral<"Hashtag">;
|
|
88
|
-
href: z.ZodString;
|
|
89
|
-
name: z.ZodString;
|
|
90
|
-
}, z.core.$strip>]>>]>;
|
|
91
|
-
published: z.ZodString;
|
|
92
|
-
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
-
type: z.ZodLiteral<"Question">;
|
|
94
|
-
endTime: z.ZodOptional<z.ZodString>;
|
|
95
|
-
closed: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
-
oneOf: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
97
|
-
type: z.ZodLiteral<"Note">;
|
|
98
|
-
name: z.ZodString;
|
|
99
|
-
replies: z.ZodObject<{
|
|
100
|
-
type: z.ZodLiteral<"Collection">;
|
|
101
|
-
totalItems: z.ZodNumber;
|
|
102
|
-
}, z.core.$strip>;
|
|
103
|
-
}, z.core.$strip>>>;
|
|
104
|
-
anyOf: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
105
|
-
type: z.ZodLiteral<"Note">;
|
|
106
|
-
name: z.ZodString;
|
|
107
|
-
replies: z.ZodObject<{
|
|
108
|
-
type: z.ZodLiteral<"Collection">;
|
|
109
|
-
totalItems: z.ZodNumber;
|
|
110
|
-
}, z.core.$strip>;
|
|
111
|
-
}, z.core.$strip>>>;
|
|
112
|
-
votersCount: z.ZodOptional<z.ZodNumber>;
|
|
113
|
-
}, z.core.$strip>;
|
|
114
|
-
export type Question = z.infer<typeof Question>;
|
package/src/note.ts
DELETED
package/src/question.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { BaseContent } from "./note/baseContent.js";
|
|
3
|
-
import { Note } from "./question/note.js";
|
|
4
|
-
|
|
5
|
-
export const ENTITY_TYPE_QUESTION = "Question";
|
|
6
|
-
export const Question = BaseContent.extend({
|
|
7
|
-
type: z.literal(ENTITY_TYPE_QUESTION),
|
|
8
|
-
|
|
9
|
-
endTime: z
|
|
10
|
-
.string()
|
|
11
|
-
.describe("Question end time in ISO 8601 datetime format")
|
|
12
|
-
.optional(),
|
|
13
|
-
closed: z
|
|
14
|
-
.string()
|
|
15
|
-
.describe(
|
|
16
|
-
"The datetime when the poll was closed, in ISO 8601 format. Used when a poll is closed early"
|
|
17
|
-
)
|
|
18
|
-
.nullish(),
|
|
19
|
-
|
|
20
|
-
// Single-choice poll options (mutually exclusive with anyOf)
|
|
21
|
-
oneOf: Note.array()
|
|
22
|
-
.describe("Poll options for single-choice polls")
|
|
23
|
-
.optional(),
|
|
24
|
-
// Multiple-choice poll options (mutually exclusive with oneOf)
|
|
25
|
-
anyOf: Note.array()
|
|
26
|
-
.describe("Poll options for multiple-choice polls")
|
|
27
|
-
.optional(),
|
|
28
|
-
|
|
29
|
-
// Misskey extension for total unique voters
|
|
30
|
-
votersCount: z
|
|
31
|
-
.number()
|
|
32
|
-
.describe("Total number of unique voters (Misskey extension)")
|
|
33
|
-
.optional(),
|
|
34
|
-
});
|
|
35
|
-
export type Question = z.infer<typeof Question>;
|