@notionhq/workers 0.6.0 → 0.7.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/block.d.ts +321 -0
- package/dist/block.d.ts.map +1 -0
- package/dist/block.js +0 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/worker.d.ts +1 -41
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +0 -50
- package/package.json +1 -1
- package/src/block.ts +525 -0
- package/src/index.ts +0 -7
- package/src/worker.test.ts +0 -147
- package/src/worker.ts +1 -59
- package/dist/capabilities/custom-block.d.ts +0 -124
- package/dist/capabilities/custom-block.d.ts.map +0 -1
- package/dist/capabilities/custom-block.js +0 -22
- package/src/capabilities/custom-block.ts +0 -181
package/dist/block.d.ts
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
type ApiColor = "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
|
+
type RichTextAnnotations = {
|
|
3
|
+
bold: boolean;
|
|
4
|
+
italic: boolean;
|
|
5
|
+
strikethrough: boolean;
|
|
6
|
+
underline: boolean;
|
|
7
|
+
code: boolean;
|
|
8
|
+
color: ApiColor;
|
|
9
|
+
};
|
|
10
|
+
type RichTextBase = {
|
|
11
|
+
plain_text: string;
|
|
12
|
+
href: string | null;
|
|
13
|
+
annotations: RichTextAnnotations;
|
|
14
|
+
};
|
|
15
|
+
type TextContent = {
|
|
16
|
+
content: string;
|
|
17
|
+
link: {
|
|
18
|
+
url: string;
|
|
19
|
+
} | null;
|
|
20
|
+
};
|
|
21
|
+
type EquationContent = {
|
|
22
|
+
expression: string;
|
|
23
|
+
};
|
|
24
|
+
type DateMention = {
|
|
25
|
+
type: "date";
|
|
26
|
+
date: {
|
|
27
|
+
start: string;
|
|
28
|
+
end?: string | null;
|
|
29
|
+
time_zone?: string | null;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
type CustomEmojiMention = {
|
|
33
|
+
type: "custom_emoji";
|
|
34
|
+
custom_emoji: {
|
|
35
|
+
id: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
url?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type LinkPreviewMention = {
|
|
41
|
+
type: "link_preview";
|
|
42
|
+
link_preview: {
|
|
43
|
+
url: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
type LinkMention = {
|
|
47
|
+
type: "link_mention";
|
|
48
|
+
link_mention: {
|
|
49
|
+
href: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
type MentionContent = DateMention | CustomEmojiMention | LinkPreviewMention | LinkMention;
|
|
53
|
+
type RichTextItem = RichTextBase & ({
|
|
54
|
+
type: "text";
|
|
55
|
+
text: TextContent;
|
|
56
|
+
} | {
|
|
57
|
+
type: "mention";
|
|
58
|
+
mention: MentionContent;
|
|
59
|
+
} | {
|
|
60
|
+
type: "equation";
|
|
61
|
+
equation: EquationContent;
|
|
62
|
+
});
|
|
63
|
+
type RichText = RichTextItem[];
|
|
64
|
+
type EmojiIcon = {
|
|
65
|
+
type: "emoji";
|
|
66
|
+
emoji: string;
|
|
67
|
+
};
|
|
68
|
+
type ExternalIcon = {
|
|
69
|
+
type: "external";
|
|
70
|
+
external: {
|
|
71
|
+
url: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
type FileIcon = {
|
|
75
|
+
type: "file";
|
|
76
|
+
file: {
|
|
77
|
+
url: string;
|
|
78
|
+
expiry_time: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
type Icon = EmojiIcon | ExternalIcon | FileIcon;
|
|
82
|
+
type ExternalFile = {
|
|
83
|
+
type: "external";
|
|
84
|
+
external: {
|
|
85
|
+
url: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
type HostedFile = {
|
|
89
|
+
type: "file";
|
|
90
|
+
file: {
|
|
91
|
+
url: string;
|
|
92
|
+
expiry_time: string;
|
|
93
|
+
};
|
|
94
|
+
name?: string;
|
|
95
|
+
};
|
|
96
|
+
type FileObject = ExternalFile | HostedFile;
|
|
97
|
+
type BlockBase = {
|
|
98
|
+
object: "block";
|
|
99
|
+
};
|
|
100
|
+
type ParagraphBlock = BlockBase & {
|
|
101
|
+
type: "paragraph";
|
|
102
|
+
paragraph: {
|
|
103
|
+
rich_text: RichText;
|
|
104
|
+
color?: ApiColor;
|
|
105
|
+
children?: Block[];
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
type Heading1Block = BlockBase & {
|
|
109
|
+
type: "heading_1";
|
|
110
|
+
heading_1: {
|
|
111
|
+
rich_text: RichText;
|
|
112
|
+
color?: ApiColor;
|
|
113
|
+
is_toggleable?: boolean;
|
|
114
|
+
children?: Block[];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
type Heading2Block = BlockBase & {
|
|
118
|
+
type: "heading_2";
|
|
119
|
+
heading_2: {
|
|
120
|
+
rich_text: RichText;
|
|
121
|
+
color?: ApiColor;
|
|
122
|
+
is_toggleable?: boolean;
|
|
123
|
+
children?: Block[];
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
type Heading3Block = BlockBase & {
|
|
127
|
+
type: "heading_3";
|
|
128
|
+
heading_3: {
|
|
129
|
+
rich_text: RichText;
|
|
130
|
+
color?: ApiColor;
|
|
131
|
+
is_toggleable?: boolean;
|
|
132
|
+
children?: Block[];
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
type BulletedListItemBlock = BlockBase & {
|
|
136
|
+
type: "bulleted_list_item";
|
|
137
|
+
bulleted_list_item: {
|
|
138
|
+
rich_text: RichText;
|
|
139
|
+
color?: ApiColor;
|
|
140
|
+
children?: Block[];
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
type NumberedListItemBlock = BlockBase & {
|
|
144
|
+
type: "numbered_list_item";
|
|
145
|
+
numbered_list_item: {
|
|
146
|
+
rich_text: RichText;
|
|
147
|
+
color?: ApiColor;
|
|
148
|
+
children?: Block[];
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
type ToDoBlock = BlockBase & {
|
|
152
|
+
type: "to_do";
|
|
153
|
+
to_do: {
|
|
154
|
+
rich_text: RichText;
|
|
155
|
+
checked: boolean;
|
|
156
|
+
color?: ApiColor;
|
|
157
|
+
children?: Block[];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
type ToggleBlock = BlockBase & {
|
|
161
|
+
type: "toggle";
|
|
162
|
+
toggle: {
|
|
163
|
+
rich_text: RichText;
|
|
164
|
+
color?: ApiColor;
|
|
165
|
+
children?: Block[];
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
type QuoteBlock = BlockBase & {
|
|
169
|
+
type: "quote";
|
|
170
|
+
quote: {
|
|
171
|
+
rich_text: RichText;
|
|
172
|
+
color?: ApiColor;
|
|
173
|
+
children?: Block[];
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
type CalloutBlock = BlockBase & {
|
|
177
|
+
type: "callout";
|
|
178
|
+
callout: {
|
|
179
|
+
rich_text: RichText;
|
|
180
|
+
icon?: Icon | null;
|
|
181
|
+
color?: ApiColor;
|
|
182
|
+
children?: Block[];
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
type CodeBlock = BlockBase & {
|
|
186
|
+
type: "code";
|
|
187
|
+
code: {
|
|
188
|
+
rich_text: RichText;
|
|
189
|
+
caption?: RichText;
|
|
190
|
+
language: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
type EquationBlock = BlockBase & {
|
|
194
|
+
type: "equation";
|
|
195
|
+
equation: {
|
|
196
|
+
expression: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
type DividerBlock = BlockBase & {
|
|
200
|
+
type: "divider";
|
|
201
|
+
divider: Record<string, never>;
|
|
202
|
+
};
|
|
203
|
+
type BreadcrumbBlock = BlockBase & {
|
|
204
|
+
type: "breadcrumb";
|
|
205
|
+
breadcrumb: Record<string, never>;
|
|
206
|
+
};
|
|
207
|
+
type TableOfContentsBlock = BlockBase & {
|
|
208
|
+
type: "table_of_contents";
|
|
209
|
+
table_of_contents: {
|
|
210
|
+
color?: ApiColor;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
type ColumnListBlock = BlockBase & {
|
|
214
|
+
type: "column_list";
|
|
215
|
+
column_list: {
|
|
216
|
+
children: ColumnBlock[];
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
type ColumnBlock = BlockBase & {
|
|
220
|
+
type: "column";
|
|
221
|
+
column: {
|
|
222
|
+
children?: Block[];
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
type ImageBlock = BlockBase & {
|
|
226
|
+
type: "image";
|
|
227
|
+
image: FileObject & {
|
|
228
|
+
caption?: RichText;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
type VideoBlock = BlockBase & {
|
|
232
|
+
type: "video";
|
|
233
|
+
video: FileObject & {
|
|
234
|
+
caption?: RichText;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
type AudioBlock = BlockBase & {
|
|
238
|
+
type: "audio";
|
|
239
|
+
audio: FileObject & {
|
|
240
|
+
caption?: RichText;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
type PDFBlock = BlockBase & {
|
|
244
|
+
type: "pdf";
|
|
245
|
+
pdf: FileObject & {
|
|
246
|
+
caption?: RichText;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
type FileBlock = BlockBase & {
|
|
250
|
+
type: "file";
|
|
251
|
+
file: FileObject & {
|
|
252
|
+
caption?: RichText;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
type EmbedBlock = BlockBase & {
|
|
256
|
+
type: "embed";
|
|
257
|
+
embed: {
|
|
258
|
+
url: string;
|
|
259
|
+
caption?: RichText;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
type BookmarkBlock = BlockBase & {
|
|
263
|
+
type: "bookmark";
|
|
264
|
+
bookmark: {
|
|
265
|
+
url: string;
|
|
266
|
+
caption?: RichText;
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
type LinkPreviewBlock = BlockBase & {
|
|
270
|
+
type: "link_preview";
|
|
271
|
+
link_preview: {
|
|
272
|
+
url: string;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
type ChildPageBlock = BlockBase & {
|
|
276
|
+
type: "child_page";
|
|
277
|
+
child_page: {
|
|
278
|
+
title: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
type ChildDatabaseBlock = BlockBase & {
|
|
282
|
+
type: "child_database";
|
|
283
|
+
child_database: {
|
|
284
|
+
title: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
type TemplateBlock = BlockBase & {
|
|
288
|
+
type: "template";
|
|
289
|
+
template: {
|
|
290
|
+
rich_text: RichText;
|
|
291
|
+
children?: Block[];
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
type TableBlock = BlockBase & {
|
|
295
|
+
type: "table";
|
|
296
|
+
table: {
|
|
297
|
+
table_width: number;
|
|
298
|
+
has_column_header: boolean;
|
|
299
|
+
has_row_header: boolean;
|
|
300
|
+
children: TableRowBlock[];
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
type TableRowBlock = BlockBase & {
|
|
304
|
+
type: "table_row";
|
|
305
|
+
table_row: {
|
|
306
|
+
cells: RichText[];
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
type AIBlock = BlockBase & {
|
|
310
|
+
type: "ai_block";
|
|
311
|
+
ai_block: {
|
|
312
|
+
prompt?: string;
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
type UnsupportedBlock = BlockBase & {
|
|
316
|
+
type: "unsupported";
|
|
317
|
+
unsupported: Record<string, never>;
|
|
318
|
+
};
|
|
319
|
+
type Block = ParagraphBlock | Heading1Block | Heading2Block | Heading3Block | BulletedListItemBlock | NumberedListItemBlock | ToDoBlock | ToggleBlock | QuoteBlock | CalloutBlock | CodeBlock | EquationBlock | DividerBlock | BreadcrumbBlock | TableOfContentsBlock | ColumnListBlock | ColumnBlock | ImageBlock | VideoBlock | AudioBlock | PDFBlock | FileBlock | EmbedBlock | BookmarkBlock | LinkPreviewBlock | ChildPageBlock | ChildDatabaseBlock | TemplateBlock | TableBlock | TableRowBlock | AIBlock | UnsupportedBlock;
|
|
320
|
+
export type { AIBlock, ApiColor, AudioBlock, Block, BlockBase, BookmarkBlock, BreadcrumbBlock, BulletedListItemBlock, CalloutBlock, ChildDatabaseBlock, ChildPageBlock, CodeBlock, ColumnBlock, ColumnListBlock, CustomEmojiMention, DateMention, DividerBlock, EmbedBlock, EmojiIcon, EquationBlock, EquationContent, ExternalFile, ExternalIcon, FileBlock, FileIcon, FileObject, Heading1Block, Heading2Block, Heading3Block, HostedFile, Icon, ImageBlock, LinkMention, LinkPreviewBlock, LinkPreviewMention, MentionContent, NumberedListItemBlock, ParagraphBlock, PDFBlock, QuoteBlock, RichText, RichTextAnnotations, RichTextBase, RichTextItem, TableBlock, TableOfContentsBlock, TableRowBlock, TemplateBlock, TextContent, ToDoBlock, ToggleBlock, UnsupportedBlock, VideoBlock, };
|
|
321
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AAKA,KAAK,QAAQ,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,KAAK,GACL,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,mBAAm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,QAAQ,GACR,SAAS,GACT,UAAU,GACV,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,aAAa,GACb,UAAU,GACV,aAAa,GACb,OAAO,GACP,gBAAgB,CAAC;AAGpB,YAAY,EACX,OAAO,EACP,QAAQ,EACR,UAAU,EACV,KAAK,EACL,SAAS,EACT,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,IAAI,EACJ,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,WAAW,EACX,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,UAAU,GACV,CAAC"}
|
package/dist/block.js
ADDED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type { CustomBlockCapability, CustomBlockCapabilityConfig, CustomBlockConfiguration, CustomBlockManifest, CustomBlockManifestDataSource, } from "./capabilities/custom-block.js";
|
|
2
1
|
export { emojiIcon, imageCover, imageIcon, notionIcon, place } from "./builder.js";
|
|
3
2
|
export type { AiConnectorArchetype, AiConnectorCapability, AiConnectorChange, AiConnectorChangeUpsert, AiConnectorChatAuthor, AiConnectorChatChannel, AiConnectorChatMessage, AiConnectorChatRecord, AiConnectorConfiguration, AiConnectorExecutionResult, AiConnectorMode, AiConnectorProjectBlock, AiConnectorProjectRecord, AiConnectorRecordByArchetype, } from "./capabilities/ai_connector.js";
|
|
4
3
|
export type { AutomationCapability, AutomationConfiguration, AutomationEvent, PageObjectResponse, } from "./capabilities/automation.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACnF,YAAY,EACX,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,GAC5B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACX,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GAClB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EACX,+BAA+B,EAC/B,eAAe,EACf,kBAAkB,EAClB,6BAA6B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,GACR,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC3F,YAAY,EACX,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,GACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,YAAY,EACX,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACvB,wBAAwB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EACX,KAAK,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,QAAQ,GACR,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/worker.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { AiConnectorArchetype, AiConnectorCapability, AiConnectorConfiguration } from "./capabilities/ai_connector.js";
|
|
2
2
|
import type { AutomationCapability, AutomationConfiguration, AutomationEvent } from "./capabilities/automation.js";
|
|
3
3
|
import type { CapabilityContext } from "./capabilities/context.js";
|
|
4
|
-
import type { CustomBlockCapability, CustomBlockConfiguration } from "./capabilities/custom-block.js";
|
|
5
4
|
import type { NotionManagedOAuthConfiguration, OAuthCapability, OAuthConfiguration, UserManagedOAuthConfiguration } from "./capabilities/oauth.js";
|
|
6
5
|
import type { SyncCapability, SyncConfiguration } from "./capabilities/sync.js";
|
|
7
6
|
import type { ToolCapability, ToolConfiguration } from "./capabilities/tool.js";
|
|
@@ -14,7 +13,7 @@ import type { WorkflowTrigger } from "./triggers.generated.js";
|
|
|
14
13
|
import type { HandlerOptions, JSONValue } from "./types.js";
|
|
15
14
|
export type { AiConnectorConfiguration, AutomationConfiguration, AutomationEvent, CapabilityContext, NotionManagedOAuthConfiguration, OAuthConfiguration, SyncConfiguration, ToolConfiguration, UserManagedOAuthConfiguration, WebhookConfiguration, WebhookEvent, WorkflowConfiguration, WorkflowEvent, };
|
|
16
15
|
export { WebhookVerificationError };
|
|
17
|
-
type Capability = SyncCapability | AiConnectorCapability | ToolCapability<any, any> | AutomationCapability | WorkflowCapability | OAuthCapability | WebhookCapability
|
|
16
|
+
type Capability = SyncCapability | AiConnectorCapability | ToolCapability<any, any> | AutomationCapability | WorkflowCapability | OAuthCapability | WebhookCapability;
|
|
18
17
|
export type CapabilityType = Capability["_tag"];
|
|
19
18
|
/**
|
|
20
19
|
* Configuration for a database that Notion creates and manages on behalf
|
|
@@ -401,45 +400,6 @@ export declare class Worker {
|
|
|
401
400
|
* @returns The registered OAuth capability.
|
|
402
401
|
*/
|
|
403
402
|
oauth(key: string, config: OAuthConfiguration): OAuthCapability;
|
|
404
|
-
/**
|
|
405
|
-
* Register a custom block capability.
|
|
406
|
-
*
|
|
407
|
-
* A custom block is a front-end view that the deploy pipeline builds from
|
|
408
|
-
* the source entry into a deployable bundle. It can optionally declare a
|
|
409
|
-
* data-source *schema* (`name`, and optional `description`, `icon`, and
|
|
410
|
-
* `properties`) that the block reads.
|
|
411
|
-
*
|
|
412
|
-
* Example:
|
|
413
|
-
*
|
|
414
|
-
* ```ts
|
|
415
|
-
* const worker = new Worker();
|
|
416
|
-
* export default worker;
|
|
417
|
-
*
|
|
418
|
-
* worker.customBlock("issueBoard", {
|
|
419
|
-
* version: 1,
|
|
420
|
-
* path: "./views/issueBoard",
|
|
421
|
-
* dataSources: {
|
|
422
|
-
* issues: {
|
|
423
|
-
* name: "Issues",
|
|
424
|
-
* properties: {
|
|
425
|
-
* title: { name: "Title", type: "title" },
|
|
426
|
-
* status: { name: "Status", type: "status" },
|
|
427
|
-
* },
|
|
428
|
-
* },
|
|
429
|
-
* },
|
|
430
|
-
* });
|
|
431
|
-
* ```
|
|
432
|
-
*
|
|
433
|
-
* The manifest keys (`version`, `dataSources`) are top-level on the config;
|
|
434
|
-
* the SDK assembles the deploy-wire `CustomBlockManifest` from them. Binding
|
|
435
|
-
* each declared data source to a concrete managed database is instance-level
|
|
436
|
-
* and handled at deploy time — the worker does not emit bindings.
|
|
437
|
-
*
|
|
438
|
-
* @param key - The unique key for this block (the block declaration key).
|
|
439
|
-
* @param config - The custom block configuration (a `project`/`static` source folder + optional `version`/`dataSources` schema).
|
|
440
|
-
* @returns The custom block capability.
|
|
441
|
-
*/
|
|
442
|
-
customBlock(key: string, config: CustomBlockConfiguration): CustomBlockCapability;
|
|
443
403
|
/**
|
|
444
404
|
* Get all registered capabilities (for discovery) without their handlers.
|
|
445
405
|
*/
|
package/dist/worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EACX,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EACX
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EACX,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EACX,+BAA+B,EAC/B,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,M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CAAC,GAC7B,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC;IAOvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,oBAAoB;IAO9E;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,QAAQ,CAAC,KAAK,CAAC,SAAS,SAAS,SAAS,CAAC,eAAe,EAAE,GAAG,eAAe,EAAE,CAAC,EAChF,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,qBAAqB,CAAC,SAAS,CAAC,GACtC,kBAAkB,CAAC,SAAS,CAAC;IAOhC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,iBAAiB;IAOrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,eAAe;IAO/D;;OAEG;IACH,IAAI,YAAY,IAAI,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC,EAAE,CAMhE;IAED,IAAI,QAAQ,IAAI,cAAc,CAO7B;IAED;;;;;;;OAOG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAgCxF"}
|
package/dist/worker.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createAiConnectorCapability } from "./capabilities/ai_connector.js";
|
|
2
2
|
import { createAutomationCapability } from "./capabilities/automation.js";
|
|
3
|
-
import { createCustomBlockCapability } from "./capabilities/custom-block.js";
|
|
4
3
|
import { createOAuthCapability } from "./capabilities/oauth.js";
|
|
5
4
|
import { createSyncCapability } from "./capabilities/sync.js";
|
|
6
5
|
import { createToolCapability } from "./capabilities/tool.js";
|
|
@@ -366,50 +365,6 @@ class Worker {
|
|
|
366
365
|
this.#capabilities.set(key, capability);
|
|
367
366
|
return capability;
|
|
368
367
|
}
|
|
369
|
-
/**
|
|
370
|
-
* Register a custom block capability.
|
|
371
|
-
*
|
|
372
|
-
* A custom block is a front-end view that the deploy pipeline builds from
|
|
373
|
-
* the source entry into a deployable bundle. It can optionally declare a
|
|
374
|
-
* data-source *schema* (`name`, and optional `description`, `icon`, and
|
|
375
|
-
* `properties`) that the block reads.
|
|
376
|
-
*
|
|
377
|
-
* Example:
|
|
378
|
-
*
|
|
379
|
-
* ```ts
|
|
380
|
-
* const worker = new Worker();
|
|
381
|
-
* export default worker;
|
|
382
|
-
*
|
|
383
|
-
* worker.customBlock("issueBoard", {
|
|
384
|
-
* version: 1,
|
|
385
|
-
* path: "./views/issueBoard",
|
|
386
|
-
* dataSources: {
|
|
387
|
-
* issues: {
|
|
388
|
-
* name: "Issues",
|
|
389
|
-
* properties: {
|
|
390
|
-
* title: { name: "Title", type: "title" },
|
|
391
|
-
* status: { name: "Status", type: "status" },
|
|
392
|
-
* },
|
|
393
|
-
* },
|
|
394
|
-
* },
|
|
395
|
-
* });
|
|
396
|
-
* ```
|
|
397
|
-
*
|
|
398
|
-
* The manifest keys (`version`, `dataSources`) are top-level on the config;
|
|
399
|
-
* the SDK assembles the deploy-wire `CustomBlockManifest` from them. Binding
|
|
400
|
-
* each declared data source to a concrete managed database is instance-level
|
|
401
|
-
* and handled at deploy time — the worker does not emit bindings.
|
|
402
|
-
*
|
|
403
|
-
* @param key - The unique key for this block (the block declaration key).
|
|
404
|
-
* @param config - The custom block configuration (a `project`/`static` source folder + optional `version`/`dataSources` schema).
|
|
405
|
-
* @returns The custom block capability.
|
|
406
|
-
*/
|
|
407
|
-
customBlock(key, config) {
|
|
408
|
-
this.#validateUniqueKey(key);
|
|
409
|
-
const capability = createCustomBlockCapability(key, config);
|
|
410
|
-
this.#capabilities.set(key, capability);
|
|
411
|
-
return capability;
|
|
412
|
-
}
|
|
413
368
|
/**
|
|
414
369
|
* Get all registered capabilities (for discovery) without their handlers.
|
|
415
370
|
*/
|
|
@@ -446,11 +401,6 @@ class Worker {
|
|
|
446
401
|
`Cannot run OAuth capability "${key}" - OAuth capabilities only provide configuration`
|
|
447
402
|
);
|
|
448
403
|
}
|
|
449
|
-
if (capability._tag === "custom_block") {
|
|
450
|
-
throw new Error(
|
|
451
|
-
`Cannot run custom block capability "${key}" - custom blocks only provide configuration`
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
404
|
if (!capability.handler) {
|
|
455
405
|
throw new Error(`Capability "${key}" cannot be executed`);
|
|
456
406
|
}
|