@llun/activities.schema 0.4.0 → 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 +4 -3
- package/dist/cjs/like.js +2 -2
- package/dist/cjs/question/note.js +8 -4
- package/dist/esm/content.js +83 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/like.js +1 -1
- package/dist/esm/question/note.js +7 -3
- package/dist/types/content.d.ts +619 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/question/note.d.ts +10 -1
- package/package.json +2 -2
- package/src/content.ts +100 -0
- package/src/index.ts +3 -2
- package/src/like.ts +1 -1
- package/src/question/note.ts +10 -4
- package/dist/cjs/note.js +0 -9
- package/dist/cjs/question.js +0 -12
- package/dist/esm/note.js +0 -6
- package/dist/esm/question.js +0 -9
- package/dist/types/note.d.ts +0 -95
- package/dist/types/question.d.ts +0 -104
- package/src/note.ts +0 -8
- package/src/question.ts +0 -12
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";
|
|
@@ -14,6 +13,8 @@ export * from "./note/mention.js";
|
|
|
14
13
|
export * from "./note/hashtag.js";
|
|
15
14
|
export * from "./note/document.js";
|
|
16
15
|
|
|
16
|
+
export { QuestionOption } from "./question/note.js";
|
|
17
|
+
|
|
17
18
|
export * from "./actor.js";
|
|
18
19
|
|
|
19
20
|
export * as Mastodon from "./mastodon/index.js";
|
package/src/like.ts
CHANGED
package/src/question/note.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// Poll option representation in ActivityPub Question
|
|
4
|
+
// Each option is a Note with a name (the option text) and replies collection (vote count)
|
|
5
|
+
export const QuestionOption = z.object({
|
|
4
6
|
type: z.literal("Note"),
|
|
5
|
-
name: z.string(),
|
|
7
|
+
name: z.string().describe("The text of the poll option"),
|
|
6
8
|
replies: z.object({
|
|
7
9
|
type: z.literal("Collection"),
|
|
8
|
-
totalItems: z.number(),
|
|
10
|
+
totalItems: z.number().describe("The number of votes for this option"),
|
|
9
11
|
}),
|
|
10
12
|
});
|
|
11
13
|
|
|
12
|
-
export type
|
|
14
|
+
export type QuestionOption = z.infer<typeof QuestionOption>;
|
|
15
|
+
|
|
16
|
+
// Internal alias used by Question schema (not exported to avoid conflict with main Note)
|
|
17
|
+
export const Note = QuestionOption;
|
|
18
|
+
export type Note = QuestionOption;
|
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,12 +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.string().describe("Question end time"),
|
|
11
|
-
oneOf: note_js_1.Note.array(),
|
|
12
|
-
});
|
package/dist/esm/note.js
DELETED
package/dist/esm/question.js
DELETED
|
@@ -1,9 +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.string().describe("Question end time"),
|
|
8
|
-
oneOf: Note.array(),
|
|
9
|
-
});
|
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,104 +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.ZodString;
|
|
95
|
-
oneOf: z.ZodArray<z.ZodObject<{
|
|
96
|
-
type: z.ZodLiteral<"Note">;
|
|
97
|
-
name: z.ZodString;
|
|
98
|
-
replies: z.ZodObject<{
|
|
99
|
-
type: z.ZodLiteral<"Collection">;
|
|
100
|
-
totalItems: z.ZodNumber;
|
|
101
|
-
}, z.core.$strip>;
|
|
102
|
-
}, z.core.$strip>>;
|
|
103
|
-
}, z.core.$strip>;
|
|
104
|
-
export type Question = z.infer<typeof Question>;
|
package/src/note.ts
DELETED
package/src/question.ts
DELETED
|
@@ -1,12 +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.string().describe("Question end time"),
|
|
10
|
-
oneOf: Note.array(),
|
|
11
|
-
});
|
|
12
|
-
export type Question = z.infer<typeof Question>;
|