notion-mcp-server 1.0.1 → 2.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.
Files changed (99) hide show
  1. package/README.md +383 -192
  2. package/build/config/index.js +3 -1
  3. package/build/dispatch/concurrency.js +15 -0
  4. package/build/dispatch/idempotency.js +38 -0
  5. package/build/dispatch/index.js +175 -0
  6. package/build/dispatch/rate-limit.js +56 -0
  7. package/build/dispatch/retry.js +97 -0
  8. package/build/index.js +1 -1
  9. package/build/markdown/parse.js +265 -0
  10. package/build/operations/blocks.js +331 -0
  11. package/build/operations/comments.js +191 -0
  12. package/build/operations/data-sources.js +85 -0
  13. package/build/operations/databases.js +345 -0
  14. package/build/operations/files.js +239 -0
  15. package/build/operations/index.js +19 -0
  16. package/build/operations/pages.js +486 -0
  17. package/build/operations/registry.js +16 -0
  18. package/build/operations/users.js +101 -0
  19. package/build/prompts/index.js +105 -0
  20. package/build/schema/blocks.js +19 -138
  21. package/build/schema/database.js +27 -111
  22. package/build/schema/emit.js +68 -0
  23. package/build/schema/file.js +1 -1
  24. package/build/schema/filter-dsl.js +333 -0
  25. package/build/schema/icon.js +1 -1
  26. package/build/schema/page-properties.js +17 -3
  27. package/build/schema/page.js +12 -125
  28. package/build/schema/refs.js +16 -0
  29. package/build/schema/rich-text.js +1 -1
  30. package/build/server/index.js +16 -3
  31. package/build/services/auth.js +19 -0
  32. package/build/services/notion.js +14 -17
  33. package/build/tools/index.js +119 -21
  34. package/build/utils/error.js +125 -86
  35. package/build/utils/handler.js +11 -0
  36. package/build/utils/learning-error.js +40 -0
  37. package/build/utils/notion-types.js +16 -0
  38. package/build/utils/paginate.js +35 -0
  39. package/build/utils/schema-slice.js +156 -0
  40. package/build/utils/slim.js +269 -0
  41. package/package.json +13 -7
  42. package/build/resources/imageList.js +0 -62
  43. package/build/resources/index.js +0 -1
  44. package/build/resources/predictionList.js +0 -43
  45. package/build/resources/svgList.js +0 -69
  46. package/build/schema/comments.js +0 -60
  47. package/build/schema/notion.js +0 -57
  48. package/build/schema/richText.js +0 -757
  49. package/build/schema/tools.js +0 -17
  50. package/build/schema/users.js +0 -39
  51. package/build/services/loggs.js +0 -13
  52. package/build/services/replicate.js +0 -23
  53. package/build/tools/appendBlockChildren.js +0 -25
  54. package/build/tools/batchAppendBlockChildren.js +0 -33
  55. package/build/tools/batchDeleteBlocks.js +0 -32
  56. package/build/tools/batchMixedOperations.js +0 -58
  57. package/build/tools/batchUpdateBlocks.js +0 -33
  58. package/build/tools/blocks.js +0 -34
  59. package/build/tools/comments.js +0 -81
  60. package/build/tools/createDatabase.js +0 -18
  61. package/build/tools/createPage.js +0 -18
  62. package/build/tools/createPrediction.js +0 -28
  63. package/build/tools/database.js +0 -16
  64. package/build/tools/deleteBlock.js +0 -24
  65. package/build/tools/formatRichText.js +0 -83
  66. package/build/tools/generateImage.js +0 -48
  67. package/build/tools/generateImageVariants.js +0 -105
  68. package/build/tools/generateMultipleImages.js +0 -60
  69. package/build/tools/generateSVG.js +0 -43
  70. package/build/tools/getPrediction.js +0 -22
  71. package/build/tools/pages.js +0 -22
  72. package/build/tools/predictionList.js +0 -30
  73. package/build/tools/queryDatabase.js +0 -22
  74. package/build/tools/retrieveBlock.js +0 -24
  75. package/build/tools/retrieveBlockChildren.js +0 -32
  76. package/build/tools/searchPage.js +0 -24
  77. package/build/tools/updateBlock.js +0 -25
  78. package/build/tools/updateDatabase.js +0 -18
  79. package/build/tools/updatePage.js +0 -40
  80. package/build/tools/updatePageProperties.js +0 -21
  81. package/build/tools/users.js +0 -75
  82. package/build/types/blocks.js +0 -12
  83. package/build/types/comments.js +0 -7
  84. package/build/types/database.js +0 -6
  85. package/build/types/notion.js +0 -1
  86. package/build/types/page.js +0 -8
  87. package/build/types/richText.js +0 -1
  88. package/build/types/tools.js +0 -1
  89. package/build/types/users.js +0 -6
  90. package/build/utils/blob.js +0 -5
  91. package/build/utils/image.js +0 -34
  92. package/build/utils/index.js +0 -1
  93. package/build/utils/richText.js +0 -174
  94. package/build/validation/blocks.js +0 -568
  95. package/build/validation/notion.js +0 -51
  96. package/build/validation/page.js +0 -262
  97. package/build/validation/richText.js +0 -744
  98. package/build/validation/tools.js +0 -16
  99. /package/build/{types/index.js → operations/types.js} +0 -0
@@ -1,105 +0,0 @@
1
- import { replicate } from "../services/replicate.js";
2
- import { handleError } from "../utils/error.js";
3
- import { outputToBase64 } from "../utils/image.js";
4
- import { CONFIG } from "../config/index.js";
5
- export const registerGenerateImageVariantsTool = async (input) => {
6
- const { prompt, num_variants, seed, support_image_mcp_response_type, prompt_variations, variation_mode, ...commonParams } = input;
7
- try {
8
- let effectiveVariants = num_variants;
9
- let usingPromptVariations = false;
10
- // Decide if we're using prompt variations
11
- if (prompt_variations && prompt_variations.length > 0) {
12
- usingPromptVariations = true;
13
- // If using prompt variations, number of variants is limited by available variations
14
- effectiveVariants = Math.min(num_variants, prompt_variations.length);
15
- }
16
- // Process all variants in parallel
17
- const generationPromises = Array.from({ length: effectiveVariants }, (_, index) => {
18
- // If seed is provided, create deterministic variants by adding the index
19
- const variantSeed = seed !== undefined ? seed + index : undefined;
20
- // Determine which prompt to use for this variant
21
- let variantPrompt = prompt;
22
- if (usingPromptVariations) {
23
- const variation = prompt_variations[index];
24
- if (variation_mode === "append") {
25
- variantPrompt = `${prompt} ${variation}`;
26
- }
27
- else {
28
- // 'replace' mode
29
- variantPrompt = variation;
30
- }
31
- }
32
- return replicate
33
- .run(CONFIG.imageModelId, {
34
- input: {
35
- prompt: variantPrompt,
36
- seed: variantSeed,
37
- ...commonParams,
38
- },
39
- })
40
- .then((outputs) => {
41
- const [output] = outputs;
42
- const imageUrl = output.url();
43
- if (support_image_mcp_response_type) {
44
- return outputToBase64(output).then((imageBase64) => ({
45
- variantIndex: index + 1,
46
- imageUrl,
47
- imageBase64,
48
- usedPrompt: variantPrompt,
49
- }));
50
- }
51
- return {
52
- variantIndex: index + 1,
53
- imageUrl,
54
- usedPrompt: variantPrompt,
55
- };
56
- });
57
- });
58
- // Wait for all variant generation to complete
59
- const results = (await Promise.all(generationPromises));
60
- // Build response content
61
- const responseContent = [];
62
- // Add intro text - different based on whether we're using prompt variations
63
- if (usingPromptVariations) {
64
- responseContent.push({
65
- type: "text",
66
- text: `Generated ${results.length} variants of "${prompt}" using custom prompt variations (${variation_mode} mode)`,
67
- });
68
- }
69
- else {
70
- responseContent.push({
71
- type: "text",
72
- text: `Generated ${results.length} variants of: "${prompt}" using seed variations`,
73
- });
74
- }
75
- // Add each variant with its index and prompt info
76
- for (const result of results) {
77
- // Build an appropriate description based on variant type
78
- let variantDescription = `Variant #${result.variantIndex}`;
79
- if (usingPromptVariations) {
80
- variantDescription += `\nPrompt: "${result.usedPrompt}"`;
81
- }
82
- else if (seed !== undefined) {
83
- variantDescription += ` (seed: ${seed + (result.variantIndex - 1)})`;
84
- }
85
- variantDescription += `\nImage URL: ${result.imageUrl}`;
86
- responseContent.push({
87
- type: "text",
88
- text: `\n\n${variantDescription}`,
89
- });
90
- if (support_image_mcp_response_type && result.imageBase64) {
91
- responseContent.push({
92
- type: "image",
93
- data: result.imageBase64,
94
- mimeType: `image/${input.output_format === "jpg" ? "jpeg" : input.output_format}`,
95
- });
96
- }
97
- }
98
- return {
99
- content: responseContent,
100
- };
101
- }
102
- catch (error) {
103
- handleError(error);
104
- }
105
- };
@@ -1,60 +0,0 @@
1
- import { replicate } from "../services/replicate.js";
2
- import { handleError } from "../utils/error.js";
3
- import { outputToBase64 } from "../utils/image.js";
4
- import { CONFIG } from "../config/index.js";
5
- export const registerGenerateMultipleImagesTool = async (input) => {
6
- const { prompts, support_image_mcp_response_type, ...commonParams } = input;
7
- try {
8
- // Process all prompts in parallel
9
- const generationPromises = prompts.map(async (prompt) => {
10
- const [output] = (await replicate.run(CONFIG.imageModelId, {
11
- input: {
12
- prompt,
13
- ...commonParams,
14
- },
15
- }));
16
- const imageUrl = output.url();
17
- if (support_image_mcp_response_type) {
18
- const imageBase64 = await outputToBase64(output);
19
- return {
20
- prompt,
21
- imageUrl,
22
- imageBase64,
23
- };
24
- }
25
- return {
26
- prompt,
27
- imageUrl,
28
- };
29
- });
30
- // Wait for all image generation to complete
31
- const results = await Promise.all(generationPromises);
32
- // Build response content
33
- const responseContent = [];
34
- // Add intro text
35
- responseContent.push({
36
- type: "text",
37
- text: `Generated ${results.length} images based on your prompts:`,
38
- });
39
- // Add each image with its prompt
40
- for (const result of results) {
41
- responseContent.push({
42
- type: "text",
43
- text: `\n\nPrompt: "${result.prompt}"\nImage URL: ${result.imageUrl}`,
44
- });
45
- if (support_image_mcp_response_type && result.imageBase64) {
46
- responseContent.push({
47
- type: "image",
48
- data: result.imageBase64,
49
- mimeType: `image/${input.output_format === "jpg" ? "jpeg" : input.output_format}`,
50
- });
51
- }
52
- }
53
- return {
54
- content: responseContent,
55
- };
56
- }
57
- catch (error) {
58
- handleError(error);
59
- }
60
- };
@@ -1,43 +0,0 @@
1
- import { replicate } from "../services/replicate.js";
2
- import { handleError } from "../utils/error.js";
3
- import { urlToSvg } from "../utils/image.js";
4
- import { CONFIG } from "../config/index.js";
5
- export const registerGenerateSvgTool = async (input) => {
6
- try {
7
- const output = (await replicate.run(CONFIG.svgModelId, {
8
- input,
9
- }));
10
- const svgUrl = output.url();
11
- if (!svgUrl) {
12
- throw new Error("Failed to generate SVG URL");
13
- }
14
- try {
15
- const svg = await urlToSvg(svgUrl);
16
- return {
17
- content: [
18
- {
19
- type: "text",
20
- text: `This is a generated SVG url: ${svgUrl}`,
21
- },
22
- {
23
- type: "text",
24
- text: svg,
25
- },
26
- ],
27
- };
28
- }
29
- catch (error) {
30
- return {
31
- content: [
32
- {
33
- type: "text",
34
- text: `This is a generated SVG url: ${svgUrl}`,
35
- },
36
- ],
37
- };
38
- }
39
- }
40
- catch (error) {
41
- return handleError(error);
42
- }
43
- };
@@ -1,22 +0,0 @@
1
- // import { replicate } from "../services/replicate.js";
2
- // import { handleError } from "../utils/error.js";
3
- // import { GetPredictionParams } from "../types/index.js";
4
- // import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
5
- export {};
6
- // export const registerGetPredictionTool = async ({
7
- // predictionId,
8
- // }: GetPredictionParams): Promise<CallToolResult> => {
9
- // try {
10
- // const prediction = await replicate.predictions.get(predictionId);
11
- // return {
12
- // content: [
13
- // {
14
- // type: "text",
15
- // text: JSON.stringify(prediction, null, 2),
16
- // },
17
- // ],
18
- // };
19
- // } catch (error) {
20
- // handleError(error);
21
- // }
22
- // };
@@ -1,22 +0,0 @@
1
- import { handleNotionError } from "../utils/error.js";
2
- import { registerCreatePageTool } from "./createPage.js";
3
- import { archivePage } from "./updatePage.js";
4
- import { restorePage } from "./updatePage.js";
5
- import { searchPages } from "./searchPage.js";
6
- import { updatePageProperties } from "./updatePageProperties.js";
7
- export const registerPagesOperationTool = async (params) => {
8
- switch (params.payload.action) {
9
- case "create_page":
10
- return registerCreatePageTool(params.payload.params);
11
- case "archive_page":
12
- return archivePage(params.payload.params);
13
- case "restore_page":
14
- return restorePage(params.payload.params);
15
- case "search_pages":
16
- return searchPages(params.payload.params);
17
- case "update_page_properties":
18
- return updatePageProperties(params.payload.params);
19
- default:
20
- return handleNotionError(new Error(`Unsupported action, use one of the following: "create_page", "archive_page", "restore_page", "search_pages", "update_page_properties"`));
21
- }
22
- };
@@ -1,30 +0,0 @@
1
- import { replicate } from "../services/replicate.js";
2
- import { handleError } from "../utils/error.js";
3
- export const registerPredictionListTool = async ({ limit, }) => {
4
- try {
5
- const predictions = [];
6
- for await (const page of replicate.paginate(replicate.predictions.list)) {
7
- predictions.push(...page);
8
- if (predictions.length >= limit) {
9
- break;
10
- }
11
- }
12
- const limitedPredictions = predictions.slice(0, limit);
13
- const totalPages = Math.ceil(predictions.length / limit);
14
- return {
15
- content: [
16
- {
17
- type: "text",
18
- text: `Found ${limitedPredictions.length} predictions (showing ${limitedPredictions.length} of ${predictions.length} total, page 1 of ${totalPages})`,
19
- },
20
- {
21
- type: "text",
22
- text: JSON.stringify(limitedPredictions, null, 2),
23
- },
24
- ],
25
- };
26
- }
27
- catch (error) {
28
- handleError(error);
29
- }
30
- };
@@ -1,22 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export const queryDatabase = async (params) => {
4
- try {
5
- const response = await notion.databases.query(params);
6
- return {
7
- content: [
8
- {
9
- type: "text",
10
- text: `Database queried successfully. Found ${response.results.length} results.`,
11
- },
12
- {
13
- type: "text",
14
- text: JSON.stringify(response, null, 2),
15
- },
16
- ],
17
- };
18
- }
19
- catch (error) {
20
- return handleNotionError(error);
21
- }
22
- };
@@ -1,24 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export const retrieveBlock = async (params) => {
4
- try {
5
- const response = await notion.blocks.retrieve({
6
- block_id: params.blockId,
7
- });
8
- return {
9
- content: [
10
- {
11
- type: "text",
12
- text: "Block retrieved successfully! Note: If this block has children, use the retrieve_block_children endpoint to get the list of child blocks.",
13
- },
14
- {
15
- type: "text",
16
- text: JSON.stringify(response, null, 2),
17
- },
18
- ],
19
- };
20
- }
21
- catch (error) {
22
- return handleNotionError(error);
23
- }
24
- };
@@ -1,32 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export const retrieveBlockChildren = async (params) => {
4
- try {
5
- const response = await notion.blocks.children.list({
6
- block_id: params.blockId,
7
- start_cursor: params.start_cursor,
8
- page_size: params.page_size,
9
- });
10
- return {
11
- content: [
12
- {
13
- type: "text",
14
- text: `Successfully retrieved ${response.results.length} children of block ${params.blockId}`,
15
- },
16
- {
17
- type: "text",
18
- text: `Has more: ${response.has_more ? "Yes" : "No"}${response.has_more && response.next_cursor
19
- ? `, Next cursor: ${response.next_cursor}`
20
- : ""}`,
21
- },
22
- {
23
- type: "text",
24
- text: JSON.stringify(response.results, null, 2),
25
- },
26
- ],
27
- };
28
- }
29
- catch (error) {
30
- return handleNotionError(error);
31
- }
32
- };
@@ -1,24 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export async function searchPages(params) {
4
- try {
5
- const response = await notion.search({
6
- query: params.query || "",
7
- sort: params.sort,
8
- start_cursor: params.start_cursor,
9
- page_size: params.page_size || 10,
10
- });
11
- const resultsText = JSON.stringify(response, null, 2);
12
- return {
13
- content: [
14
- {
15
- type: "text",
16
- text: `Found ${response.results.length} results. ${response.has_more ? "More results available." : ""}\n\n${resultsText}`,
17
- },
18
- ],
19
- };
20
- }
21
- catch (error) {
22
- return handleNotionError(error);
23
- }
24
- }
@@ -1,25 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export const updateBlock = async (params) => {
4
- try {
5
- const response = await notion.blocks.update({
6
- block_id: params.blockId,
7
- ...params.data,
8
- });
9
- return {
10
- content: [
11
- {
12
- type: "text",
13
- text: `Block ${response.id} updated successfully`,
14
- },
15
- {
16
- type: "text",
17
- text: JSON.stringify(response, null, 2),
18
- },
19
- ],
20
- };
21
- }
22
- catch (error) {
23
- return handleNotionError(error);
24
- }
25
- };
@@ -1,18 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export const updateDatabase = async (params) => {
4
- try {
5
- const response = await notion.databases.update(params);
6
- return {
7
- content: [
8
- {
9
- type: "text",
10
- text: `Database updated successfully: ${response.id}`,
11
- },
12
- ],
13
- };
14
- }
15
- catch (error) {
16
- return handleNotionError(error);
17
- }
18
- };
@@ -1,40 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export async function archivePage(params) {
4
- try {
5
- const response = await notion.pages.update({
6
- page_id: params.pageId,
7
- archived: true,
8
- });
9
- return {
10
- content: [
11
- {
12
- type: "text",
13
- text: `Page archived successfully: ${response.id}`,
14
- },
15
- ],
16
- };
17
- }
18
- catch (error) {
19
- return handleNotionError(error);
20
- }
21
- }
22
- export async function restorePage(params) {
23
- try {
24
- const response = await notion.pages.update({
25
- page_id: params.pageId,
26
- archived: false,
27
- });
28
- return {
29
- content: [
30
- {
31
- type: "text",
32
- text: `Page restored successfully: ${response.id}`,
33
- },
34
- ],
35
- };
36
- }
37
- catch (error) {
38
- return handleNotionError(error);
39
- }
40
- }
@@ -1,21 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export async function updatePageProperties(params) {
4
- try {
5
- const response = await notion.pages.update({
6
- page_id: params.pageId,
7
- properties: params.properties,
8
- });
9
- return {
10
- content: [
11
- {
12
- type: "text",
13
- text: `Page properties updated successfully: ${response.id}`,
14
- },
15
- ],
16
- };
17
- }
18
- catch (error) {
19
- return handleNotionError(error);
20
- }
21
- }
@@ -1,75 +0,0 @@
1
- import { notion } from "../services/notion.js";
2
- import { handleNotionError } from "../utils/error.js";
3
- export const registerGetListUsersTool = async (params) => {
4
- try {
5
- const response = await notion.users.list(params);
6
- return {
7
- content: [
8
- {
9
- type: "text",
10
- text: `Users retrieved successfully: ${response.results.length}`,
11
- },
12
- {
13
- type: "text",
14
- text: JSON.stringify(response, null, 2),
15
- },
16
- ],
17
- };
18
- }
19
- catch (error) {
20
- return handleNotionError(error);
21
- }
22
- };
23
- export const registerGetUserTool = async (params) => {
24
- try {
25
- const response = await notion.users.retrieve(params);
26
- return {
27
- content: [
28
- {
29
- type: "text",
30
- text: `User retrieved successfully: ${response.id}`,
31
- },
32
- {
33
- type: "text",
34
- text: JSON.stringify(response, null, 2),
35
- },
36
- ],
37
- };
38
- }
39
- catch (error) {
40
- return handleNotionError(error);
41
- }
42
- };
43
- export const registerGetBotUserTool = async () => {
44
- try {
45
- const response = await notion.users.me({});
46
- return {
47
- content: [
48
- {
49
- type: "text",
50
- text: `Bot user retrieved successfully: ${response.id}`,
51
- },
52
- {
53
- type: "text",
54
- text: JSON.stringify(response, null, 2),
55
- },
56
- ],
57
- };
58
- }
59
- catch (error) {
60
- return handleNotionError(error);
61
- }
62
- };
63
- // Combined tool function that handles all user operations
64
- export const registerUsersOperationTool = async (params) => {
65
- switch (params.payload.action) {
66
- case "list_users":
67
- return registerGetListUsersTool(params.payload.params);
68
- case "get_user":
69
- return registerGetUserTool(params.payload.params);
70
- case "get_bot_user":
71
- return registerGetBotUserTool();
72
- default:
73
- return handleNotionError(new Error(`Unsupported action, use one of the following: "list_users", "get_user", "get_bot_user"`));
74
- }
75
- };
@@ -1,12 +0,0 @@
1
- import { z } from "zod";
2
- import { APPEND_BLOCK_CHILDREN_SCHEMA, RETRIEVE_BLOCK_SCHEMA, RETRIEVE_BLOCK_CHILDREN_SCHEMA, UPDATE_BLOCK_SCHEMA, DELETE_BLOCK_SCHEMA, BATCH_APPEND_BLOCK_CHILDREN_SCHEMA, BATCH_UPDATE_BLOCKS_SCHEMA, BATCH_DELETE_BLOCKS_SCHEMA, BATCH_MIXED_OPERATIONS_SCHEMA, BLOCKS_OPERATION_SCHEMA, } from "../schema/blocks.js";
3
- export const appendBlockChildrenSchema = z.object(APPEND_BLOCK_CHILDREN_SCHEMA);
4
- export const retrieveBlockSchema = z.object(RETRIEVE_BLOCK_SCHEMA);
5
- export const retrieveBlockChildrenSchema = z.object(RETRIEVE_BLOCK_CHILDREN_SCHEMA);
6
- export const updateBlockSchema = z.object(UPDATE_BLOCK_SCHEMA);
7
- export const deleteBlockSchema = z.object(DELETE_BLOCK_SCHEMA);
8
- export const batchAppendBlockChildrenSchema = z.object(BATCH_APPEND_BLOCK_CHILDREN_SCHEMA);
9
- export const batchUpdateBlocksSchema = z.object(BATCH_UPDATE_BLOCKS_SCHEMA);
10
- export const batchDeleteBlocksSchema = z.object(BATCH_DELETE_BLOCKS_SCHEMA);
11
- export const batchMixedOperationsSchema = z.object(BATCH_MIXED_OPERATIONS_SCHEMA);
12
- export const blocksOperationSchema = z.object(BLOCKS_OPERATION_SCHEMA);
@@ -1,7 +0,0 @@
1
- import { z } from "zod";
2
- import { GET_COMMENTS_SCHEMA, ADD_PAGE_COMMENT_SCHEMA, ADD_DISCUSSION_COMMENT_SCHEMA, COMMENTS_OPERATION_SCHEMA, } from "../schema/comments.js";
3
- // Types inferred from the schemas
4
- export const getCommentsSchema = z.object(GET_COMMENTS_SCHEMA);
5
- export const addPageCommentSchema = z.object(ADD_PAGE_COMMENT_SCHEMA);
6
- export const addDiscussionCommentSchema = z.object(ADD_DISCUSSION_COMMENT_SCHEMA);
7
- export const commentsOperationSchema = z.object(COMMENTS_OPERATION_SCHEMA);
@@ -1,6 +0,0 @@
1
- import { z } from "zod";
2
- import { CREATE_DATABASE_SCHEMA, QUERY_DATABASE_SCHEMA, UPDATE_DATABASE_SCHEMA, DATABASE_OPERATION_SCHEMA, } from "../schema/database.js";
3
- export const createDatabaseSchema = z.object(CREATE_DATABASE_SCHEMA);
4
- export const queryDatabaseSchema = z.object(QUERY_DATABASE_SCHEMA);
5
- export const updateDatabaseSchema = z.object(UPDATE_DATABASE_SCHEMA);
6
- export const databaseOperationSchema = z.object(DATABASE_OPERATION_SCHEMA);
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
- import { ARCHIVE_PAGE_SCHEMA, CREATE_PAGE_SCHEMA, RESTORE_PAGE_SCHEMA, SEARCH_PAGES_SCHEMA, UPDATE_PAGE_PROPERTIES_SCHEMA, PAGES_OPERATION_SCHEMA, } from "../schema/page.js";
3
- export const createPageSchema = z.object(CREATE_PAGE_SCHEMA);
4
- export const archivePageSchema = z.object(ARCHIVE_PAGE_SCHEMA);
5
- export const restorePageSchema = z.object(RESTORE_PAGE_SCHEMA);
6
- export const searchPagesSchema = z.object(SEARCH_PAGES_SCHEMA);
7
- export const updatePagePropertiesSchema = z.object(UPDATE_PAGE_PROPERTIES_SCHEMA);
8
- export const pagesOperationSchema = z.object(PAGES_OPERATION_SCHEMA);
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import { z } from "zod";
2
- import { LIST_USERS_SCHEMA, GET_USER_SCHEMA, USERS_OPERATION_SCHEMA, } from "../schema/users.js";
3
- // Types inferred from schemas
4
- const listUsersSchema = z.object(LIST_USERS_SCHEMA);
5
- const getUserSchema = z.object(GET_USER_SCHEMA);
6
- const usersOperationSchema = z.object(USERS_OPERATION_SCHEMA);
@@ -1,5 +0,0 @@
1
- export async function outputToBase64(output) {
2
- const blob = await output.blob();
3
- const buffer = Buffer.from(await blob.arrayBuffer());
4
- return buffer.toString("base64");
5
- }