n8n-nodes-notion-advanced 1.2.3-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/nodes/NotionAdvanced/NotionAITool.node.d.ts +18 -0
- package/nodes/NotionAdvanced/NotionAITool.node.js +1154 -0
- package/nodes/NotionAdvanced/NotionAITool.node.ts +611 -0
- package/nodes/NotionAdvanced/NotionAdvanced.node.d.ts +25 -0
- package/nodes/NotionAdvanced/NotionAdvanced.node.js +905 -0
- package/nodes/NotionAdvanced/NotionAdvanced.node.ts +1022 -0
- package/nodes/NotionAdvanced/NotionUtils.d.ts +104 -0
- package/nodes/NotionAdvanced/NotionUtils.js +465 -0
- package/nodes/NotionAdvanced/NotionUtils.ts +588 -0
- package/nodes/NotionAdvanced/notion.svg +3 -0
- package/package.json +5 -6
- package/types/NotionTypes.d.ts +359 -0
- package/types/NotionTypes.js +3 -0
- package/types/NotionTypes.ts +411 -0
@@ -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
|
+
}
|