@atikk-co-jp/notion-mcp-server 0.7.0 → 0.8.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/README.ja.md +3 -2
- package/README.md +3 -2
- package/dist/src/converters/__tests__/block-to-markdown.test.js +482 -111
- package/dist/src/converters/__tests__/markdown-to-blocks.test.js +116 -13
- package/dist/src/converters/__tests__/page-to-markdown.test.js +83 -70
- package/dist/src/converters/__tests__/rich-text-to-markdown.test.js +23 -26
- package/dist/src/converters/block-to-markdown.d.ts +4 -13
- package/dist/src/converters/block-to-markdown.d.ts.map +1 -1
- package/dist/src/converters/block-to-markdown.js +117 -120
- package/dist/src/converters/index.d.ts +3 -3
- package/dist/src/converters/index.d.ts.map +1 -1
- package/dist/src/converters/index.js +1 -1
- package/dist/src/converters/markdown-to-blocks.d.ts +21 -7
- package/dist/src/converters/markdown-to-blocks.d.ts.map +1 -1
- package/dist/src/converters/markdown-to-blocks.js +56 -0
- package/dist/src/converters/page-to-markdown.d.ts +5 -20
- package/dist/src/converters/page-to-markdown.d.ts.map +1 -1
- package/dist/src/converters/page-to-markdown.js +47 -37
- package/dist/src/converters/rich-text-to-markdown.d.ts +3 -47
- package/dist/src/converters/rich-text-to-markdown.d.ts.map +1 -1
- package/dist/src/converters/rich-text-to-markdown.js +15 -14
- package/dist/src/notion-client.d.ts +5 -177
- package/dist/src/notion-client.d.ts.map +1 -1
- package/dist/src/notion-client.js +6 -172
- package/dist/src/schemas/descriptions/examples.d.ts +14 -0
- package/dist/src/schemas/descriptions/examples.d.ts.map +1 -0
- package/dist/src/schemas/descriptions/examples.js +87 -0
- package/dist/src/schemas/descriptions/fields.d.ts +146 -0
- package/dist/src/schemas/descriptions/fields.d.ts.map +1 -0
- package/dist/src/schemas/descriptions/fields.js +184 -0
- package/dist/src/schemas/descriptions/index.d.ts +3 -0
- package/dist/src/schemas/descriptions/index.d.ts.map +1 -0
- package/dist/src/schemas/descriptions/index.js +2 -0
- package/dist/src/schemas/index.d.ts +1 -5
- package/dist/src/schemas/index.d.ts.map +1 -1
- package/dist/src/schemas/index.js +2 -10
- package/dist/src/tools/__tests__/context-size.test.d.ts +2 -0
- package/dist/src/tools/__tests__/context-size.test.d.ts.map +1 -0
- package/dist/src/tools/__tests__/context-size.test.js +143 -0
- package/dist/src/tools/__tests__/error-handler.test.d.ts +2 -0
- package/dist/src/tools/__tests__/error-handler.test.d.ts.map +1 -0
- package/dist/src/tools/__tests__/error-handler.test.js +125 -0
- package/dist/src/tools/append-block-children.d.ts.map +1 -1
- package/dist/src/tools/append-block-children.js +8 -5
- package/dist/src/tools/append-blocks-simple.d.ts.map +1 -1
- package/dist/src/tools/append-blocks-simple.js +9 -13
- package/dist/src/tools/archive-database.d.ts.map +1 -1
- package/dist/src/tools/archive-database.js +3 -2
- package/dist/src/tools/archive-page.d.ts.map +1 -1
- package/dist/src/tools/archive-page.js +2 -1
- package/dist/src/tools/create-comment-simple.d.ts.map +1 -1
- package/dist/src/tools/create-comment-simple.js +5 -4
- package/dist/src/tools/create-comment.d.ts.map +1 -1
- package/dist/src/tools/create-comment.js +9 -6
- package/dist/src/tools/create-database.d.ts.map +1 -1
- package/dist/src/tools/create-database.js +19 -25
- package/dist/src/tools/create-page-simple.d.ts +1 -1
- package/dist/src/tools/create-page-simple.d.ts.map +1 -1
- package/dist/src/tools/create-page-simple.js +26 -27
- package/dist/src/tools/create-page.d.ts.map +1 -1
- package/dist/src/tools/create-page.js +10 -6
- package/dist/src/tools/delete-block.d.ts.map +1 -1
- package/dist/src/tools/delete-block.js +2 -1
- package/dist/src/tools/get-block-children.d.ts +1 -1
- package/dist/src/tools/get-block-children.d.ts.map +1 -1
- package/dist/src/tools/get-block-children.js +13 -27
- package/dist/src/tools/index.d.ts +2 -2
- package/dist/src/tools/index.d.ts.map +1 -1
- package/dist/src/tools/index.js +2 -2
- package/dist/src/tools/list-comments.d.ts +1 -1
- package/dist/src/tools/list-comments.d.ts.map +1 -1
- package/dist/src/tools/list-comments.js +11 -10
- package/dist/src/tools/list-users.d.ts.map +1 -1
- package/dist/src/tools/list-users.js +4 -3
- package/dist/src/tools/move-page.d.ts.map +1 -1
- package/dist/src/tools/move-page.js +5 -4
- package/dist/src/tools/query-data-source.d.ts +1 -1
- package/dist/src/tools/query-data-source.d.ts.map +1 -1
- package/dist/src/tools/query-data-source.js +23 -30
- package/dist/src/tools/retrieve-block.d.ts +1 -1
- package/dist/src/tools/retrieve-block.d.ts.map +1 -1
- package/dist/src/tools/retrieve-block.js +13 -10
- package/dist/src/tools/retrieve-bot-user.js +1 -1
- package/dist/src/tools/retrieve-data-source.d.ts +1 -1
- package/dist/src/tools/retrieve-data-source.d.ts.map +1 -1
- package/dist/src/tools/retrieve-data-source.js +15 -11
- package/dist/src/tools/retrieve-database.d.ts +1 -1
- package/dist/src/tools/retrieve-database.d.ts.map +1 -1
- package/dist/src/tools/retrieve-database.js +11 -6
- package/dist/src/tools/retrieve-page-property.d.ts.map +1 -1
- package/dist/src/tools/retrieve-page-property.js +6 -5
- package/dist/src/tools/retrieve-page.d.ts +1 -1
- package/dist/src/tools/retrieve-page.d.ts.map +1 -1
- package/dist/src/tools/retrieve-page.js +15 -20
- package/dist/src/tools/retrieve-user.d.ts.map +1 -1
- package/dist/src/tools/retrieve-user.js +2 -1
- package/dist/src/tools/search.d.ts.map +1 -1
- package/dist/src/tools/search.js +10 -17
- package/dist/src/tools/update-block-simple.d.ts +1 -1
- package/dist/src/tools/update-block-simple.d.ts.map +1 -1
- package/dist/src/tools/update-block-simple.js +14 -4
- package/dist/src/tools/update-block.d.ts.map +1 -1
- package/dist/src/tools/update-block.js +8 -5
- package/dist/src/tools/update-data-source.d.ts.map +1 -1
- package/dist/src/tools/update-data-source.js +7 -7
- package/dist/src/tools/update-database.d.ts.map +1 -1
- package/dist/src/tools/update-database.js +22 -32
- package/dist/src/tools/update-page.d.ts.map +1 -1
- package/dist/src/tools/update-page.js +11 -8
- package/dist/src/utils/error-handler.d.ts +16 -7
- package/dist/src/utils/error-handler.d.ts.map +1 -1
- package/dist/src/utils/error-handler.js +44 -17
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +1 -1
- package/package.json +2 -1
- package/dist/src/schemas/block.d.ts +0 -3787
- package/dist/src/schemas/block.d.ts.map +0 -1
- package/dist/src/schemas/block.js +0 -402
- package/dist/src/schemas/common.d.ts +0 -638
- package/dist/src/schemas/common.d.ts.map +0 -1
- package/dist/src/schemas/common.js +0 -163
- package/dist/src/schemas/database.d.ts +0 -687
- package/dist/src/schemas/database.d.ts.map +0 -1
- package/dist/src/schemas/database.js +0 -258
- package/dist/src/schemas/filter.d.ts +0 -611
- package/dist/src/schemas/filter.d.ts.map +0 -1
- package/dist/src/schemas/filter.js +0 -222
- package/dist/src/schemas/page.d.ts +0 -2607
- package/dist/src/schemas/page.d.ts.map +0 -1
- package/dist/src/schemas/page.js +0 -328
- package/dist/src/schemas/schemas.test.d.ts +0 -2
- package/dist/src/schemas/schemas.test.d.ts.map +0 -1
- package/dist/src/schemas/schemas.test.js +0 -418
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
// Text filter conditions (for title, rich_text, url, email, phone_number)
|
|
3
|
-
const TextFilterConditionSchema = z
|
|
4
|
-
.object({
|
|
5
|
-
equals: z.string().optional(),
|
|
6
|
-
does_not_equal: z.string().optional(),
|
|
7
|
-
contains: z.string().optional(),
|
|
8
|
-
does_not_contain: z.string().optional(),
|
|
9
|
-
starts_with: z.string().optional(),
|
|
10
|
-
ends_with: z.string().optional(),
|
|
11
|
-
is_empty: z.literal(true).optional(),
|
|
12
|
-
is_not_empty: z.literal(true).optional(),
|
|
13
|
-
})
|
|
14
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
15
|
-
message: 'Exactly one filter condition must be specified',
|
|
16
|
-
});
|
|
17
|
-
// Number filter conditions
|
|
18
|
-
const NumberFilterConditionSchema = z
|
|
19
|
-
.object({
|
|
20
|
-
equals: z.number().optional(),
|
|
21
|
-
does_not_equal: z.number().optional(),
|
|
22
|
-
greater_than: z.number().optional(),
|
|
23
|
-
less_than: z.number().optional(),
|
|
24
|
-
greater_than_or_equal_to: z.number().optional(),
|
|
25
|
-
less_than_or_equal_to: z.number().optional(),
|
|
26
|
-
is_empty: z.literal(true).optional(),
|
|
27
|
-
is_not_empty: z.literal(true).optional(),
|
|
28
|
-
})
|
|
29
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
30
|
-
message: 'Exactly one filter condition must be specified',
|
|
31
|
-
});
|
|
32
|
-
// Checkbox filter conditions
|
|
33
|
-
const CheckboxFilterConditionSchema = z
|
|
34
|
-
.object({
|
|
35
|
-
equals: z.boolean().optional(),
|
|
36
|
-
does_not_equal: z.boolean().optional(),
|
|
37
|
-
})
|
|
38
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
39
|
-
message: 'Exactly one filter condition must be specified',
|
|
40
|
-
});
|
|
41
|
-
// Select filter conditions
|
|
42
|
-
const SelectFilterConditionSchema = z
|
|
43
|
-
.object({
|
|
44
|
-
equals: z.string().optional(),
|
|
45
|
-
does_not_equal: z.string().optional(),
|
|
46
|
-
is_empty: z.literal(true).optional(),
|
|
47
|
-
is_not_empty: z.literal(true).optional(),
|
|
48
|
-
})
|
|
49
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
50
|
-
message: 'Exactly one filter condition must be specified',
|
|
51
|
-
});
|
|
52
|
-
// Multi-select filter conditions
|
|
53
|
-
const MultiSelectFilterConditionSchema = z
|
|
54
|
-
.object({
|
|
55
|
-
contains: z.string().optional(),
|
|
56
|
-
does_not_contain: z.string().optional(),
|
|
57
|
-
is_empty: z.literal(true).optional(),
|
|
58
|
-
is_not_empty: z.literal(true).optional(),
|
|
59
|
-
})
|
|
60
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
61
|
-
message: 'Exactly one filter condition must be specified',
|
|
62
|
-
});
|
|
63
|
-
// Status filter conditions
|
|
64
|
-
const StatusFilterConditionSchema = z
|
|
65
|
-
.object({
|
|
66
|
-
equals: z.string().optional(),
|
|
67
|
-
does_not_equal: z.string().optional(),
|
|
68
|
-
is_empty: z.literal(true).optional(),
|
|
69
|
-
is_not_empty: z.literal(true).optional(),
|
|
70
|
-
})
|
|
71
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
72
|
-
message: 'Exactly one filter condition must be specified',
|
|
73
|
-
});
|
|
74
|
-
// Date filter conditions
|
|
75
|
-
const DateFilterConditionSchema = z
|
|
76
|
-
.object({
|
|
77
|
-
equals: z.string().optional(),
|
|
78
|
-
before: z.string().optional(),
|
|
79
|
-
after: z.string().optional(),
|
|
80
|
-
on_or_before: z.string().optional(),
|
|
81
|
-
on_or_after: z.string().optional(),
|
|
82
|
-
past_week: z.object({}).optional(),
|
|
83
|
-
past_month: z.object({}).optional(),
|
|
84
|
-
past_year: z.object({}).optional(),
|
|
85
|
-
this_week: z.object({}).optional(),
|
|
86
|
-
next_week: z.object({}).optional(),
|
|
87
|
-
next_month: z.object({}).optional(),
|
|
88
|
-
next_year: z.object({}).optional(),
|
|
89
|
-
is_empty: z.literal(true).optional(),
|
|
90
|
-
is_not_empty: z.literal(true).optional(),
|
|
91
|
-
})
|
|
92
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
93
|
-
message: 'Exactly one filter condition must be specified',
|
|
94
|
-
});
|
|
95
|
-
// Relation filter conditions
|
|
96
|
-
const RelationFilterConditionSchema = z
|
|
97
|
-
.object({
|
|
98
|
-
contains: z.string().optional(),
|
|
99
|
-
does_not_contain: z.string().optional(),
|
|
100
|
-
is_empty: z.literal(true).optional(),
|
|
101
|
-
is_not_empty: z.literal(true).optional(),
|
|
102
|
-
})
|
|
103
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
104
|
-
message: 'Exactly one filter condition must be specified',
|
|
105
|
-
});
|
|
106
|
-
// People filter conditions
|
|
107
|
-
const PeopleFilterConditionSchema = z
|
|
108
|
-
.object({
|
|
109
|
-
contains: z.string().optional(),
|
|
110
|
-
does_not_contain: z.string().optional(),
|
|
111
|
-
is_empty: z.literal(true).optional(),
|
|
112
|
-
is_not_empty: z.literal(true).optional(),
|
|
113
|
-
})
|
|
114
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
115
|
-
message: 'Exactly one filter condition must be specified',
|
|
116
|
-
});
|
|
117
|
-
// Files filter conditions
|
|
118
|
-
const FilesFilterConditionSchema = z
|
|
119
|
-
.object({
|
|
120
|
-
is_empty: z.literal(true).optional(),
|
|
121
|
-
is_not_empty: z.literal(true).optional(),
|
|
122
|
-
})
|
|
123
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
124
|
-
message: 'Exactly one filter condition must be specified',
|
|
125
|
-
});
|
|
126
|
-
// Formula filter conditions (nested based on formula result type)
|
|
127
|
-
const FormulaFilterConditionSchema = z
|
|
128
|
-
.object({
|
|
129
|
-
checkbox: CheckboxFilterConditionSchema.optional(),
|
|
130
|
-
date: DateFilterConditionSchema.optional(),
|
|
131
|
-
number: NumberFilterConditionSchema.optional(),
|
|
132
|
-
string: TextFilterConditionSchema.optional(),
|
|
133
|
-
})
|
|
134
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
135
|
-
message: 'Exactly one formula result type must be specified',
|
|
136
|
-
});
|
|
137
|
-
// Unique ID filter conditions
|
|
138
|
-
const UniqueIdFilterConditionSchema = z
|
|
139
|
-
.object({
|
|
140
|
-
equals: z.number().optional(),
|
|
141
|
-
does_not_equal: z.number().optional(),
|
|
142
|
-
greater_than: z.number().optional(),
|
|
143
|
-
less_than: z.number().optional(),
|
|
144
|
-
greater_than_or_equal_to: z.number().optional(),
|
|
145
|
-
less_than_or_equal_to: z.number().optional(),
|
|
146
|
-
})
|
|
147
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
148
|
-
message: 'Exactly one filter condition must be specified',
|
|
149
|
-
});
|
|
150
|
-
// Rollup item filter schema (for any/every/none conditions)
|
|
151
|
-
// This matches the property filter conditions that can be applied to rollup items
|
|
152
|
-
const RollupItemFilterSchema = z.object({
|
|
153
|
-
title: TextFilterConditionSchema.optional(),
|
|
154
|
-
rich_text: TextFilterConditionSchema.optional(),
|
|
155
|
-
url: TextFilterConditionSchema.optional(),
|
|
156
|
-
email: TextFilterConditionSchema.optional(),
|
|
157
|
-
phone_number: TextFilterConditionSchema.optional(),
|
|
158
|
-
number: NumberFilterConditionSchema.optional(),
|
|
159
|
-
checkbox: CheckboxFilterConditionSchema.optional(),
|
|
160
|
-
select: SelectFilterConditionSchema.optional(),
|
|
161
|
-
multi_select: MultiSelectFilterConditionSchema.optional(),
|
|
162
|
-
status: StatusFilterConditionSchema.optional(),
|
|
163
|
-
date: DateFilterConditionSchema.optional(),
|
|
164
|
-
relation: RelationFilterConditionSchema.optional(),
|
|
165
|
-
people: PeopleFilterConditionSchema.optional(),
|
|
166
|
-
files: FilesFilterConditionSchema.optional(),
|
|
167
|
-
});
|
|
168
|
-
// Rollup filter conditions (depends on rollup aggregation type)
|
|
169
|
-
const RollupFilterConditionSchema = z
|
|
170
|
-
.object({
|
|
171
|
-
any: RollupItemFilterSchema.optional(),
|
|
172
|
-
every: RollupItemFilterSchema.optional(),
|
|
173
|
-
none: RollupItemFilterSchema.optional(),
|
|
174
|
-
number: NumberFilterConditionSchema.optional(),
|
|
175
|
-
date: DateFilterConditionSchema.optional(),
|
|
176
|
-
})
|
|
177
|
-
.refine((obj) => Object.keys(obj).length === 1, {
|
|
178
|
-
message: 'Exactly one rollup filter condition must be specified',
|
|
179
|
-
});
|
|
180
|
-
// Property filter schema
|
|
181
|
-
// Note: created_by and last_edited_by properties use the 'people' filter condition
|
|
182
|
-
// Example: { property: "created_by", people: { contains: "user-id" } }
|
|
183
|
-
export const PropertyFilterSchema = z.object({
|
|
184
|
-
property: z.string(),
|
|
185
|
-
title: TextFilterConditionSchema.optional(),
|
|
186
|
-
rich_text: TextFilterConditionSchema.optional(),
|
|
187
|
-
url: TextFilterConditionSchema.optional(),
|
|
188
|
-
email: TextFilterConditionSchema.optional(),
|
|
189
|
-
phone_number: TextFilterConditionSchema.optional(),
|
|
190
|
-
number: NumberFilterConditionSchema.optional(),
|
|
191
|
-
checkbox: CheckboxFilterConditionSchema.optional(),
|
|
192
|
-
select: SelectFilterConditionSchema.optional(),
|
|
193
|
-
multi_select: MultiSelectFilterConditionSchema.optional(),
|
|
194
|
-
status: StatusFilterConditionSchema.optional(),
|
|
195
|
-
date: DateFilterConditionSchema.optional(),
|
|
196
|
-
relation: RelationFilterConditionSchema.optional(),
|
|
197
|
-
people: PeopleFilterConditionSchema.optional(),
|
|
198
|
-
files: FilesFilterConditionSchema.optional(),
|
|
199
|
-
formula: FormulaFilterConditionSchema.optional(),
|
|
200
|
-
unique_id: UniqueIdFilterConditionSchema.optional(),
|
|
201
|
-
rollup: RollupFilterConditionSchema.optional(),
|
|
202
|
-
});
|
|
203
|
-
// Timestamp filter schema
|
|
204
|
-
export const TimestampFilterSchema = z.object({
|
|
205
|
-
timestamp: z.enum(['created_time', 'last_edited_time']),
|
|
206
|
-
created_time: DateFilterConditionSchema.optional(),
|
|
207
|
-
last_edited_time: DateFilterConditionSchema.optional(),
|
|
208
|
-
});
|
|
209
|
-
// Compound filter schema (uses lazy for recursion)
|
|
210
|
-
export const FilterSchema = z.lazy(() => z.union([
|
|
211
|
-
PropertyFilterSchema,
|
|
212
|
-
TimestampFilterSchema,
|
|
213
|
-
z.object({ and: z.array(FilterSchema) }),
|
|
214
|
-
z.object({ or: z.array(FilterSchema) }),
|
|
215
|
-
]));
|
|
216
|
-
// Sort schema
|
|
217
|
-
export const SortSchema = z.object({
|
|
218
|
-
property: z.string().optional(),
|
|
219
|
-
timestamp: z.enum(['created_time', 'last_edited_time']).optional(),
|
|
220
|
-
direction: z.enum(['ascending', 'descending']),
|
|
221
|
-
});
|
|
222
|
-
export const SortsSchema = z.array(SortSchema);
|