@notionhq/workers 0.4.0 → 0.6.0
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/dist/alpha/builder.d.ts +149 -0
- package/dist/alpha/builder.d.ts.map +1 -0
- package/dist/alpha/builder.js +260 -0
- package/dist/alpha/builder.test.d.ts +2 -0
- package/dist/alpha/builder.test.d.ts.map +1 -0
- package/dist/alpha/cli/build.d.ts +13 -0
- package/dist/alpha/cli/build.d.ts.map +1 -0
- package/dist/alpha/cli/build.js +36 -0
- package/dist/alpha/cli/build.test.d.ts +2 -0
- package/dist/alpha/cli/build.test.d.ts.map +1 -0
- package/dist/alpha/cli/codegen.d.ts +10 -0
- package/dist/alpha/cli/codegen.d.ts.map +1 -0
- package/dist/alpha/cli/codegen.js +41 -0
- package/dist/alpha/cli/codegen.test.d.ts +2 -0
- package/dist/alpha/cli/codegen.test.d.ts.map +1 -0
- package/dist/alpha/cli/discover.d.ts +35 -0
- package/dist/alpha/cli/discover.d.ts.map +1 -0
- package/dist/alpha/cli/discover.js +39 -0
- package/dist/alpha/cli/discover.test.d.ts +2 -0
- package/dist/alpha/cli/discover.test.d.ts.map +1 -0
- package/dist/alpha/cli/emit-manifest.d.ts +33 -0
- package/dist/alpha/cli/emit-manifest.d.ts.map +1 -0
- package/dist/alpha/cli/emit-manifest.js +266 -0
- package/dist/alpha/cli/emit-manifest.test.d.ts +2 -0
- package/dist/alpha/cli/emit-manifest.test.d.ts.map +1 -0
- package/dist/alpha/cli/index.d.ts +3 -0
- package/dist/alpha/cli/index.d.ts.map +1 -0
- package/dist/alpha/cli/index.js +36 -0
- package/dist/alpha/context.d.ts +8 -0
- package/dist/alpha/context.d.ts.map +1 -0
- package/dist/alpha/context.js +33 -0
- package/dist/alpha/database.d.ts +90 -0
- package/dist/alpha/database.d.ts.map +1 -0
- package/dist/alpha/database.js +9 -0
- package/dist/alpha/error.d.ts +41 -0
- package/dist/alpha/error.d.ts.map +1 -0
- package/dist/alpha/error.js +25 -0
- package/dist/alpha/icon-names.d.ts +6 -0
- package/dist/alpha/icon-names.d.ts.map +1 -0
- package/dist/alpha/icon-names.js +0 -0
- package/dist/alpha/json-schema.d.ts +117 -0
- package/dist/alpha/json-schema.d.ts.map +1 -0
- package/dist/alpha/json-schema.js +0 -0
- package/dist/alpha/manifest.d.ts +44 -0
- package/dist/alpha/manifest.d.ts.map +1 -0
- package/dist/alpha/manifest.js +0 -0
- package/dist/alpha/output.d.ts +7 -0
- package/dist/alpha/output.d.ts.map +1 -0
- package/dist/alpha/output.js +8 -0
- package/dist/alpha/pacer.d.ts +74 -0
- package/dist/alpha/pacer.d.ts.map +1 -0
- package/dist/alpha/pacer.js +66 -0
- package/dist/alpha/pacer.test.d.ts +2 -0
- package/dist/alpha/pacer.test.d.ts.map +1 -0
- package/dist/alpha/schedule.d.ts +6 -0
- package/dist/alpha/schedule.d.ts.map +1 -0
- package/dist/alpha/schedule.js +43 -0
- package/dist/alpha/schedule.test.d.ts +2 -0
- package/dist/alpha/schedule.test.d.ts.map +1 -0
- package/dist/alpha/schema-builder.d.ts +79 -0
- package/dist/alpha/schema-builder.d.ts.map +1 -0
- package/dist/alpha/schema-builder.js +135 -0
- package/dist/alpha/schema.d.ts +185 -0
- package/dist/alpha/schema.d.ts.map +1 -0
- package/dist/alpha/schema.js +115 -0
- package/dist/alpha/sync.d.ts +233 -0
- package/dist/alpha/sync.d.ts.map +1 -0
- package/dist/alpha/sync.js +70 -0
- package/dist/alpha/sync.test.d.ts +2 -0
- package/dist/alpha/sync.test.d.ts.map +1 -0
- package/dist/alpha/tool.d.ts +132 -0
- package/dist/alpha/tool.d.ts.map +1 -0
- package/dist/alpha/tool.js +156 -0
- package/dist/alpha/tool.test.d.ts +2 -0
- package/dist/alpha/tool.test.d.ts.map +1 -0
- package/dist/alpha/triggers.d.ts +365 -0
- package/dist/alpha/triggers.d.ts.map +1 -0
- package/dist/alpha/triggers.generated.d.ts +246 -0
- package/dist/alpha/triggers.generated.d.ts.map +1 -0
- package/dist/alpha/triggers.generated.js +239 -0
- package/dist/alpha/triggers.js +0 -0
- package/dist/alpha/types.d.ts +228 -0
- package/dist/alpha/types.d.ts.map +1 -0
- package/dist/alpha/types.js +0 -0
- package/dist/alpha/workflow.d.ts +70 -0
- package/dist/alpha/workflow.d.ts.map +1 -0
- package/dist/alpha/workflow.js +39 -0
- package/dist/alpha/workflow.test.d.ts +2 -0
- package/dist/alpha/workflow.test.d.ts.map +1 -0
- package/dist/builder.d.ts +7 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +12 -3
- package/dist/capabilities/ai_connector.d.ts.map +1 -1
- package/dist/capabilities/automation.d.ts.map +1 -1
- package/dist/capabilities/context.d.ts.map +1 -1
- package/dist/capabilities/context.js +1 -1
- package/dist/capabilities/custom-block.d.ts +124 -0
- package/dist/capabilities/custom-block.d.ts.map +1 -0
- package/dist/capabilities/custom-block.js +22 -0
- package/dist/capabilities/oauth.d.ts.map +1 -1
- package/dist/capabilities/output.d.ts.map +1 -1
- package/dist/capabilities/output.js +2 -4
- package/dist/capabilities/stateful-capability.d.ts.map +1 -1
- package/dist/capabilities/stateful-capability.js +3 -7
- package/dist/capabilities/sync.d.ts +11 -1
- package/dist/capabilities/sync.d.ts.map +1 -1
- package/dist/capabilities/sync.js +2 -8
- package/dist/capabilities/tool.d.ts.map +1 -1
- package/dist/capabilities/tool.js +6 -20
- package/dist/capabilities/webhook.d.ts.map +1 -1
- package/dist/capabilities/workflow.d.ts +50 -0
- package/dist/capabilities/workflow.d.ts.map +1 -0
- package/dist/capabilities/workflow.js +40 -0
- package/dist/capabilities/workflow.test.d.ts +2 -0
- package/dist/capabilities/workflow.test.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/json-schema.d.ts.map +1 -1
- package/dist/schema-builder.d.ts.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/triggers.d.ts +365 -0
- package/dist/triggers.d.ts.map +1 -0
- package/dist/triggers.generated.d.ts +246 -0
- package/dist/triggers.generated.d.ts.map +1 -0
- package/dist/triggers.generated.js +239 -0
- package/dist/triggers.js +0 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/worker.d.ts +72 -2
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +85 -4
- package/package.json +81 -14
- package/src/alpha/ajv-formats.d.ts +7 -0
- package/src/alpha/builder.test.ts +197 -0
- package/src/alpha/builder.ts +338 -0
- package/src/alpha/cli/build.test.ts +240 -0
- package/src/alpha/cli/build.ts +57 -0
- package/src/alpha/cli/codegen.test.ts +31 -0
- package/src/alpha/cli/codegen.ts +51 -0
- package/src/alpha/cli/discover.test.ts +43 -0
- package/src/alpha/cli/discover.ts +81 -0
- package/src/alpha/cli/emit-manifest.test.ts +45 -0
- package/src/alpha/cli/emit-manifest.ts +409 -0
- package/src/alpha/cli/index.ts +41 -0
- package/src/alpha/context.ts +61 -0
- package/src/alpha/database.ts +102 -0
- package/src/alpha/error.ts +49 -0
- package/src/alpha/icon-names.ts +890 -0
- package/src/alpha/json-schema.ts +180 -0
- package/src/alpha/manifest.ts +47 -0
- package/src/alpha/output.ts +8 -0
- package/src/alpha/pacer.test.ts +81 -0
- package/src/alpha/pacer.ts +181 -0
- package/src/alpha/schedule.test.ts +31 -0
- package/src/alpha/schedule.ts +53 -0
- package/src/alpha/schema-builder.ts +193 -0
- package/src/alpha/schema.ts +222 -0
- package/src/alpha/sync.test.ts +191 -0
- package/src/alpha/sync.ts +340 -0
- package/src/alpha/tool.test.ts +116 -0
- package/src/alpha/tool.ts +319 -0
- package/src/alpha/triggers.generated.ts +489 -0
- package/src/alpha/triggers.ts +500 -0
- package/src/alpha/types.ts +284 -0
- package/src/alpha/workflow.test.ts +84 -0
- package/src/alpha/workflow.ts +131 -0
- package/src/builder.test.ts +28 -60
- package/src/builder.ts +20 -7
- package/src/capabilities/ai_connector.test.ts +9 -32
- package/src/capabilities/ai_connector.ts +5 -17
- package/src/capabilities/automation.test.ts +3 -12
- package/src/capabilities/automation.ts +3 -11
- package/src/capabilities/context.ts +5 -8
- package/src/capabilities/custom-block.ts +181 -0
- package/src/capabilities/oauth.test.ts +1 -0
- package/src/capabilities/oauth.ts +1 -3
- package/src/capabilities/output.ts +1 -3
- package/src/capabilities/stateful-capability.test.ts +1 -0
- package/src/capabilities/stateful-capability.ts +3 -7
- package/src/capabilities/sync.test.ts +76 -42
- package/src/capabilities/sync.ts +16 -40
- package/src/capabilities/tool.test.ts +106 -146
- package/src/capabilities/tool.ts +17 -39
- package/src/capabilities/webhook.ts +3 -10
- package/src/capabilities/workflow.test.ts +163 -0
- package/src/capabilities/workflow.ts +112 -0
- package/src/index.ts +18 -6
- package/src/json-schema.test.ts +2 -4
- package/src/json-schema.ts +7 -6
- package/src/pacer.test.ts +1 -3
- package/src/pacer_internal.ts +1 -5
- package/src/schema-builder.test.ts +10 -35
- package/src/schema-builder.ts +6 -16
- package/src/schema.ts +2 -10
- package/src/triggers.generated.ts +489 -0
- package/src/triggers.ts +504 -0
- package/src/types.ts +21 -7
- package/src/worker.test.ts +147 -0
- package/src/worker.ts +155 -32
- package/dist/block.d.ts +0 -321
- package/dist/block.d.ts.map +0 -1
- package/src/block.ts +0 -529
- /package/dist/{block.js → alpha/ajv-formats.d.js} +0 -0
package/src/block.ts
DELETED
|
@@ -1,529 +0,0 @@
|
|
|
1
|
-
// ============================================================================
|
|
2
|
-
// Block Type Definitions
|
|
3
|
-
// ============================================================================
|
|
4
|
-
|
|
5
|
-
// Color types
|
|
6
|
-
type ApiColor =
|
|
7
|
-
| "default"
|
|
8
|
-
| "gray"
|
|
9
|
-
| "brown"
|
|
10
|
-
| "orange"
|
|
11
|
-
| "yellow"
|
|
12
|
-
| "green"
|
|
13
|
-
| "blue"
|
|
14
|
-
| "purple"
|
|
15
|
-
| "pink"
|
|
16
|
-
| "red"
|
|
17
|
-
| "gray_background"
|
|
18
|
-
| "brown_background"
|
|
19
|
-
| "orange_background"
|
|
20
|
-
| "yellow_background"
|
|
21
|
-
| "green_background"
|
|
22
|
-
| "blue_background"
|
|
23
|
-
| "purple_background"
|
|
24
|
-
| "pink_background"
|
|
25
|
-
| "red_background";
|
|
26
|
-
|
|
27
|
-
// Rich text annotations
|
|
28
|
-
type RichTextAnnotations = {
|
|
29
|
-
bold: boolean;
|
|
30
|
-
italic: boolean;
|
|
31
|
-
strikethrough: boolean;
|
|
32
|
-
underline: boolean;
|
|
33
|
-
code: boolean;
|
|
34
|
-
color: ApiColor;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Base rich text structure
|
|
38
|
-
type RichTextBase = {
|
|
39
|
-
plain_text: string;
|
|
40
|
-
href: string | null;
|
|
41
|
-
annotations: RichTextAnnotations;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// Text content
|
|
45
|
-
type TextContent = {
|
|
46
|
-
content: string;
|
|
47
|
-
link: { url: string } | null;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// Equation content
|
|
51
|
-
type EquationContent = {
|
|
52
|
-
expression: string;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// Date mention
|
|
56
|
-
type DateMention = {
|
|
57
|
-
type: "date";
|
|
58
|
-
date: {
|
|
59
|
-
start: string;
|
|
60
|
-
end?: string | null;
|
|
61
|
-
time_zone?: string | null;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// Custom emoji mention
|
|
66
|
-
type CustomEmojiMention = {
|
|
67
|
-
type: "custom_emoji";
|
|
68
|
-
custom_emoji: {
|
|
69
|
-
id: string;
|
|
70
|
-
name?: string;
|
|
71
|
-
url?: string;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// Link preview mention
|
|
76
|
-
type LinkPreviewMention = {
|
|
77
|
-
type: "link_preview";
|
|
78
|
-
link_preview: {
|
|
79
|
-
url: string;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// Link mention
|
|
84
|
-
type LinkMention = {
|
|
85
|
-
type: "link_mention";
|
|
86
|
-
link_mention: {
|
|
87
|
-
href: string;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// All mention types
|
|
92
|
-
type MentionContent =
|
|
93
|
-
| DateMention
|
|
94
|
-
| CustomEmojiMention
|
|
95
|
-
| LinkPreviewMention
|
|
96
|
-
| LinkMention;
|
|
97
|
-
|
|
98
|
-
// Rich text item
|
|
99
|
-
type RichTextItem = RichTextBase &
|
|
100
|
-
(
|
|
101
|
-
| { type: "text"; text: TextContent }
|
|
102
|
-
| { type: "mention"; mention: MentionContent }
|
|
103
|
-
| { type: "equation"; equation: EquationContent }
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
// Rich text array
|
|
107
|
-
type RichText = RichTextItem[];
|
|
108
|
-
|
|
109
|
-
// Icon types
|
|
110
|
-
type EmojiIcon = {
|
|
111
|
-
type: "emoji";
|
|
112
|
-
emoji: string;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
type ExternalIcon = {
|
|
116
|
-
type: "external";
|
|
117
|
-
external: { url: string };
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
type FileIcon = {
|
|
121
|
-
type: "file";
|
|
122
|
-
file: {
|
|
123
|
-
url: string;
|
|
124
|
-
expiry_time: string;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
type Icon = EmojiIcon | ExternalIcon | FileIcon;
|
|
129
|
-
|
|
130
|
-
// File object types
|
|
131
|
-
type ExternalFile = {
|
|
132
|
-
type: "external";
|
|
133
|
-
external: {
|
|
134
|
-
url: string;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
type HostedFile = {
|
|
139
|
-
type: "file";
|
|
140
|
-
file: {
|
|
141
|
-
url: string;
|
|
142
|
-
expiry_time: string;
|
|
143
|
-
};
|
|
144
|
-
name?: string;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
type FileObject = ExternalFile | HostedFile;
|
|
148
|
-
|
|
149
|
-
// Base block structure
|
|
150
|
-
type BlockBase = {
|
|
151
|
-
object: "block";
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// Text blocks
|
|
155
|
-
type ParagraphBlock = BlockBase & {
|
|
156
|
-
type: "paragraph";
|
|
157
|
-
paragraph: {
|
|
158
|
-
rich_text: RichText;
|
|
159
|
-
color?: ApiColor;
|
|
160
|
-
children?: Block[];
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
type Heading1Block = BlockBase & {
|
|
165
|
-
type: "heading_1";
|
|
166
|
-
heading_1: {
|
|
167
|
-
rich_text: RichText;
|
|
168
|
-
color?: ApiColor;
|
|
169
|
-
is_toggleable?: boolean;
|
|
170
|
-
children?: Block[];
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
type Heading2Block = BlockBase & {
|
|
175
|
-
type: "heading_2";
|
|
176
|
-
heading_2: {
|
|
177
|
-
rich_text: RichText;
|
|
178
|
-
color?: ApiColor;
|
|
179
|
-
is_toggleable?: boolean;
|
|
180
|
-
children?: Block[];
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
type Heading3Block = BlockBase & {
|
|
185
|
-
type: "heading_3";
|
|
186
|
-
heading_3: {
|
|
187
|
-
rich_text: RichText;
|
|
188
|
-
color?: ApiColor;
|
|
189
|
-
is_toggleable?: boolean;
|
|
190
|
-
children?: Block[];
|
|
191
|
-
};
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
type BulletedListItemBlock = BlockBase & {
|
|
195
|
-
type: "bulleted_list_item";
|
|
196
|
-
bulleted_list_item: {
|
|
197
|
-
rich_text: RichText;
|
|
198
|
-
color?: ApiColor;
|
|
199
|
-
children?: Block[];
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
type NumberedListItemBlock = BlockBase & {
|
|
204
|
-
type: "numbered_list_item";
|
|
205
|
-
numbered_list_item: {
|
|
206
|
-
rich_text: RichText;
|
|
207
|
-
color?: ApiColor;
|
|
208
|
-
children?: Block[];
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
type ToDoBlock = BlockBase & {
|
|
213
|
-
type: "to_do";
|
|
214
|
-
to_do: {
|
|
215
|
-
rich_text: RichText;
|
|
216
|
-
checked: boolean;
|
|
217
|
-
color?: ApiColor;
|
|
218
|
-
children?: Block[];
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
type ToggleBlock = BlockBase & {
|
|
223
|
-
type: "toggle";
|
|
224
|
-
toggle: {
|
|
225
|
-
rich_text: RichText;
|
|
226
|
-
color?: ApiColor;
|
|
227
|
-
children?: Block[];
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
type QuoteBlock = BlockBase & {
|
|
232
|
-
type: "quote";
|
|
233
|
-
quote: {
|
|
234
|
-
rich_text: RichText;
|
|
235
|
-
color?: ApiColor;
|
|
236
|
-
children?: Block[];
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
type CalloutBlock = BlockBase & {
|
|
241
|
-
type: "callout";
|
|
242
|
-
callout: {
|
|
243
|
-
rich_text: RichText;
|
|
244
|
-
icon?: Icon | null;
|
|
245
|
-
color?: ApiColor;
|
|
246
|
-
children?: Block[];
|
|
247
|
-
};
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
// Code block
|
|
251
|
-
type CodeBlock = BlockBase & {
|
|
252
|
-
type: "code";
|
|
253
|
-
code: {
|
|
254
|
-
rich_text: RichText;
|
|
255
|
-
caption?: RichText;
|
|
256
|
-
language: string;
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
// Equation block
|
|
261
|
-
type EquationBlock = BlockBase & {
|
|
262
|
-
type: "equation";
|
|
263
|
-
equation: {
|
|
264
|
-
expression: string;
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
// Divider block
|
|
269
|
-
type DividerBlock = BlockBase & {
|
|
270
|
-
type: "divider";
|
|
271
|
-
divider: Record<string, never>;
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
// Breadcrumb block
|
|
275
|
-
type BreadcrumbBlock = BlockBase & {
|
|
276
|
-
type: "breadcrumb";
|
|
277
|
-
breadcrumb: Record<string, never>;
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
// Table of contents block
|
|
281
|
-
type TableOfContentsBlock = BlockBase & {
|
|
282
|
-
type: "table_of_contents";
|
|
283
|
-
table_of_contents: {
|
|
284
|
-
color?: ApiColor;
|
|
285
|
-
};
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
// Column layout blocks
|
|
289
|
-
type ColumnListBlock = BlockBase & {
|
|
290
|
-
type: "column_list";
|
|
291
|
-
column_list: {
|
|
292
|
-
children: ColumnBlock[];
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
type ColumnBlock = BlockBase & {
|
|
297
|
-
type: "column";
|
|
298
|
-
column: {
|
|
299
|
-
children?: Block[];
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// Media blocks
|
|
304
|
-
type ImageBlock = BlockBase & {
|
|
305
|
-
type: "image";
|
|
306
|
-
image: FileObject & {
|
|
307
|
-
caption?: RichText;
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
type VideoBlock = BlockBase & {
|
|
312
|
-
type: "video";
|
|
313
|
-
video: FileObject & {
|
|
314
|
-
caption?: RichText;
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
type AudioBlock = BlockBase & {
|
|
319
|
-
type: "audio";
|
|
320
|
-
audio: FileObject & {
|
|
321
|
-
caption?: RichText;
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
type PDFBlock = BlockBase & {
|
|
326
|
-
type: "pdf";
|
|
327
|
-
pdf: FileObject & {
|
|
328
|
-
caption?: RichText;
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
type FileBlock = BlockBase & {
|
|
333
|
-
type: "file";
|
|
334
|
-
file: FileObject & {
|
|
335
|
-
caption?: RichText;
|
|
336
|
-
};
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
// Embed and bookmark blocks
|
|
340
|
-
type EmbedBlock = BlockBase & {
|
|
341
|
-
type: "embed";
|
|
342
|
-
embed: {
|
|
343
|
-
url: string;
|
|
344
|
-
caption?: RichText;
|
|
345
|
-
};
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
type BookmarkBlock = BlockBase & {
|
|
349
|
-
type: "bookmark";
|
|
350
|
-
bookmark: {
|
|
351
|
-
url: string;
|
|
352
|
-
caption?: RichText;
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
// Link preview block
|
|
357
|
-
type LinkPreviewBlock = BlockBase & {
|
|
358
|
-
type: "link_preview";
|
|
359
|
-
link_preview: {
|
|
360
|
-
url: string;
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
// Reference blocks
|
|
365
|
-
type ChildPageBlock = BlockBase & {
|
|
366
|
-
type: "child_page";
|
|
367
|
-
child_page: {
|
|
368
|
-
title: string;
|
|
369
|
-
};
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
type ChildDatabaseBlock = BlockBase & {
|
|
373
|
-
type: "child_database";
|
|
374
|
-
child_database: {
|
|
375
|
-
title: string;
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
// type LinkToPageBlock = BlockBase & {
|
|
380
|
-
// type: "link_to_page"
|
|
381
|
-
// link_to_page:
|
|
382
|
-
// | { type: "page_id"; page_id: string }
|
|
383
|
-
// | { type: "database_id"; database_id: string }
|
|
384
|
-
// }
|
|
385
|
-
|
|
386
|
-
// // Synced block
|
|
387
|
-
// type SyncedBlock = BlockBase & {
|
|
388
|
-
// type: "synced_block"
|
|
389
|
-
// synced_block: {
|
|
390
|
-
// synced_from: {
|
|
391
|
-
// type: "block_id"
|
|
392
|
-
// block_id: string
|
|
393
|
-
// } | null
|
|
394
|
-
// children?: Block[]
|
|
395
|
-
// }
|
|
396
|
-
// }
|
|
397
|
-
|
|
398
|
-
// Template block
|
|
399
|
-
type TemplateBlock = BlockBase & {
|
|
400
|
-
type: "template";
|
|
401
|
-
template: {
|
|
402
|
-
rich_text: RichText;
|
|
403
|
-
children?: Block[];
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
// Table blocks
|
|
408
|
-
type TableBlock = BlockBase & {
|
|
409
|
-
type: "table";
|
|
410
|
-
table: {
|
|
411
|
-
table_width: number;
|
|
412
|
-
has_column_header: boolean;
|
|
413
|
-
has_row_header: boolean;
|
|
414
|
-
children: TableRowBlock[];
|
|
415
|
-
};
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
type TableRowBlock = BlockBase & {
|
|
419
|
-
type: "table_row";
|
|
420
|
-
table_row: {
|
|
421
|
-
cells: RichText[];
|
|
422
|
-
};
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
// AI block
|
|
426
|
-
type AIBlock = BlockBase & {
|
|
427
|
-
type: "ai_block";
|
|
428
|
-
ai_block: {
|
|
429
|
-
prompt?: string;
|
|
430
|
-
};
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
// Unsupported block
|
|
434
|
-
type UnsupportedBlock = BlockBase & {
|
|
435
|
-
type: "unsupported";
|
|
436
|
-
unsupported: Record<string, never>;
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
// All block types union
|
|
440
|
-
type Block =
|
|
441
|
-
| ParagraphBlock
|
|
442
|
-
| Heading1Block
|
|
443
|
-
| Heading2Block
|
|
444
|
-
| Heading3Block
|
|
445
|
-
| BulletedListItemBlock
|
|
446
|
-
| NumberedListItemBlock
|
|
447
|
-
| ToDoBlock
|
|
448
|
-
| ToggleBlock
|
|
449
|
-
| QuoteBlock
|
|
450
|
-
| CalloutBlock
|
|
451
|
-
| CodeBlock
|
|
452
|
-
| EquationBlock
|
|
453
|
-
| DividerBlock
|
|
454
|
-
| BreadcrumbBlock
|
|
455
|
-
| TableOfContentsBlock
|
|
456
|
-
| ColumnListBlock
|
|
457
|
-
| ColumnBlock
|
|
458
|
-
| ImageBlock
|
|
459
|
-
| VideoBlock
|
|
460
|
-
| AudioBlock
|
|
461
|
-
| PDFBlock
|
|
462
|
-
| FileBlock
|
|
463
|
-
| EmbedBlock
|
|
464
|
-
| BookmarkBlock
|
|
465
|
-
| LinkPreviewBlock
|
|
466
|
-
| ChildPageBlock
|
|
467
|
-
| ChildDatabaseBlock
|
|
468
|
-
| TemplateBlock
|
|
469
|
-
| TableBlock
|
|
470
|
-
| TableRowBlock
|
|
471
|
-
| AIBlock
|
|
472
|
-
| UnsupportedBlock;
|
|
473
|
-
|
|
474
|
-
// Export all types
|
|
475
|
-
export type {
|
|
476
|
-
RichText,
|
|
477
|
-
RichTextItem,
|
|
478
|
-
RichTextBase,
|
|
479
|
-
RichTextAnnotations,
|
|
480
|
-
TextContent,
|
|
481
|
-
EquationContent,
|
|
482
|
-
MentionContent,
|
|
483
|
-
DateMention,
|
|
484
|
-
CustomEmojiMention,
|
|
485
|
-
LinkPreviewMention,
|
|
486
|
-
LinkMention,
|
|
487
|
-
ApiColor,
|
|
488
|
-
Icon,
|
|
489
|
-
EmojiIcon,
|
|
490
|
-
ExternalIcon,
|
|
491
|
-
FileIcon,
|
|
492
|
-
FileObject,
|
|
493
|
-
ExternalFile,
|
|
494
|
-
HostedFile,
|
|
495
|
-
BlockBase,
|
|
496
|
-
ParagraphBlock,
|
|
497
|
-
Heading1Block,
|
|
498
|
-
Heading2Block,
|
|
499
|
-
Heading3Block,
|
|
500
|
-
BulletedListItemBlock,
|
|
501
|
-
NumberedListItemBlock,
|
|
502
|
-
ToDoBlock,
|
|
503
|
-
ToggleBlock,
|
|
504
|
-
QuoteBlock,
|
|
505
|
-
CalloutBlock,
|
|
506
|
-
CodeBlock,
|
|
507
|
-
EquationBlock,
|
|
508
|
-
DividerBlock,
|
|
509
|
-
BreadcrumbBlock,
|
|
510
|
-
TableOfContentsBlock,
|
|
511
|
-
ColumnListBlock,
|
|
512
|
-
ColumnBlock,
|
|
513
|
-
ImageBlock,
|
|
514
|
-
VideoBlock,
|
|
515
|
-
AudioBlock,
|
|
516
|
-
PDFBlock,
|
|
517
|
-
FileBlock,
|
|
518
|
-
EmbedBlock,
|
|
519
|
-
BookmarkBlock,
|
|
520
|
-
LinkPreviewBlock,
|
|
521
|
-
ChildPageBlock,
|
|
522
|
-
ChildDatabaseBlock,
|
|
523
|
-
TemplateBlock,
|
|
524
|
-
TableBlock,
|
|
525
|
-
TableRowBlock,
|
|
526
|
-
AIBlock,
|
|
527
|
-
UnsupportedBlock,
|
|
528
|
-
Block,
|
|
529
|
-
};
|
|
File without changes
|