notion-mcp-server 0.0.1
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/LICENSE +21 -0
- package/README.md +236 -0
- package/build/config/index.js +5 -0
- package/build/index.js +17 -0
- package/build/resources/imageList.js +62 -0
- package/build/resources/index.js +1 -0
- package/build/resources/predictionList.js +43 -0
- package/build/resources/svgList.js +69 -0
- package/build/schema/annotations.js +15 -0
- package/build/schema/blocks.js +209 -0
- package/build/schema/color.js +22 -0
- package/build/schema/file.js +11 -0
- package/build/schema/icon.js +10 -0
- package/build/schema/lang.js +77 -0
- package/build/schema/mention.js +102 -0
- package/build/schema/notion.js +57 -0
- package/build/schema/page.js +68 -0
- package/build/schema/preprocess.js +1 -0
- package/build/schema/rich-text.js +71 -0
- package/build/schema/richText.js +757 -0
- package/build/schema/timezone.js +599 -0
- package/build/schema/tools.js +17 -0
- package/build/server/index.js +27 -0
- package/build/services/notion.js +20 -0
- package/build/services/replicate.js +23 -0
- package/build/tools/appendBlockChildren.js +25 -0
- package/build/tools/batchAppendBlockChildren.js +33 -0
- package/build/tools/batchDeleteBlocks.js +32 -0
- package/build/tools/batchMixedOperations.js +58 -0
- package/build/tools/batchUpdateBlocks.js +33 -0
- package/build/tools/createPage.js +18 -0
- package/build/tools/createPrediction.js +28 -0
- package/build/tools/deleteBlock.js +24 -0
- package/build/tools/formatRichText.js +83 -0
- package/build/tools/generateImage.js +48 -0
- package/build/tools/generateImageVariants.js +105 -0
- package/build/tools/generateMultipleImages.js +60 -0
- package/build/tools/generateSVG.js +43 -0
- package/build/tools/getPrediction.js +22 -0
- package/build/tools/index.js +31 -0
- package/build/tools/predictionList.js +30 -0
- package/build/tools/retrieveBlock.js +24 -0
- package/build/tools/retrieveBlockChildren.js +32 -0
- package/build/tools/searchPage.js +28 -0
- package/build/tools/updateBlock.js +25 -0
- package/build/tools/updatePage.js +40 -0
- package/build/types/blocks.js +11 -0
- package/build/types/emoji.js +1 -0
- package/build/types/index.js +1 -0
- package/build/types/notion.js +1 -0
- package/build/types/page.js +6 -0
- package/build/types/richText.js +1 -0
- package/build/types/tools.js +1 -0
- package/build/utils/blob.js +5 -0
- package/build/utils/error.js +127 -0
- package/build/utils/image.js +34 -0
- package/build/utils/index.js +1 -0
- package/build/utils/richText.js +174 -0
- package/build/validation/blocks.js +568 -0
- package/build/validation/notion.js +51 -0
- package/build/validation/page.js +262 -0
- package/build/validation/richText.js +744 -0
- package/build/validation/tools.js +16 -0
- package/package.json +44 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const COLOR_SCHEMA = z.enum([
|
|
3
|
+
"default",
|
|
4
|
+
"gray",
|
|
5
|
+
"brown",
|
|
6
|
+
"orange",
|
|
7
|
+
"yellow",
|
|
8
|
+
"green",
|
|
9
|
+
"blue",
|
|
10
|
+
"purple",
|
|
11
|
+
"pink",
|
|
12
|
+
"red",
|
|
13
|
+
"gray_background",
|
|
14
|
+
"brown_background",
|
|
15
|
+
"orange_background",
|
|
16
|
+
"yellow_background",
|
|
17
|
+
"green_background",
|
|
18
|
+
"blue_background",
|
|
19
|
+
"purple_background",
|
|
20
|
+
"pink_background",
|
|
21
|
+
"red_background",
|
|
22
|
+
]);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const FILE_SCHEMA = z
|
|
3
|
+
.object({
|
|
4
|
+
external: z
|
|
5
|
+
.object({
|
|
6
|
+
url: z.string().url().describe("URL of the external file"),
|
|
7
|
+
})
|
|
8
|
+
.describe("External file source"),
|
|
9
|
+
type: z.literal("external").describe("Type of file source"),
|
|
10
|
+
})
|
|
11
|
+
.describe("File schema");
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const ICON_SCHEMA = z.object({
|
|
3
|
+
emoji: z
|
|
4
|
+
.string()
|
|
5
|
+
.refine((value) => /(\p{Emoji}\uFE0F|\p{Emoji_Presentation})/gu.test(value), {
|
|
6
|
+
message: "Invalid emoji",
|
|
7
|
+
})
|
|
8
|
+
.transform((value) => value),
|
|
9
|
+
type: z.literal("emoji"),
|
|
10
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const LANGUAGE_SCHEMA = z
|
|
3
|
+
.enum([
|
|
4
|
+
"abap",
|
|
5
|
+
"arduino",
|
|
6
|
+
"bash",
|
|
7
|
+
"basic",
|
|
8
|
+
"c",
|
|
9
|
+
"clojure",
|
|
10
|
+
"coffeescript",
|
|
11
|
+
"c++",
|
|
12
|
+
"c#",
|
|
13
|
+
"css",
|
|
14
|
+
"dart",
|
|
15
|
+
"diff",
|
|
16
|
+
"docker",
|
|
17
|
+
"elixir",
|
|
18
|
+
"elm",
|
|
19
|
+
"erlang",
|
|
20
|
+
"flow",
|
|
21
|
+
"fortran",
|
|
22
|
+
"f#",
|
|
23
|
+
"gherkin",
|
|
24
|
+
"glsl",
|
|
25
|
+
"go",
|
|
26
|
+
"graphql",
|
|
27
|
+
"groovy",
|
|
28
|
+
"haskell",
|
|
29
|
+
"html",
|
|
30
|
+
"java",
|
|
31
|
+
"javascript",
|
|
32
|
+
"json",
|
|
33
|
+
"julia",
|
|
34
|
+
"kotlin",
|
|
35
|
+
"latex",
|
|
36
|
+
"less",
|
|
37
|
+
"lisp",
|
|
38
|
+
"livescript",
|
|
39
|
+
"lua",
|
|
40
|
+
"makefile",
|
|
41
|
+
"markdown",
|
|
42
|
+
"markup",
|
|
43
|
+
"matlab",
|
|
44
|
+
"mermaid",
|
|
45
|
+
"nix",
|
|
46
|
+
"objective-c",
|
|
47
|
+
"ocaml",
|
|
48
|
+
"pascal",
|
|
49
|
+
"perl",
|
|
50
|
+
"php",
|
|
51
|
+
"plain text",
|
|
52
|
+
"powershell",
|
|
53
|
+
"prolog",
|
|
54
|
+
"protobuf",
|
|
55
|
+
"python",
|
|
56
|
+
"r",
|
|
57
|
+
"reason",
|
|
58
|
+
"ruby",
|
|
59
|
+
"rust",
|
|
60
|
+
"sass",
|
|
61
|
+
"scala",
|
|
62
|
+
"scheme",
|
|
63
|
+
"scss",
|
|
64
|
+
"shell",
|
|
65
|
+
"sql",
|
|
66
|
+
"swift",
|
|
67
|
+
"typescript",
|
|
68
|
+
"vb.net",
|
|
69
|
+
"verilog",
|
|
70
|
+
"vhdl",
|
|
71
|
+
"visual basic",
|
|
72
|
+
"webassembly",
|
|
73
|
+
"xml",
|
|
74
|
+
"yaml",
|
|
75
|
+
"java/c/c++/c#",
|
|
76
|
+
])
|
|
77
|
+
.describe("Programming language for code blocks");
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const TEMPLATE_MENTION_USER_REQUEST_SCHEMA = z
|
|
3
|
+
.object({
|
|
4
|
+
type: z
|
|
5
|
+
.literal("template_mention")
|
|
6
|
+
.describe("Specifies this is a template mention type"),
|
|
7
|
+
template_mention: z
|
|
8
|
+
.object({
|
|
9
|
+
type: z
|
|
10
|
+
.literal("template_mention_user")
|
|
11
|
+
.describe("Specifies this is a template mention user type"),
|
|
12
|
+
template_mention_user: z
|
|
13
|
+
.literal("me")
|
|
14
|
+
.describe("Template mention user value"),
|
|
15
|
+
})
|
|
16
|
+
.describe("Contains the template mention user information"),
|
|
17
|
+
})
|
|
18
|
+
.describe("Schema for a template mention user block request");
|
|
19
|
+
export const TEMPLATE_MENTION_DATE_REQUEST_SCHEMA = z
|
|
20
|
+
.object({
|
|
21
|
+
type: z
|
|
22
|
+
.literal("template_mention")
|
|
23
|
+
.describe("Specifies this is a template mention type"),
|
|
24
|
+
template_mention: z
|
|
25
|
+
.object({
|
|
26
|
+
type: z
|
|
27
|
+
.literal("template_mention_date")
|
|
28
|
+
.describe("Specifies this is a template mention date type"),
|
|
29
|
+
template_mention_date: z
|
|
30
|
+
.literal("today")
|
|
31
|
+
.describe("Template mention date value"),
|
|
32
|
+
})
|
|
33
|
+
.describe("Contains the template mention date information"),
|
|
34
|
+
})
|
|
35
|
+
.describe("Schema for a template mention date block request");
|
|
36
|
+
export const USER_MENTION_REQUEST_SCHEMA = z
|
|
37
|
+
.object({
|
|
38
|
+
type: z.literal("user").describe("Specifies this is a user mention type"),
|
|
39
|
+
user: z
|
|
40
|
+
.object({
|
|
41
|
+
id: z
|
|
42
|
+
.string()
|
|
43
|
+
.describe("The unique ID that identifies this specific user"),
|
|
44
|
+
object: z
|
|
45
|
+
.literal("user")
|
|
46
|
+
.optional()
|
|
47
|
+
.describe("Identifies this object as a user type"),
|
|
48
|
+
})
|
|
49
|
+
.describe("Contains the user reference information"),
|
|
50
|
+
})
|
|
51
|
+
.describe("Schema for a user mention block request");
|
|
52
|
+
export const PAGE_MENTION_REQUEST_SCHEMA = z
|
|
53
|
+
.object({
|
|
54
|
+
type: z.literal("page").describe("Specifies this is a page mention type"),
|
|
55
|
+
page: z
|
|
56
|
+
.object({
|
|
57
|
+
id: z
|
|
58
|
+
.string()
|
|
59
|
+
.describe("The unique ID that identifies this specific page"),
|
|
60
|
+
})
|
|
61
|
+
.describe("Contains the page reference information"),
|
|
62
|
+
})
|
|
63
|
+
.describe("Schema for a page mention block request");
|
|
64
|
+
export const DATABASE_MENTION_REQUEST_SCHEMA = z
|
|
65
|
+
.object({
|
|
66
|
+
type: z
|
|
67
|
+
.literal("database")
|
|
68
|
+
.describe("Specifies this is a database mention type"),
|
|
69
|
+
database: z
|
|
70
|
+
.object({
|
|
71
|
+
id: z
|
|
72
|
+
.string()
|
|
73
|
+
.describe("The unique ID that identifies this specific database"),
|
|
74
|
+
})
|
|
75
|
+
.describe("Contains the database reference information"),
|
|
76
|
+
})
|
|
77
|
+
.describe("Schema for a database mention block request");
|
|
78
|
+
export const DATE_MENTION_REQUEST_SCHEMA = z
|
|
79
|
+
.object({
|
|
80
|
+
type: z.literal("date").describe("Specifies this is a date mention type"),
|
|
81
|
+
date: z
|
|
82
|
+
.object({
|
|
83
|
+
start: z.string().describe("The start date in YYYY-MM-DD format"),
|
|
84
|
+
end: z
|
|
85
|
+
.string()
|
|
86
|
+
.nullable()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe("The optional end date in YYYY-MM-DD format"),
|
|
89
|
+
})
|
|
90
|
+
.describe("Contains the date information"),
|
|
91
|
+
})
|
|
92
|
+
.describe("Schema for a date mention block request");
|
|
93
|
+
export const MENTION_REQUEST_SCHEMA = z.preprocess((val) => (typeof val === "string" ? JSON.parse(val) : val), z
|
|
94
|
+
.union([
|
|
95
|
+
DATE_MENTION_REQUEST_SCHEMA,
|
|
96
|
+
USER_MENTION_REQUEST_SCHEMA,
|
|
97
|
+
PAGE_MENTION_REQUEST_SCHEMA,
|
|
98
|
+
DATABASE_MENTION_REQUEST_SCHEMA,
|
|
99
|
+
TEMPLATE_MENTION_USER_REQUEST_SCHEMA,
|
|
100
|
+
TEMPLATE_MENTION_DATE_REQUEST_SCHEMA,
|
|
101
|
+
])
|
|
102
|
+
.describe("Union of all possible mention request types"));
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// import { z } from "zod";
|
|
2
|
+
// import { richTextSchema } from "./richText.js";
|
|
3
|
+
export {};
|
|
4
|
+
// export const parentSchema = z
|
|
5
|
+
// .object({
|
|
6
|
+
// type: z.enum(["page_id", "database_id"]),
|
|
7
|
+
// page_id: z.string().optional(),
|
|
8
|
+
// database_id: z.string().optional(),
|
|
9
|
+
// })
|
|
10
|
+
// .refine(
|
|
11
|
+
// (data) => {
|
|
12
|
+
// if (data.type === "page_id" && !data.page_id) return false;
|
|
13
|
+
// if (data.type === "database_id" && !data.database_id) return false;
|
|
14
|
+
// return true;
|
|
15
|
+
// },
|
|
16
|
+
// {
|
|
17
|
+
// message:
|
|
18
|
+
// "page_id must be provided when type is page_id, database_id must be provided when type is database_id",
|
|
19
|
+
// }
|
|
20
|
+
// );
|
|
21
|
+
// export const pageParentPropertiesSchema = z.object({
|
|
22
|
+
// title: z.object({
|
|
23
|
+
// title: richTextSchema,
|
|
24
|
+
// }),
|
|
25
|
+
// });
|
|
26
|
+
// export const databaseParentPropertiesSchema = z.record(
|
|
27
|
+
// z.string(),
|
|
28
|
+
// z.union([
|
|
29
|
+
// z.object({ title: richTextSchema }),
|
|
30
|
+
// z.object({ rich_text: richTextSchema }),
|
|
31
|
+
// z.object({ number: z.number().optional().nullable() }),
|
|
32
|
+
// z.object({ select: z.object({ name: z.string() }).optional().nullable() }),
|
|
33
|
+
// z.object({
|
|
34
|
+
// multi_select: z.array(z.object({ name: z.string() })).optional(),
|
|
35
|
+
// }),
|
|
36
|
+
// z.object({
|
|
37
|
+
// date: z
|
|
38
|
+
// .object({
|
|
39
|
+
// start: z.string(),
|
|
40
|
+
// end: z.string().optional(),
|
|
41
|
+
// time_zone: z.string().optional(),
|
|
42
|
+
// })
|
|
43
|
+
// .optional()
|
|
44
|
+
// .nullable(),
|
|
45
|
+
// }),
|
|
46
|
+
// z.object({ checkbox: z.boolean().optional() }),
|
|
47
|
+
// z.object({ url: z.string().url().optional().nullable() }),
|
|
48
|
+
// z.object({ email: z.string().email().optional().nullable() }),
|
|
49
|
+
// z.object({ phone_number: z.string().optional().nullable() }),
|
|
50
|
+
// ])
|
|
51
|
+
// );
|
|
52
|
+
// export const blockSchema = z
|
|
53
|
+
// .object({
|
|
54
|
+
// object: z.literal("block"),
|
|
55
|
+
// type: z.string(),
|
|
56
|
+
// })
|
|
57
|
+
// .and(z.record(z.string(), z.any()));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getRootPageId } from "../services/notion.js";
|
|
3
|
+
import { ICON_SCHEMA } from "./icon.js";
|
|
4
|
+
import { TEXT_BLOCK_REQUEST_SCHEMA } from "./blocks.js";
|
|
5
|
+
import { preprocessJson } from "./preprocess.js";
|
|
6
|
+
import { TEXT_CONTENT_REQUEST_SCHEMA } from "./rich-text.js";
|
|
7
|
+
import { FILE_SCHEMA } from "./file.js";
|
|
8
|
+
export const TITLE_PROPERTY_SCHEMA = z.object({
|
|
9
|
+
title: z
|
|
10
|
+
.array(z.object({
|
|
11
|
+
text: TEXT_CONTENT_REQUEST_SCHEMA.describe("Text content for title segment"),
|
|
12
|
+
}))
|
|
13
|
+
.describe("Array of text segments that make up the title"),
|
|
14
|
+
});
|
|
15
|
+
export const PARENT_SCHEMA = z.preprocess((val) => (typeof val === "string" ? JSON.parse(val) : val), z.union([
|
|
16
|
+
z.object({
|
|
17
|
+
type: z.literal("page_id").describe("Parent type for page"),
|
|
18
|
+
page_id: z.string().describe("ID of the parent page"),
|
|
19
|
+
}),
|
|
20
|
+
z.object({
|
|
21
|
+
type: z.literal("database_id").describe("Parent type for database"),
|
|
22
|
+
database_id: z.string().describe("ID of the parent database"),
|
|
23
|
+
}),
|
|
24
|
+
]));
|
|
25
|
+
export const CREATE_PAGE_SCHEMA = {
|
|
26
|
+
parent: PARENT_SCHEMA.optional()
|
|
27
|
+
.default({
|
|
28
|
+
type: "page_id",
|
|
29
|
+
page_id: getRootPageId(),
|
|
30
|
+
})
|
|
31
|
+
.describe("Optional parent - if not provided, will use NOTION_PAGE_ID as parent page"),
|
|
32
|
+
properties: z
|
|
33
|
+
.object({
|
|
34
|
+
title: TITLE_PROPERTY_SCHEMA.describe("The title of the page"),
|
|
35
|
+
})
|
|
36
|
+
.describe("Properties of the page"),
|
|
37
|
+
children: z
|
|
38
|
+
.array(TEXT_BLOCK_REQUEST_SCHEMA)
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Optional array of paragraph blocks to add as page content"),
|
|
41
|
+
icon: z.preprocess(preprocessJson, ICON_SCHEMA.nullable().optional().describe("Optional icon for the page")),
|
|
42
|
+
cover: z.preprocess(preprocessJson, FILE_SCHEMA.nullable()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("Optional cover image for the page")),
|
|
45
|
+
};
|
|
46
|
+
export const ARCHIVE_PAGE_SCHEMA = {
|
|
47
|
+
pageId: z.string().describe("The ID of the page to archive"),
|
|
48
|
+
};
|
|
49
|
+
export const RESTORE_PAGE_SCHEMA = {
|
|
50
|
+
pageId: z.string().describe("The ID of the page to restore"),
|
|
51
|
+
};
|
|
52
|
+
export const SEARCH_PAGES_SCHEMA = {
|
|
53
|
+
query: z.string().optional().describe("Search query for filtering by title"),
|
|
54
|
+
sort: z
|
|
55
|
+
.object({
|
|
56
|
+
direction: z.enum(["ascending", "descending"]),
|
|
57
|
+
timestamp: z.literal("last_edited_time"),
|
|
58
|
+
})
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Sort order for results"),
|
|
61
|
+
start_cursor: z.string().optional().describe("Cursor for pagination"),
|
|
62
|
+
page_size: z
|
|
63
|
+
.number()
|
|
64
|
+
.min(1)
|
|
65
|
+
.max(100)
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Number of results to return (1-100)"),
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const preprocessJson = (val) => typeof val === "string" ? JSON.parse(val) : val;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ANNOTATIONS_SCHEMA } from "./annotations.js";
|
|
3
|
+
import { MENTION_REQUEST_SCHEMA } from "./mention.js";
|
|
4
|
+
export const RICH_TEXT_BASE_SCHEMA = z.object({
|
|
5
|
+
plain_text: z.string().describe("Plain text content without formatting"),
|
|
6
|
+
href: z.string().nullable().describe("URL for the link"),
|
|
7
|
+
annotations: ANNOTATIONS_SCHEMA.describe("Text formatting annotations"),
|
|
8
|
+
});
|
|
9
|
+
export const RICH_TEXT_BASE_REQUEST_SCHEMA = z.object({
|
|
10
|
+
annotations: ANNOTATIONS_SCHEMA.optional().describe("Text formatting annotations"),
|
|
11
|
+
});
|
|
12
|
+
export const TEXT_CONTENT_REQUEST_SCHEMA = z
|
|
13
|
+
.object({
|
|
14
|
+
content: z.string().describe("The actual text content"),
|
|
15
|
+
link: z
|
|
16
|
+
.object({
|
|
17
|
+
url: z.string().url().describe("URL for the link"),
|
|
18
|
+
})
|
|
19
|
+
.optional()
|
|
20
|
+
.nullable()
|
|
21
|
+
.describe("Optional link associated with the text"),
|
|
22
|
+
})
|
|
23
|
+
.describe("Text content request object");
|
|
24
|
+
export const EQUATION_CONTENT_SCHEMA = z
|
|
25
|
+
.object({
|
|
26
|
+
expression: z.string().describe("LaTeX equation expression"),
|
|
27
|
+
})
|
|
28
|
+
.describe("Equation content object");
|
|
29
|
+
export const TEXT_RICH_TEXT_ITEM_REQUEST_SCHEMA = z
|
|
30
|
+
.object({
|
|
31
|
+
type: z.literal("text").describe("Type of rich text content"),
|
|
32
|
+
text: TEXT_CONTENT_REQUEST_SCHEMA.describe("Text content"),
|
|
33
|
+
annotations: ANNOTATIONS_SCHEMA.optional().describe("Text formatting annotations"),
|
|
34
|
+
plain_text: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Plain text content without formatting"),
|
|
38
|
+
href: z.string().nullable().optional().describe("URL for the link"),
|
|
39
|
+
})
|
|
40
|
+
.describe("Text rich text item request");
|
|
41
|
+
export const EQUATION_RICH_TEXT_ITEM_REQUEST_SCHEMA = z
|
|
42
|
+
.object({
|
|
43
|
+
type: z.literal("equation").describe("Type of equation content"),
|
|
44
|
+
equation: EQUATION_CONTENT_SCHEMA.describe("Equation content"),
|
|
45
|
+
annotations: ANNOTATIONS_SCHEMA.optional().describe("Text formatting annotations"),
|
|
46
|
+
plain_text: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Plain text content without formatting"),
|
|
50
|
+
href: z.string().nullable().optional().describe("URL for the link"),
|
|
51
|
+
})
|
|
52
|
+
.describe("Equation rich text item request");
|
|
53
|
+
export const MENTION_RICH_TEXT_ITEM_REQUEST_SCHEMA = z
|
|
54
|
+
.object({
|
|
55
|
+
type: z.literal("mention").describe("Type of mention content"),
|
|
56
|
+
mention: MENTION_REQUEST_SCHEMA.describe("Mention content"),
|
|
57
|
+
annotations: ANNOTATIONS_SCHEMA.optional().describe("Text formatting annotations"),
|
|
58
|
+
plain_text: z
|
|
59
|
+
.string()
|
|
60
|
+
.optional()
|
|
61
|
+
.describe("Plain text content without formatting"),
|
|
62
|
+
href: z.string().nullable().optional().describe("URL for the link"),
|
|
63
|
+
})
|
|
64
|
+
.describe("Mention rich text item request");
|
|
65
|
+
export const RICH_TEXT_ITEM_REQUEST_SCHEMA = z
|
|
66
|
+
.discriminatedUnion("type", [
|
|
67
|
+
TEXT_RICH_TEXT_ITEM_REQUEST_SCHEMA,
|
|
68
|
+
EQUATION_RICH_TEXT_ITEM_REQUEST_SCHEMA,
|
|
69
|
+
MENTION_RICH_TEXT_ITEM_REQUEST_SCHEMA,
|
|
70
|
+
])
|
|
71
|
+
.describe("Union of all possible rich text item request types");
|