@notionhq/workers 0.5.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.map +1 -1
- package/dist/builder.js +2 -6
- 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/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 +2 -6
- 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 +2 -2
- package/dist/capabilities/workflow.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -7
- 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/types.d.ts.map +1 -1
- package/dist/worker.d.ts +41 -1
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +51 -4
- package/package.json +74 -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 +3 -10
- 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 +3 -6
- 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 +2 -6
- package/src/capabilities/sync.test.ts +15 -45
- package/src/capabilities/sync.ts +10 -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 +10 -31
- package/src/capabilities/workflow.ts +5 -12
- package/src/index.ts +9 -12
- 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 +5 -16
- package/src/schema.ts +2 -10
- package/src/types.ts +1 -7
- package/src/worker.test.ts +147 -0
- package/src/worker.ts +67 -35
- 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
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import type { CalendarEventCanceledEvent, CalendarEventCreatedEvent, CalendarEventUpdatedEvent, DiscordInteractionEvent, GoogleDriveOauthFilesChangedEvent, MailEmailReceivedEvent, MailEmailSentEvent, MailLabelAppliedEvent, NotionAgentMentionedEvent, NotionButtonPressedEvent, NotionCommentAddedEvent, NotionDatabaseAgentUpdatedEvent, NotionMeetingNoteSummaryCompletedEvent, NotionPageCreatedEvent, NotionPageDeletedEvent, NotionPageUpdatedEvent, RecurrenceEvent, SlackAppMentionEvent, SlackMessageEvent, SlackReactionAddedEvent, WebhookEvent } from "./triggers.js";
|
|
2
|
+
export type { Actor, ActorLike, CalendarEventCanceledEvent, CalendarEventCreatedEvent, CalendarEventLike, CalendarEventUpdatedEvent, ChatMessageLike, ChatThreadMessage, DiscordChatThreadMessage, DiscordInteractionEvent, EmailMessageLike, EmailThreadLike, EmailTriggerMessage, GoogleDriveOauthFilesChangedEvent, LinkLike, MailEmailReceivedEvent, MailEmailSentEvent, MailLabelAppliedEvent, MessageLike, NotionAgentMentionedEvent, NotionButtonPressedEvent, NotionCommentAddedEvent, NotionDatabaseAgentUpdatedEvent, NotionMeetingNoteSummaryCompletedEvent, NotionPageCreatedEvent, NotionPageDeletedEvent, NotionPageEdit, NotionPageUpdatedEvent, RecurrenceEvent, RecurrenceFrequency, SlackAppMentionEvent, SlackChatThreadMessage, SlackMessageEvent, SlackReactionAddedEvent, ThreadLike, ThreadMessage, TimestampLike, TriggerEvent, TriggerEventBase, TriggerEventMap, TriggerType, VendorActor, VendorExtensions, WebhookEvent, } from "./triggers.js";
|
|
3
|
+
/** A message was posted in a subscribed Slack channel. */
|
|
4
|
+
export type SlackMessageTrigger = {
|
|
5
|
+
type: "slack.message";
|
|
6
|
+
};
|
|
7
|
+
/** A reaction was added to a Slack message. */
|
|
8
|
+
export type SlackReactionAddedTrigger = {
|
|
9
|
+
type: "slack.reaction.added";
|
|
10
|
+
};
|
|
11
|
+
/** The Notion app was mentioned in a Slack message. */
|
|
12
|
+
export type SlackAppMentionTrigger = {
|
|
13
|
+
type: "slack.app.mention";
|
|
14
|
+
};
|
|
15
|
+
/** A Discord interaction was received. */
|
|
16
|
+
export type DiscordInteractionTrigger = {
|
|
17
|
+
type: "discord.interaction";
|
|
18
|
+
};
|
|
19
|
+
/** An email was received. */
|
|
20
|
+
export type MailEmailReceivedTrigger = {
|
|
21
|
+
type: "mail.email.received";
|
|
22
|
+
};
|
|
23
|
+
/** An email was sent. */
|
|
24
|
+
export type MailEmailSentTrigger = {
|
|
25
|
+
type: "mail.email.sent";
|
|
26
|
+
};
|
|
27
|
+
/** A label was applied to an email. */
|
|
28
|
+
export type MailLabelAppliedTrigger = {
|
|
29
|
+
type: "mail.label.applied";
|
|
30
|
+
};
|
|
31
|
+
/** A calendar event was created. */
|
|
32
|
+
export type CalendarEventCreatedTrigger = {
|
|
33
|
+
type: "calendar.event.created";
|
|
34
|
+
};
|
|
35
|
+
/** A calendar event was updated. */
|
|
36
|
+
export type CalendarEventUpdatedTrigger = {
|
|
37
|
+
type: "calendar.event.updated";
|
|
38
|
+
};
|
|
39
|
+
/** A calendar event was canceled. */
|
|
40
|
+
export type CalendarEventCanceledTrigger = {
|
|
41
|
+
type: "calendar.event.canceled";
|
|
42
|
+
};
|
|
43
|
+
/** A page has been added to a database. */
|
|
44
|
+
export type NotionPageCreatedTrigger = {
|
|
45
|
+
type: "notion.page.created";
|
|
46
|
+
};
|
|
47
|
+
/** A page was updated. */
|
|
48
|
+
export type NotionPageUpdatedTrigger = {
|
|
49
|
+
type: "notion.page.updated";
|
|
50
|
+
};
|
|
51
|
+
/** A page was deleted. */
|
|
52
|
+
export type NotionPageDeletedTrigger = {
|
|
53
|
+
type: "notion.page.deleted";
|
|
54
|
+
};
|
|
55
|
+
/** A meeting note's AI summary finished generating. */
|
|
56
|
+
export type NotionMeetingNoteSummaryCompletedTrigger = {
|
|
57
|
+
type: "notion.meetingNote.summary.completed";
|
|
58
|
+
};
|
|
59
|
+
/** A comment was added to a page discussion. */
|
|
60
|
+
export type NotionCommentAddedTrigger = {
|
|
61
|
+
type: "notion.page.discussion.comment.added";
|
|
62
|
+
};
|
|
63
|
+
/** An agent was mentioned in page content or a person property. */
|
|
64
|
+
export type NotionAgentMentionedTrigger = {
|
|
65
|
+
type: "notion.agent.mentioned";
|
|
66
|
+
};
|
|
67
|
+
/** A button block was pressed. */
|
|
68
|
+
export type NotionButtonPressedTrigger = {
|
|
69
|
+
type: "notion.button.pressed";
|
|
70
|
+
};
|
|
71
|
+
/** A database agent's configuration was updated. */
|
|
72
|
+
export type NotionDatabaseAgentUpdatedTrigger = {
|
|
73
|
+
type: "notion.database.agent.updated";
|
|
74
|
+
};
|
|
75
|
+
/** An incoming webhook request was received. */
|
|
76
|
+
export type WebhookTrigger = {
|
|
77
|
+
type: "webhooks.webhook";
|
|
78
|
+
};
|
|
79
|
+
/** Files changed in a watched Google Drive folder or drive. */
|
|
80
|
+
export type GoogleDriveOauthFilesChangedTrigger = {
|
|
81
|
+
type: "googleDriveOauth.filesChanged";
|
|
82
|
+
};
|
|
83
|
+
/** A recurring schedule fired. */
|
|
84
|
+
export type RecurrenceTrigger = {
|
|
85
|
+
type: "recurrence";
|
|
86
|
+
};
|
|
87
|
+
/** Creators for each event that can trigger a workflow. */
|
|
88
|
+
export declare const triggers: {
|
|
89
|
+
/**
|
|
90
|
+
* Declare that a workflow can run on `slack.message` events.
|
|
91
|
+
*
|
|
92
|
+
* A message was posted in a subscribed Slack channel.
|
|
93
|
+
*/
|
|
94
|
+
readonly slackMessage: () => SlackMessageTrigger;
|
|
95
|
+
/**
|
|
96
|
+
* Declare that a workflow can run on `slack.reaction.added` events.
|
|
97
|
+
*
|
|
98
|
+
* A reaction was added to a Slack message.
|
|
99
|
+
*/
|
|
100
|
+
readonly slackReactionAdded: () => SlackReactionAddedTrigger;
|
|
101
|
+
/**
|
|
102
|
+
* Declare that a workflow can run on `slack.app.mention` events.
|
|
103
|
+
*
|
|
104
|
+
* The Notion app was mentioned in a Slack message.
|
|
105
|
+
*/
|
|
106
|
+
readonly slackAppMention: () => SlackAppMentionTrigger;
|
|
107
|
+
/**
|
|
108
|
+
* Declare that a workflow can run on `discord.interaction` events.
|
|
109
|
+
*
|
|
110
|
+
* A Discord interaction was received.
|
|
111
|
+
*/
|
|
112
|
+
readonly discordInteraction: () => DiscordInteractionTrigger;
|
|
113
|
+
/**
|
|
114
|
+
* Declare that a workflow can run on `mail.email.received` events.
|
|
115
|
+
*
|
|
116
|
+
* An email was received.
|
|
117
|
+
*/
|
|
118
|
+
readonly mailEmailReceived: () => MailEmailReceivedTrigger;
|
|
119
|
+
/**
|
|
120
|
+
* Declare that a workflow can run on `mail.email.sent` events.
|
|
121
|
+
*
|
|
122
|
+
* An email was sent.
|
|
123
|
+
*/
|
|
124
|
+
readonly mailEmailSent: () => MailEmailSentTrigger;
|
|
125
|
+
/**
|
|
126
|
+
* Declare that a workflow can run on `mail.label.applied` events.
|
|
127
|
+
*
|
|
128
|
+
* A label was applied to an email.
|
|
129
|
+
*/
|
|
130
|
+
readonly mailLabelApplied: () => MailLabelAppliedTrigger;
|
|
131
|
+
/**
|
|
132
|
+
* Declare that a workflow can run on `calendar.event.created` events.
|
|
133
|
+
*
|
|
134
|
+
* A calendar event was created.
|
|
135
|
+
*/
|
|
136
|
+
readonly calendarEventCreated: () => CalendarEventCreatedTrigger;
|
|
137
|
+
/**
|
|
138
|
+
* Declare that a workflow can run on `calendar.event.updated` events.
|
|
139
|
+
*
|
|
140
|
+
* A calendar event was updated.
|
|
141
|
+
*/
|
|
142
|
+
readonly calendarEventUpdated: () => CalendarEventUpdatedTrigger;
|
|
143
|
+
/**
|
|
144
|
+
* Declare that a workflow can run on `calendar.event.canceled` events.
|
|
145
|
+
*
|
|
146
|
+
* A calendar event was canceled.
|
|
147
|
+
*/
|
|
148
|
+
readonly calendarEventCanceled: () => CalendarEventCanceledTrigger;
|
|
149
|
+
/**
|
|
150
|
+
* Declare that a workflow can run on `notion.page.created` events.
|
|
151
|
+
*
|
|
152
|
+
* A page has been added to a database.
|
|
153
|
+
*/
|
|
154
|
+
readonly notionPageCreated: () => NotionPageCreatedTrigger;
|
|
155
|
+
/**
|
|
156
|
+
* Declare that a workflow can run on `notion.page.updated` events.
|
|
157
|
+
*
|
|
158
|
+
* A page was updated.
|
|
159
|
+
*/
|
|
160
|
+
readonly notionPageUpdated: () => NotionPageUpdatedTrigger;
|
|
161
|
+
/**
|
|
162
|
+
* Declare that a workflow can run on `notion.page.deleted` events.
|
|
163
|
+
*
|
|
164
|
+
* A page was deleted.
|
|
165
|
+
*/
|
|
166
|
+
readonly notionPageDeleted: () => NotionPageDeletedTrigger;
|
|
167
|
+
/**
|
|
168
|
+
* Declare that a workflow can run on `notion.meetingNote.summary.completed` events.
|
|
169
|
+
*
|
|
170
|
+
* A meeting note's AI summary finished generating.
|
|
171
|
+
*/
|
|
172
|
+
readonly notionMeetingNoteSummaryCompleted: () => NotionMeetingNoteSummaryCompletedTrigger;
|
|
173
|
+
/**
|
|
174
|
+
* Declare that a workflow can run on `notion.page.discussion.comment.added` events.
|
|
175
|
+
*
|
|
176
|
+
* A comment was added to a page discussion.
|
|
177
|
+
*/
|
|
178
|
+
readonly notionCommentAdded: () => NotionCommentAddedTrigger;
|
|
179
|
+
/**
|
|
180
|
+
* Declare that a workflow can run on `notion.agent.mentioned` events.
|
|
181
|
+
*
|
|
182
|
+
* An agent was mentioned in page content or a person property.
|
|
183
|
+
*/
|
|
184
|
+
readonly notionAgentMentioned: () => NotionAgentMentionedTrigger;
|
|
185
|
+
/**
|
|
186
|
+
* Declare that a workflow can run on `notion.button.pressed` events.
|
|
187
|
+
*
|
|
188
|
+
* A button block was pressed.
|
|
189
|
+
*/
|
|
190
|
+
readonly notionButtonPressed: () => NotionButtonPressedTrigger;
|
|
191
|
+
/**
|
|
192
|
+
* Declare that a workflow can run on `notion.database.agent.updated` events.
|
|
193
|
+
*
|
|
194
|
+
* A database agent's configuration was updated.
|
|
195
|
+
*/
|
|
196
|
+
readonly notionDatabaseAgentUpdated: () => NotionDatabaseAgentUpdatedTrigger;
|
|
197
|
+
/**
|
|
198
|
+
* Declare that a workflow can run on `webhooks.webhook` events.
|
|
199
|
+
*
|
|
200
|
+
* An incoming webhook request was received.
|
|
201
|
+
*/
|
|
202
|
+
readonly webhook: () => WebhookTrigger;
|
|
203
|
+
/**
|
|
204
|
+
* Declare that a workflow can run on `googleDriveOauth.filesChanged` events.
|
|
205
|
+
*
|
|
206
|
+
* Files changed in a watched Google Drive folder or drive.
|
|
207
|
+
*/
|
|
208
|
+
readonly googleDriveOauthFilesChanged: () => GoogleDriveOauthFilesChangedTrigger;
|
|
209
|
+
/**
|
|
210
|
+
* Declare that a workflow can run on `recurrence` events.
|
|
211
|
+
*
|
|
212
|
+
* A recurring schedule fired.
|
|
213
|
+
*/
|
|
214
|
+
readonly recurrence: () => RecurrenceTrigger;
|
|
215
|
+
};
|
|
216
|
+
/** Event that can trigger a workflow. */
|
|
217
|
+
export type WorkflowTrigger = SlackMessageTrigger | SlackReactionAddedTrigger | SlackAppMentionTrigger | DiscordInteractionTrigger | MailEmailReceivedTrigger | MailEmailSentTrigger | MailLabelAppliedTrigger | CalendarEventCreatedTrigger | CalendarEventUpdatedTrigger | CalendarEventCanceledTrigger | NotionPageCreatedTrigger | NotionPageUpdatedTrigger | NotionPageDeletedTrigger | NotionMeetingNoteSummaryCompletedTrigger | NotionCommentAddedTrigger | NotionAgentMentionedTrigger | NotionButtonPressedTrigger | NotionDatabaseAgentUpdatedTrigger | WebhookTrigger | GoogleDriveOauthFilesChangedTrigger | RecurrenceTrigger;
|
|
218
|
+
/** All workflow trigger type strings. */
|
|
219
|
+
export declare const WORKFLOW_TRIGGER_TYPES: readonly ["slack.message", "slack.reaction.added", "slack.app.mention", "discord.interaction", "mail.email.received", "mail.email.sent", "mail.label.applied", "calendar.event.created", "calendar.event.updated", "calendar.event.canceled", "notion.page.created", "notion.page.updated", "notion.page.deleted", "notion.meetingNote.summary.completed", "notion.page.discussion.comment.added", "notion.agent.mentioned", "notion.button.pressed", "notion.database.agent.updated", "webhooks.webhook", "googleDriveOauth.filesChanged", "recurrence"];
|
|
220
|
+
/** A workflow trigger type string. */
|
|
221
|
+
export type WorkflowTriggerType = (typeof WORKFLOW_TRIGGER_TYPES)[number];
|
|
222
|
+
/** Maps each supported workflow trigger to the event its handler receives. */
|
|
223
|
+
export type WorkflowEventMap = {
|
|
224
|
+
"slack.message": SlackMessageEvent;
|
|
225
|
+
"slack.reaction.added": SlackReactionAddedEvent;
|
|
226
|
+
"slack.app.mention": SlackAppMentionEvent;
|
|
227
|
+
"discord.interaction": DiscordInteractionEvent;
|
|
228
|
+
"mail.email.received": MailEmailReceivedEvent;
|
|
229
|
+
"mail.email.sent": MailEmailSentEvent;
|
|
230
|
+
"mail.label.applied": MailLabelAppliedEvent;
|
|
231
|
+
"calendar.event.created": CalendarEventCreatedEvent;
|
|
232
|
+
"calendar.event.updated": CalendarEventUpdatedEvent;
|
|
233
|
+
"calendar.event.canceled": CalendarEventCanceledEvent;
|
|
234
|
+
"notion.page.created": NotionPageCreatedEvent;
|
|
235
|
+
"notion.page.updated": NotionPageUpdatedEvent;
|
|
236
|
+
"notion.page.deleted": NotionPageDeletedEvent;
|
|
237
|
+
"notion.meetingNote.summary.completed": NotionMeetingNoteSummaryCompletedEvent;
|
|
238
|
+
"notion.page.discussion.comment.added": NotionCommentAddedEvent;
|
|
239
|
+
"notion.agent.mentioned": NotionAgentMentionedEvent;
|
|
240
|
+
"notion.button.pressed": NotionButtonPressedEvent;
|
|
241
|
+
"notion.database.agent.updated": NotionDatabaseAgentUpdatedEvent;
|
|
242
|
+
"webhooks.webhook": WebhookEvent;
|
|
243
|
+
"googleDriveOauth.filesChanged": GoogleDriveOauthFilesChangedEvent;
|
|
244
|
+
recurrence: RecurrenceEvent;
|
|
245
|
+
};
|
|
246
|
+
//# sourceMappingURL=triggers.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.generated.d.ts","sourceRoot":"","sources":["../../src/alpha/triggers.generated.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,KAAK,EACL,SAAS,EACT,0BAA0B,EAC1B,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,iCAAiC,EACjC,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,+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BAAsB,CAAC;IAC9C,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,oBAAoB,EAAE,qBAAqB,CAAC;IAC5C,wBAAwB,EAAE,yBAAyB,CAAC;IACpD,wBAAwB,EAAE,yBAAyB,CAAC;IACpD,yBAAyB,EAAE,0BAA0B,CAAC;IACtD,qBAAqB,EAAE,sBAAsB,CAAC;IAC9C,qBAAqB,EAAE,sBAAsB,CAAC;IAC9C,qBAAqB,EAAE,sBAAsB,CAAC;IAC9C,sCAAsC,EAAE,sCAAsC,CAAC;IAC/E,sCAAsC,EAAE,uBAAuB,CAAC;IAChE,wBAAwB,EAAE,yBAAyB,CAAC;IACpD,uBAAuB,EAAE,wBAAwB,CAAC;IAClD,+BAA+B,EAAE,+BAA+B,CAAC;IACjE,kBAAkB,EAAE,YAAY,CAAC;IACjC,+BAA+B,EAAE,iCAAiC,CAAC;IACnE,UAAU,EAAE,eAAe,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
const triggers = {
|
|
2
|
+
/**
|
|
3
|
+
* Declare that a workflow can run on `slack.message` events.
|
|
4
|
+
*
|
|
5
|
+
* A message was posted in a subscribed Slack channel.
|
|
6
|
+
*/
|
|
7
|
+
slackMessage() {
|
|
8
|
+
return {
|
|
9
|
+
type: "slack.message"
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* Declare that a workflow can run on `slack.reaction.added` events.
|
|
14
|
+
*
|
|
15
|
+
* A reaction was added to a Slack message.
|
|
16
|
+
*/
|
|
17
|
+
slackReactionAdded() {
|
|
18
|
+
return {
|
|
19
|
+
type: "slack.reaction.added"
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Declare that a workflow can run on `slack.app.mention` events.
|
|
24
|
+
*
|
|
25
|
+
* The Notion app was mentioned in a Slack message.
|
|
26
|
+
*/
|
|
27
|
+
slackAppMention() {
|
|
28
|
+
return {
|
|
29
|
+
type: "slack.app.mention"
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Declare that a workflow can run on `discord.interaction` events.
|
|
34
|
+
*
|
|
35
|
+
* A Discord interaction was received.
|
|
36
|
+
*/
|
|
37
|
+
discordInteraction() {
|
|
38
|
+
return {
|
|
39
|
+
type: "discord.interaction"
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Declare that a workflow can run on `mail.email.received` events.
|
|
44
|
+
*
|
|
45
|
+
* An email was received.
|
|
46
|
+
*/
|
|
47
|
+
mailEmailReceived() {
|
|
48
|
+
return {
|
|
49
|
+
type: "mail.email.received"
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Declare that a workflow can run on `mail.email.sent` events.
|
|
54
|
+
*
|
|
55
|
+
* An email was sent.
|
|
56
|
+
*/
|
|
57
|
+
mailEmailSent() {
|
|
58
|
+
return {
|
|
59
|
+
type: "mail.email.sent"
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Declare that a workflow can run on `mail.label.applied` events.
|
|
64
|
+
*
|
|
65
|
+
* A label was applied to an email.
|
|
66
|
+
*/
|
|
67
|
+
mailLabelApplied() {
|
|
68
|
+
return {
|
|
69
|
+
type: "mail.label.applied"
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Declare that a workflow can run on `calendar.event.created` events.
|
|
74
|
+
*
|
|
75
|
+
* A calendar event was created.
|
|
76
|
+
*/
|
|
77
|
+
calendarEventCreated() {
|
|
78
|
+
return {
|
|
79
|
+
type: "calendar.event.created"
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* Declare that a workflow can run on `calendar.event.updated` events.
|
|
84
|
+
*
|
|
85
|
+
* A calendar event was updated.
|
|
86
|
+
*/
|
|
87
|
+
calendarEventUpdated() {
|
|
88
|
+
return {
|
|
89
|
+
type: "calendar.event.updated"
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Declare that a workflow can run on `calendar.event.canceled` events.
|
|
94
|
+
*
|
|
95
|
+
* A calendar event was canceled.
|
|
96
|
+
*/
|
|
97
|
+
calendarEventCanceled() {
|
|
98
|
+
return {
|
|
99
|
+
type: "calendar.event.canceled"
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Declare that a workflow can run on `notion.page.created` events.
|
|
104
|
+
*
|
|
105
|
+
* A page has been added to a database.
|
|
106
|
+
*/
|
|
107
|
+
notionPageCreated() {
|
|
108
|
+
return {
|
|
109
|
+
type: "notion.page.created"
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Declare that a workflow can run on `notion.page.updated` events.
|
|
114
|
+
*
|
|
115
|
+
* A page was updated.
|
|
116
|
+
*/
|
|
117
|
+
notionPageUpdated() {
|
|
118
|
+
return {
|
|
119
|
+
type: "notion.page.updated"
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* Declare that a workflow can run on `notion.page.deleted` events.
|
|
124
|
+
*
|
|
125
|
+
* A page was deleted.
|
|
126
|
+
*/
|
|
127
|
+
notionPageDeleted() {
|
|
128
|
+
return {
|
|
129
|
+
type: "notion.page.deleted"
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* Declare that a workflow can run on `notion.meetingNote.summary.completed` events.
|
|
134
|
+
*
|
|
135
|
+
* A meeting note's AI summary finished generating.
|
|
136
|
+
*/
|
|
137
|
+
notionMeetingNoteSummaryCompleted() {
|
|
138
|
+
return {
|
|
139
|
+
type: "notion.meetingNote.summary.completed"
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* Declare that a workflow can run on `notion.page.discussion.comment.added` events.
|
|
144
|
+
*
|
|
145
|
+
* A comment was added to a page discussion.
|
|
146
|
+
*/
|
|
147
|
+
notionCommentAdded() {
|
|
148
|
+
return {
|
|
149
|
+
type: "notion.page.discussion.comment.added"
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* Declare that a workflow can run on `notion.agent.mentioned` events.
|
|
154
|
+
*
|
|
155
|
+
* An agent was mentioned in page content or a person property.
|
|
156
|
+
*/
|
|
157
|
+
notionAgentMentioned() {
|
|
158
|
+
return {
|
|
159
|
+
type: "notion.agent.mentioned"
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
/**
|
|
163
|
+
* Declare that a workflow can run on `notion.button.pressed` events.
|
|
164
|
+
*
|
|
165
|
+
* A button block was pressed.
|
|
166
|
+
*/
|
|
167
|
+
notionButtonPressed() {
|
|
168
|
+
return {
|
|
169
|
+
type: "notion.button.pressed"
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* Declare that a workflow can run on `notion.database.agent.updated` events.
|
|
174
|
+
*
|
|
175
|
+
* A database agent's configuration was updated.
|
|
176
|
+
*/
|
|
177
|
+
notionDatabaseAgentUpdated() {
|
|
178
|
+
return {
|
|
179
|
+
type: "notion.database.agent.updated"
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
/**
|
|
183
|
+
* Declare that a workflow can run on `webhooks.webhook` events.
|
|
184
|
+
*
|
|
185
|
+
* An incoming webhook request was received.
|
|
186
|
+
*/
|
|
187
|
+
webhook() {
|
|
188
|
+
return {
|
|
189
|
+
type: "webhooks.webhook"
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* Declare that a workflow can run on `googleDriveOauth.filesChanged` events.
|
|
194
|
+
*
|
|
195
|
+
* Files changed in a watched Google Drive folder or drive.
|
|
196
|
+
*/
|
|
197
|
+
googleDriveOauthFilesChanged() {
|
|
198
|
+
return {
|
|
199
|
+
type: "googleDriveOauth.filesChanged"
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
/**
|
|
203
|
+
* Declare that a workflow can run on `recurrence` events.
|
|
204
|
+
*
|
|
205
|
+
* A recurring schedule fired.
|
|
206
|
+
*/
|
|
207
|
+
recurrence() {
|
|
208
|
+
return {
|
|
209
|
+
type: "recurrence"
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
const WORKFLOW_TRIGGER_TYPES = [
|
|
214
|
+
"slack.message",
|
|
215
|
+
"slack.reaction.added",
|
|
216
|
+
"slack.app.mention",
|
|
217
|
+
"discord.interaction",
|
|
218
|
+
"mail.email.received",
|
|
219
|
+
"mail.email.sent",
|
|
220
|
+
"mail.label.applied",
|
|
221
|
+
"calendar.event.created",
|
|
222
|
+
"calendar.event.updated",
|
|
223
|
+
"calendar.event.canceled",
|
|
224
|
+
"notion.page.created",
|
|
225
|
+
"notion.page.updated",
|
|
226
|
+
"notion.page.deleted",
|
|
227
|
+
"notion.meetingNote.summary.completed",
|
|
228
|
+
"notion.page.discussion.comment.added",
|
|
229
|
+
"notion.agent.mentioned",
|
|
230
|
+
"notion.button.pressed",
|
|
231
|
+
"notion.database.agent.updated",
|
|
232
|
+
"webhooks.webhook",
|
|
233
|
+
"googleDriveOauth.filesChanged",
|
|
234
|
+
"recurrence"
|
|
235
|
+
];
|
|
236
|
+
export {
|
|
237
|
+
WORKFLOW_TRIGGER_TYPES,
|
|
238
|
+
triggers
|
|
239
|
+
};
|
|
File without changes
|