n8n-nodes-notion-advanced 1.2.2-beta → 1.2.4-beta
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/package.json +4 -8
- package/types/NotionTypes.d.ts +359 -0
- package/types/NotionTypes.js +3 -0
- package/types/NotionTypes.ts +411 -0
- package/NotionAdvanced/notion.svg +0 -3
package/package.json
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "n8n-nodes-notion-advanced",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.4-beta",
|
4
4
|
"description": "Advanced n8n Notion nodes: Full-featured workflow node + AI Agent Tool for intelligent Notion automation with 25+ block types (BETA)",
|
5
|
-
"scripts": {
|
6
|
-
"build": "echo 'Already built'",
|
7
|
-
"prepublishOnly": "echo 'Files already built, ready to publish'"
|
8
|
-
},
|
5
|
+
"scripts": {},
|
9
6
|
"files": [
|
10
|
-
"nodes
|
11
|
-
"
|
12
|
-
"package.json"
|
7
|
+
"nodes",
|
8
|
+
"types"
|
13
9
|
],
|
14
10
|
"n8n": {
|
15
11
|
"n8nNodesApiVersion": 1,
|
@@ -0,0 +1,359 @@
|
|
1
|
+
export type NotionColor = 'default' | 'gray' | 'brown' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'red' | 'gray_background' | 'brown_background' | 'orange_background' | 'yellow_background' | 'green_background' | 'blue_background' | 'purple_background' | 'pink_background' | 'red_background';
|
2
|
+
export interface RichTextAnnotations {
|
3
|
+
bold?: boolean;
|
4
|
+
italic?: boolean;
|
5
|
+
strikethrough?: boolean;
|
6
|
+
underline?: boolean;
|
7
|
+
code?: boolean;
|
8
|
+
color?: NotionColor;
|
9
|
+
}
|
10
|
+
export interface TextLink {
|
11
|
+
url: string;
|
12
|
+
}
|
13
|
+
export interface RichTextText {
|
14
|
+
content: string;
|
15
|
+
link?: TextLink | null;
|
16
|
+
}
|
17
|
+
export interface RichTextMention {
|
18
|
+
type: 'user' | 'page' | 'database' | 'date' | 'link_preview' | 'template_mention';
|
19
|
+
user?: {
|
20
|
+
id: string;
|
21
|
+
};
|
22
|
+
page?: {
|
23
|
+
id: string;
|
24
|
+
};
|
25
|
+
database?: {
|
26
|
+
id: string;
|
27
|
+
};
|
28
|
+
date?: {
|
29
|
+
start: string;
|
30
|
+
end?: string;
|
31
|
+
time_zone?: string;
|
32
|
+
};
|
33
|
+
link_preview?: {
|
34
|
+
url: string;
|
35
|
+
};
|
36
|
+
template_mention?: {
|
37
|
+
type: 'template_mention_date' | 'template_mention_user';
|
38
|
+
template_mention_date?: string;
|
39
|
+
template_mention_user?: string;
|
40
|
+
};
|
41
|
+
}
|
42
|
+
export interface RichTextEquation {
|
43
|
+
expression: string;
|
44
|
+
}
|
45
|
+
export interface RichTextObject {
|
46
|
+
type: 'text' | 'mention' | 'equation';
|
47
|
+
text?: RichTextText;
|
48
|
+
mention?: RichTextMention;
|
49
|
+
equation?: RichTextEquation;
|
50
|
+
annotations: RichTextAnnotations;
|
51
|
+
plain_text: string;
|
52
|
+
href?: string | null;
|
53
|
+
}
|
54
|
+
export interface FileObject {
|
55
|
+
type: 'external' | 'file';
|
56
|
+
external?: {
|
57
|
+
url: string;
|
58
|
+
};
|
59
|
+
file?: {
|
60
|
+
url: string;
|
61
|
+
expiry_time?: string;
|
62
|
+
};
|
63
|
+
caption?: RichTextObject[];
|
64
|
+
}
|
65
|
+
export interface EmojiObject {
|
66
|
+
type: 'emoji';
|
67
|
+
emoji: string;
|
68
|
+
}
|
69
|
+
export interface Parent {
|
70
|
+
type: 'database_id' | 'page_id' | 'workspace' | 'block_id';
|
71
|
+
database_id?: string;
|
72
|
+
page_id?: string;
|
73
|
+
workspace?: boolean;
|
74
|
+
block_id?: string;
|
75
|
+
}
|
76
|
+
export interface ParagraphBlock {
|
77
|
+
type: 'paragraph';
|
78
|
+
paragraph: {
|
79
|
+
rich_text: RichTextObject[];
|
80
|
+
color?: NotionColor;
|
81
|
+
children?: Block[];
|
82
|
+
};
|
83
|
+
}
|
84
|
+
export interface HeadingBlock {
|
85
|
+
type: 'heading_1' | 'heading_2' | 'heading_3';
|
86
|
+
heading_1?: {
|
87
|
+
rich_text: RichTextObject[];
|
88
|
+
color?: NotionColor;
|
89
|
+
is_toggleable?: boolean;
|
90
|
+
};
|
91
|
+
heading_2?: {
|
92
|
+
rich_text: RichTextObject[];
|
93
|
+
color?: NotionColor;
|
94
|
+
is_toggleable?: boolean;
|
95
|
+
};
|
96
|
+
heading_3?: {
|
97
|
+
rich_text: RichTextObject[];
|
98
|
+
color?: NotionColor;
|
99
|
+
is_toggleable?: boolean;
|
100
|
+
};
|
101
|
+
}
|
102
|
+
export interface BulletedListItemBlock {
|
103
|
+
type: 'bulleted_list_item';
|
104
|
+
bulleted_list_item: {
|
105
|
+
rich_text: RichTextObject[];
|
106
|
+
color?: NotionColor;
|
107
|
+
children?: Block[];
|
108
|
+
};
|
109
|
+
}
|
110
|
+
export interface NumberedListItemBlock {
|
111
|
+
type: 'numbered_list_item';
|
112
|
+
numbered_list_item: {
|
113
|
+
rich_text: RichTextObject[];
|
114
|
+
color?: NotionColor;
|
115
|
+
children?: Block[];
|
116
|
+
};
|
117
|
+
}
|
118
|
+
export interface ToDoBlock {
|
119
|
+
type: 'to_do';
|
120
|
+
to_do: {
|
121
|
+
rich_text: RichTextObject[];
|
122
|
+
checked?: boolean;
|
123
|
+
color?: NotionColor;
|
124
|
+
children?: Block[];
|
125
|
+
};
|
126
|
+
}
|
127
|
+
export interface ToggleBlock {
|
128
|
+
type: 'toggle';
|
129
|
+
toggle: {
|
130
|
+
rich_text: RichTextObject[];
|
131
|
+
color?: NotionColor;
|
132
|
+
children?: Block[];
|
133
|
+
};
|
134
|
+
}
|
135
|
+
export interface QuoteBlock {
|
136
|
+
type: 'quote';
|
137
|
+
quote: {
|
138
|
+
rich_text: RichTextObject[];
|
139
|
+
color?: NotionColor;
|
140
|
+
children?: Block[];
|
141
|
+
};
|
142
|
+
}
|
143
|
+
export interface CalloutBlock {
|
144
|
+
type: 'callout';
|
145
|
+
callout: {
|
146
|
+
rich_text: RichTextObject[];
|
147
|
+
icon?: EmojiObject | FileObject;
|
148
|
+
color?: NotionColor;
|
149
|
+
children?: Block[];
|
150
|
+
};
|
151
|
+
}
|
152
|
+
export interface CodeBlock {
|
153
|
+
type: 'code';
|
154
|
+
code: {
|
155
|
+
rich_text: RichTextObject[];
|
156
|
+
language?: string;
|
157
|
+
caption?: RichTextObject[];
|
158
|
+
};
|
159
|
+
}
|
160
|
+
export interface DividerBlock {
|
161
|
+
type: 'divider';
|
162
|
+
divider: Record<string, never>;
|
163
|
+
}
|
164
|
+
export interface ImageBlock {
|
165
|
+
type: 'image';
|
166
|
+
image: FileObject;
|
167
|
+
}
|
168
|
+
export interface VideoBlock {
|
169
|
+
type: 'video';
|
170
|
+
video: FileObject;
|
171
|
+
}
|
172
|
+
export interface AudioBlock {
|
173
|
+
type: 'audio';
|
174
|
+
audio: FileObject;
|
175
|
+
}
|
176
|
+
export interface FileBlock {
|
177
|
+
type: 'file';
|
178
|
+
file: FileObject;
|
179
|
+
}
|
180
|
+
export interface PdfBlock {
|
181
|
+
type: 'pdf';
|
182
|
+
pdf: FileObject;
|
183
|
+
}
|
184
|
+
export interface BookmarkBlock {
|
185
|
+
type: 'bookmark';
|
186
|
+
bookmark: {
|
187
|
+
url: string;
|
188
|
+
caption?: RichTextObject[];
|
189
|
+
};
|
190
|
+
}
|
191
|
+
export interface EmbedBlock {
|
192
|
+
type: 'embed';
|
193
|
+
embed: {
|
194
|
+
url: string;
|
195
|
+
caption?: RichTextObject[];
|
196
|
+
};
|
197
|
+
}
|
198
|
+
export interface LinkPreviewBlock {
|
199
|
+
type: 'link_preview';
|
200
|
+
link_preview: {
|
201
|
+
url: string;
|
202
|
+
};
|
203
|
+
}
|
204
|
+
export interface EquationBlock {
|
205
|
+
type: 'equation';
|
206
|
+
equation: {
|
207
|
+
expression: string;
|
208
|
+
};
|
209
|
+
}
|
210
|
+
export interface TableBlock {
|
211
|
+
type: 'table';
|
212
|
+
table: {
|
213
|
+
table_width: number;
|
214
|
+
has_column_header?: boolean;
|
215
|
+
has_row_header?: boolean;
|
216
|
+
children?: TableRowBlock[];
|
217
|
+
};
|
218
|
+
}
|
219
|
+
export interface TableRowBlock {
|
220
|
+
type: 'table_row';
|
221
|
+
table_row: {
|
222
|
+
cells: RichTextObject[][];
|
223
|
+
};
|
224
|
+
}
|
225
|
+
export interface ColumnListBlock {
|
226
|
+
type: 'column_list';
|
227
|
+
column_list: {
|
228
|
+
children?: ColumnBlock[];
|
229
|
+
};
|
230
|
+
}
|
231
|
+
export interface ColumnBlock {
|
232
|
+
type: 'column';
|
233
|
+
column: {
|
234
|
+
children?: Block[];
|
235
|
+
};
|
236
|
+
}
|
237
|
+
export interface SyncedBlock {
|
238
|
+
type: 'synced_block';
|
239
|
+
synced_block: {
|
240
|
+
synced_from?: {
|
241
|
+
type: 'block_id';
|
242
|
+
block_id: string;
|
243
|
+
} | null;
|
244
|
+
children?: Block[];
|
245
|
+
};
|
246
|
+
}
|
247
|
+
export interface TemplateBlock {
|
248
|
+
type: 'template';
|
249
|
+
template: {
|
250
|
+
rich_text: RichTextObject[];
|
251
|
+
children?: Block[];
|
252
|
+
};
|
253
|
+
}
|
254
|
+
export interface TableOfContentsBlock {
|
255
|
+
type: 'table_of_contents';
|
256
|
+
table_of_contents: {
|
257
|
+
color?: NotionColor;
|
258
|
+
};
|
259
|
+
}
|
260
|
+
export interface ChildDatabaseBlock {
|
261
|
+
type: 'child_database';
|
262
|
+
child_database: {
|
263
|
+
title: string;
|
264
|
+
};
|
265
|
+
}
|
266
|
+
export interface ChildPageBlock {
|
267
|
+
type: 'child_page';
|
268
|
+
child_page: {
|
269
|
+
title: string;
|
270
|
+
};
|
271
|
+
}
|
272
|
+
export interface BaseBlock {
|
273
|
+
object: 'block';
|
274
|
+
id: string;
|
275
|
+
parent: Parent;
|
276
|
+
created_time: string;
|
277
|
+
created_by: {
|
278
|
+
object: 'user';
|
279
|
+
id: string;
|
280
|
+
};
|
281
|
+
last_edited_time: string;
|
282
|
+
last_edited_by: {
|
283
|
+
object: 'user';
|
284
|
+
id: string;
|
285
|
+
};
|
286
|
+
archived: boolean;
|
287
|
+
has_children: boolean;
|
288
|
+
}
|
289
|
+
export type Block = ParagraphBlock | HeadingBlock | BulletedListItemBlock | NumberedListItemBlock | ToDoBlock | ToggleBlock | QuoteBlock | CalloutBlock | CodeBlock | DividerBlock | ImageBlock | VideoBlock | AudioBlock | FileBlock | PdfBlock | BookmarkBlock | EmbedBlock | LinkPreviewBlock | EquationBlock | TableBlock | TableRowBlock | ColumnListBlock | ColumnBlock | SyncedBlock | TemplateBlock | TableOfContentsBlock | ChildDatabaseBlock | ChildPageBlock;
|
290
|
+
export type BlockWithId = Block & BaseBlock;
|
291
|
+
export interface PropertyValue {
|
292
|
+
id: string;
|
293
|
+
type: string;
|
294
|
+
[key: string]: any;
|
295
|
+
}
|
296
|
+
export interface PageProperties {
|
297
|
+
[key: string]: PropertyValue;
|
298
|
+
}
|
299
|
+
export interface NotionPage {
|
300
|
+
object: 'page';
|
301
|
+
id: string;
|
302
|
+
created_time: string;
|
303
|
+
created_by: {
|
304
|
+
object: 'user';
|
305
|
+
id: string;
|
306
|
+
};
|
307
|
+
last_edited_time: string;
|
308
|
+
last_edited_by: {
|
309
|
+
object: 'user';
|
310
|
+
id: string;
|
311
|
+
};
|
312
|
+
archived: boolean;
|
313
|
+
properties: PageProperties;
|
314
|
+
parent: Parent;
|
315
|
+
url: string;
|
316
|
+
icon?: EmojiObject | FileObject | null;
|
317
|
+
cover?: FileObject | null;
|
318
|
+
}
|
319
|
+
export interface NotionApiResponse<T = any> {
|
320
|
+
object: string;
|
321
|
+
results?: T[];
|
322
|
+
next_cursor?: string | null;
|
323
|
+
has_more?: boolean;
|
324
|
+
type?: string;
|
325
|
+
[key: string]: any;
|
326
|
+
}
|
327
|
+
export interface NotionSearchResponse extends NotionApiResponse {
|
328
|
+
results: (NotionPage | any)[];
|
329
|
+
}
|
330
|
+
export interface NotionBlockChildrenResponse extends NotionApiResponse {
|
331
|
+
results: BlockWithId[];
|
332
|
+
}
|
333
|
+
export type NotionResource = 'page' | 'block' | 'database' | 'user';
|
334
|
+
export type NotionPageOperation = 'create' | 'get' | 'update' | 'archive' | 'search';
|
335
|
+
export type NotionBlockOperation = 'create' | 'get' | 'update' | 'delete' | 'getChildren' | 'append';
|
336
|
+
export type NotionDatabaseOperation = 'get' | 'query' | 'create';
|
337
|
+
export type NotionUserOperation = 'get' | 'list';
|
338
|
+
export interface NotionCredentials {
|
339
|
+
apiKey: string;
|
340
|
+
}
|
341
|
+
export interface BlockInput {
|
342
|
+
type: string;
|
343
|
+
content?: string;
|
344
|
+
richText?: RichTextObject[];
|
345
|
+
properties?: {
|
346
|
+
[key: string]: any;
|
347
|
+
};
|
348
|
+
children?: BlockInput[];
|
349
|
+
}
|
350
|
+
export interface PageInput {
|
351
|
+
title: string;
|
352
|
+
parent: string;
|
353
|
+
properties?: {
|
354
|
+
[key: string]: any;
|
355
|
+
};
|
356
|
+
children?: BlockInput[];
|
357
|
+
icon?: string;
|
358
|
+
cover?: string;
|
359
|
+
}
|
@@ -0,0 +1,411 @@
|
|
1
|
+
// Notion API Types for complete block and formatting support
|
2
|
+
|
3
|
+
export type NotionColor =
|
4
|
+
| 'default' | 'gray' | 'brown' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'red'
|
5
|
+
| 'gray_background' | 'brown_background' | 'orange_background' | 'yellow_background'
|
6
|
+
| 'green_background' | 'blue_background' | 'purple_background' | 'pink_background' | 'red_background';
|
7
|
+
|
8
|
+
export interface RichTextAnnotations {
|
9
|
+
bold?: boolean;
|
10
|
+
italic?: boolean;
|
11
|
+
strikethrough?: boolean;
|
12
|
+
underline?: boolean;
|
13
|
+
code?: boolean;
|
14
|
+
color?: NotionColor;
|
15
|
+
}
|
16
|
+
|
17
|
+
export interface TextLink {
|
18
|
+
url: string;
|
19
|
+
}
|
20
|
+
|
21
|
+
export interface RichTextText {
|
22
|
+
content: string;
|
23
|
+
link?: TextLink | null;
|
24
|
+
}
|
25
|
+
|
26
|
+
export interface RichTextMention {
|
27
|
+
type: 'user' | 'page' | 'database' | 'date' | 'link_preview' | 'template_mention';
|
28
|
+
user?: { id: string };
|
29
|
+
page?: { id: string };
|
30
|
+
database?: { id: string };
|
31
|
+
date?: { start: string; end?: string; time_zone?: string };
|
32
|
+
link_preview?: { url: string };
|
33
|
+
template_mention?: { type: 'template_mention_date' | 'template_mention_user'; template_mention_date?: string; template_mention_user?: string };
|
34
|
+
}
|
35
|
+
|
36
|
+
export interface RichTextEquation {
|
37
|
+
expression: string;
|
38
|
+
}
|
39
|
+
|
40
|
+
export interface RichTextObject {
|
41
|
+
type: 'text' | 'mention' | 'equation';
|
42
|
+
text?: RichTextText;
|
43
|
+
mention?: RichTextMention;
|
44
|
+
equation?: RichTextEquation;
|
45
|
+
annotations: RichTextAnnotations;
|
46
|
+
plain_text: string;
|
47
|
+
href?: string | null;
|
48
|
+
}
|
49
|
+
|
50
|
+
export interface FileObject {
|
51
|
+
type: 'external' | 'file';
|
52
|
+
external?: { url: string };
|
53
|
+
file?: { url: string; expiry_time?: string };
|
54
|
+
caption?: RichTextObject[];
|
55
|
+
}
|
56
|
+
|
57
|
+
export interface EmojiObject {
|
58
|
+
type: 'emoji';
|
59
|
+
emoji: string;
|
60
|
+
}
|
61
|
+
|
62
|
+
export interface Parent {
|
63
|
+
type: 'database_id' | 'page_id' | 'workspace' | 'block_id';
|
64
|
+
database_id?: string;
|
65
|
+
page_id?: string;
|
66
|
+
workspace?: boolean;
|
67
|
+
block_id?: string;
|
68
|
+
}
|
69
|
+
|
70
|
+
// Block Type Definitions
|
71
|
+
export interface ParagraphBlock {
|
72
|
+
type: 'paragraph';
|
73
|
+
paragraph: {
|
74
|
+
rich_text: RichTextObject[];
|
75
|
+
color?: NotionColor;
|
76
|
+
children?: Block[];
|
77
|
+
};
|
78
|
+
}
|
79
|
+
|
80
|
+
export interface HeadingBlock {
|
81
|
+
type: 'heading_1' | 'heading_2' | 'heading_3';
|
82
|
+
heading_1?: {
|
83
|
+
rich_text: RichTextObject[];
|
84
|
+
color?: NotionColor;
|
85
|
+
is_toggleable?: boolean;
|
86
|
+
};
|
87
|
+
heading_2?: {
|
88
|
+
rich_text: RichTextObject[];
|
89
|
+
color?: NotionColor;
|
90
|
+
is_toggleable?: boolean;
|
91
|
+
};
|
92
|
+
heading_3?: {
|
93
|
+
rich_text: RichTextObject[];
|
94
|
+
color?: NotionColor;
|
95
|
+
is_toggleable?: boolean;
|
96
|
+
};
|
97
|
+
}
|
98
|
+
|
99
|
+
export interface BulletedListItemBlock {
|
100
|
+
type: 'bulleted_list_item';
|
101
|
+
bulleted_list_item: {
|
102
|
+
rich_text: RichTextObject[];
|
103
|
+
color?: NotionColor;
|
104
|
+
children?: Block[];
|
105
|
+
};
|
106
|
+
}
|
107
|
+
|
108
|
+
export interface NumberedListItemBlock {
|
109
|
+
type: 'numbered_list_item';
|
110
|
+
numbered_list_item: {
|
111
|
+
rich_text: RichTextObject[];
|
112
|
+
color?: NotionColor;
|
113
|
+
children?: Block[];
|
114
|
+
};
|
115
|
+
}
|
116
|
+
|
117
|
+
export interface ToDoBlock {
|
118
|
+
type: 'to_do';
|
119
|
+
to_do: {
|
120
|
+
rich_text: RichTextObject[];
|
121
|
+
checked?: boolean;
|
122
|
+
color?: NotionColor;
|
123
|
+
children?: Block[];
|
124
|
+
};
|
125
|
+
}
|
126
|
+
|
127
|
+
export interface ToggleBlock {
|
128
|
+
type: 'toggle';
|
129
|
+
toggle: {
|
130
|
+
rich_text: RichTextObject[];
|
131
|
+
color?: NotionColor;
|
132
|
+
children?: Block[];
|
133
|
+
};
|
134
|
+
}
|
135
|
+
|
136
|
+
export interface QuoteBlock {
|
137
|
+
type: 'quote';
|
138
|
+
quote: {
|
139
|
+
rich_text: RichTextObject[];
|
140
|
+
color?: NotionColor;
|
141
|
+
children?: Block[];
|
142
|
+
};
|
143
|
+
}
|
144
|
+
|
145
|
+
export interface CalloutBlock {
|
146
|
+
type: 'callout';
|
147
|
+
callout: {
|
148
|
+
rich_text: RichTextObject[];
|
149
|
+
icon?: EmojiObject | FileObject;
|
150
|
+
color?: NotionColor;
|
151
|
+
children?: Block[];
|
152
|
+
};
|
153
|
+
}
|
154
|
+
|
155
|
+
export interface CodeBlock {
|
156
|
+
type: 'code';
|
157
|
+
code: {
|
158
|
+
rich_text: RichTextObject[];
|
159
|
+
language?: string;
|
160
|
+
caption?: RichTextObject[];
|
161
|
+
};
|
162
|
+
}
|
163
|
+
|
164
|
+
export interface DividerBlock {
|
165
|
+
type: 'divider';
|
166
|
+
divider: Record<string, never>;
|
167
|
+
}
|
168
|
+
|
169
|
+
export interface ImageBlock {
|
170
|
+
type: 'image';
|
171
|
+
image: FileObject;
|
172
|
+
}
|
173
|
+
|
174
|
+
export interface VideoBlock {
|
175
|
+
type: 'video';
|
176
|
+
video: FileObject;
|
177
|
+
}
|
178
|
+
|
179
|
+
export interface AudioBlock {
|
180
|
+
type: 'audio';
|
181
|
+
audio: FileObject;
|
182
|
+
}
|
183
|
+
|
184
|
+
export interface FileBlock {
|
185
|
+
type: 'file';
|
186
|
+
file: FileObject;
|
187
|
+
}
|
188
|
+
|
189
|
+
export interface PdfBlock {
|
190
|
+
type: 'pdf';
|
191
|
+
pdf: FileObject;
|
192
|
+
}
|
193
|
+
|
194
|
+
export interface BookmarkBlock {
|
195
|
+
type: 'bookmark';
|
196
|
+
bookmark: {
|
197
|
+
url: string;
|
198
|
+
caption?: RichTextObject[];
|
199
|
+
};
|
200
|
+
}
|
201
|
+
|
202
|
+
export interface EmbedBlock {
|
203
|
+
type: 'embed';
|
204
|
+
embed: {
|
205
|
+
url: string;
|
206
|
+
caption?: RichTextObject[];
|
207
|
+
};
|
208
|
+
}
|
209
|
+
|
210
|
+
export interface LinkPreviewBlock {
|
211
|
+
type: 'link_preview';
|
212
|
+
link_preview: {
|
213
|
+
url: string;
|
214
|
+
};
|
215
|
+
}
|
216
|
+
|
217
|
+
export interface EquationBlock {
|
218
|
+
type: 'equation';
|
219
|
+
equation: {
|
220
|
+
expression: string;
|
221
|
+
};
|
222
|
+
}
|
223
|
+
|
224
|
+
export interface TableBlock {
|
225
|
+
type: 'table';
|
226
|
+
table: {
|
227
|
+
table_width: number;
|
228
|
+
has_column_header?: boolean;
|
229
|
+
has_row_header?: boolean;
|
230
|
+
children?: TableRowBlock[];
|
231
|
+
};
|
232
|
+
}
|
233
|
+
|
234
|
+
export interface TableRowBlock {
|
235
|
+
type: 'table_row';
|
236
|
+
table_row: {
|
237
|
+
cells: RichTextObject[][];
|
238
|
+
};
|
239
|
+
}
|
240
|
+
|
241
|
+
export interface ColumnListBlock {
|
242
|
+
type: 'column_list';
|
243
|
+
column_list: {
|
244
|
+
children?: ColumnBlock[];
|
245
|
+
};
|
246
|
+
}
|
247
|
+
|
248
|
+
export interface ColumnBlock {
|
249
|
+
type: 'column';
|
250
|
+
column: {
|
251
|
+
children?: Block[];
|
252
|
+
};
|
253
|
+
}
|
254
|
+
|
255
|
+
export interface SyncedBlock {
|
256
|
+
type: 'synced_block';
|
257
|
+
synced_block: {
|
258
|
+
synced_from?: {
|
259
|
+
type: 'block_id';
|
260
|
+
block_id: string;
|
261
|
+
} | null;
|
262
|
+
children?: Block[];
|
263
|
+
};
|
264
|
+
}
|
265
|
+
|
266
|
+
export interface TemplateBlock {
|
267
|
+
type: 'template';
|
268
|
+
template: {
|
269
|
+
rich_text: RichTextObject[];
|
270
|
+
children?: Block[];
|
271
|
+
};
|
272
|
+
}
|
273
|
+
|
274
|
+
export interface TableOfContentsBlock {
|
275
|
+
type: 'table_of_contents';
|
276
|
+
table_of_contents: {
|
277
|
+
color?: NotionColor;
|
278
|
+
};
|
279
|
+
}
|
280
|
+
|
281
|
+
export interface ChildDatabaseBlock {
|
282
|
+
type: 'child_database';
|
283
|
+
child_database: {
|
284
|
+
title: string;
|
285
|
+
};
|
286
|
+
}
|
287
|
+
|
288
|
+
export interface ChildPageBlock {
|
289
|
+
type: 'child_page';
|
290
|
+
child_page: {
|
291
|
+
title: string;
|
292
|
+
};
|
293
|
+
}
|
294
|
+
|
295
|
+
export interface BaseBlock {
|
296
|
+
object: 'block';
|
297
|
+
id: string;
|
298
|
+
parent: Parent;
|
299
|
+
created_time: string;
|
300
|
+
created_by: { object: 'user'; id: string };
|
301
|
+
last_edited_time: string;
|
302
|
+
last_edited_by: { object: 'user'; id: string };
|
303
|
+
archived: boolean;
|
304
|
+
has_children: boolean;
|
305
|
+
}
|
306
|
+
|
307
|
+
export type Block =
|
308
|
+
| ParagraphBlock
|
309
|
+
| HeadingBlock
|
310
|
+
| BulletedListItemBlock
|
311
|
+
| NumberedListItemBlock
|
312
|
+
| ToDoBlock
|
313
|
+
| ToggleBlock
|
314
|
+
| QuoteBlock
|
315
|
+
| CalloutBlock
|
316
|
+
| CodeBlock
|
317
|
+
| DividerBlock
|
318
|
+
| ImageBlock
|
319
|
+
| VideoBlock
|
320
|
+
| AudioBlock
|
321
|
+
| FileBlock
|
322
|
+
| PdfBlock
|
323
|
+
| BookmarkBlock
|
324
|
+
| EmbedBlock
|
325
|
+
| LinkPreviewBlock
|
326
|
+
| EquationBlock
|
327
|
+
| TableBlock
|
328
|
+
| TableRowBlock
|
329
|
+
| ColumnListBlock
|
330
|
+
| ColumnBlock
|
331
|
+
| SyncedBlock
|
332
|
+
| TemplateBlock
|
333
|
+
| TableOfContentsBlock
|
334
|
+
| ChildDatabaseBlock
|
335
|
+
| ChildPageBlock;
|
336
|
+
|
337
|
+
export type BlockWithId = Block & BaseBlock;
|
338
|
+
|
339
|
+
// Page Property Types
|
340
|
+
export interface PropertyValue {
|
341
|
+
id: string;
|
342
|
+
type: string;
|
343
|
+
[key: string]: any;
|
344
|
+
}
|
345
|
+
|
346
|
+
export interface PageProperties {
|
347
|
+
[key: string]: PropertyValue;
|
348
|
+
}
|
349
|
+
|
350
|
+
export interface NotionPage {
|
351
|
+
object: 'page';
|
352
|
+
id: string;
|
353
|
+
created_time: string;
|
354
|
+
created_by: { object: 'user'; id: string };
|
355
|
+
last_edited_time: string;
|
356
|
+
last_edited_by: { object: 'user'; id: string };
|
357
|
+
archived: boolean;
|
358
|
+
properties: PageProperties;
|
359
|
+
parent: Parent;
|
360
|
+
url: string;
|
361
|
+
icon?: EmojiObject | FileObject | null;
|
362
|
+
cover?: FileObject | null;
|
363
|
+
}
|
364
|
+
|
365
|
+
// API Response Types
|
366
|
+
export interface NotionApiResponse<T = any> {
|
367
|
+
object: string;
|
368
|
+
results?: T[];
|
369
|
+
next_cursor?: string | null;
|
370
|
+
has_more?: boolean;
|
371
|
+
type?: string;
|
372
|
+
[key: string]: any;
|
373
|
+
}
|
374
|
+
|
375
|
+
export interface NotionSearchResponse extends NotionApiResponse {
|
376
|
+
results: (NotionPage | any)[];
|
377
|
+
}
|
378
|
+
|
379
|
+
export interface NotionBlockChildrenResponse extends NotionApiResponse {
|
380
|
+
results: BlockWithId[];
|
381
|
+
}
|
382
|
+
|
383
|
+
// Operation Types for n8n
|
384
|
+
export type NotionResource = 'page' | 'block' | 'database' | 'user';
|
385
|
+
|
386
|
+
export type NotionPageOperation = 'create' | 'get' | 'update' | 'archive' | 'search';
|
387
|
+
export type NotionBlockOperation = 'create' | 'get' | 'update' | 'delete' | 'getChildren' | 'append';
|
388
|
+
export type NotionDatabaseOperation = 'get' | 'query' | 'create';
|
389
|
+
export type NotionUserOperation = 'get' | 'list';
|
390
|
+
|
391
|
+
export interface NotionCredentials {
|
392
|
+
apiKey: string;
|
393
|
+
}
|
394
|
+
|
395
|
+
// Block Creation Input Types
|
396
|
+
export interface BlockInput {
|
397
|
+
type: string;
|
398
|
+
content?: string;
|
399
|
+
richText?: RichTextObject[];
|
400
|
+
properties?: { [key: string]: any };
|
401
|
+
children?: BlockInput[];
|
402
|
+
}
|
403
|
+
|
404
|
+
export interface PageInput {
|
405
|
+
title: string;
|
406
|
+
parent: string; // Page ID or Database ID
|
407
|
+
properties?: { [key: string]: any };
|
408
|
+
children?: BlockInput[];
|
409
|
+
icon?: string;
|
410
|
+
cover?: string;
|
411
|
+
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.533 2.221c-.466.047-.56.28-.374.466l1.3.979zM5.206 6.678v14.018c0 .746.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.305c0-.607-.28-.887-.747-.84l-15.177.887c-.56.047-.748.327-.748.746v-.42zm14.337.793c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 18s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933l3.176-.233z" fill="currentColor"/>
|
3
|
-
</svg>
|