@notionhq/apps 0.0.13 → 0.0.15
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/README.md +110 -49
- package/dist/box.generated.d.ts +164 -0
- package/dist/box.generated.d.ts.map +1 -0
- package/dist/box.generated.js +24 -0
- package/dist/calendar.generated.d.ts +1036 -0
- package/dist/calendar.generated.d.ts.map +1 -0
- package/dist/calendar.generated.js +42 -0
- package/dist/cli/build.js +7 -6
- package/dist/cli/emit-manifest.d.ts.map +1 -1
- package/dist/cli/emit-manifest.js +1 -4
- package/dist/confluence.generated.d.ts +98 -0
- package/dist/confluence.generated.d.ts.map +1 -0
- package/dist/confluence.generated.js +18 -0
- package/dist/connection-actions.d.ts +2 -0
- package/dist/connection-actions.d.ts.map +1 -0
- package/dist/connection-actions.js +0 -0
- package/dist/connection-trigger-definitions.generated.d.ts +34 -0
- package/dist/connection-trigger-definitions.generated.d.ts.map +1 -0
- package/dist/connection-trigger-definitions.generated.js +45 -0
- package/dist/connections.d.ts +15 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +79 -0
- package/dist/connections.test.d.ts +2 -0
- package/dist/connections.test.d.ts.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -0
- package/dist/context.test.d.ts +2 -0
- package/dist/context.test.d.ts.map +1 -0
- package/dist/cursor.generated.d.ts +154 -0
- package/dist/cursor.generated.d.ts.map +1 -0
- package/dist/cursor.generated.js +18 -0
- package/dist/custom-block.d.ts +1 -1
- package/dist/custom-block.d.ts.map +1 -1
- package/dist/custom-block.js +3 -3
- package/dist/discord.generated.d.ts +279 -0
- package/dist/discord.generated.d.ts.map +1 -0
- package/dist/discord.generated.js +33 -0
- package/dist/gmail.generated.d.ts +184 -0
- package/dist/gmail.generated.d.ts.map +1 -0
- package/dist/gmail.generated.js +21 -0
- package/dist/googleCalendar.generated.d.ts +83 -0
- package/dist/googleCalendar.generated.d.ts.map +1 -0
- package/dist/googleCalendar.generated.js +15 -0
- package/dist/googleDrive.generated.d.ts +210 -0
- package/dist/googleDrive.generated.d.ts.map +1 -0
- package/dist/googleDrive.generated.js +27 -0
- package/dist/googleDriveOauth.generated.d.ts +851 -0
- package/dist/googleDriveOauth.generated.d.ts.map +1 -0
- package/dist/googleDriveOauth.generated.js +84 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/outlook.generated.d.ts +224 -0
- package/dist/outlook.generated.d.ts.map +1 -0
- package/dist/outlook.generated.js +24 -0
- package/dist/providers.generated.d.ts +117 -0
- package/dist/providers.generated.d.ts.map +1 -0
- package/dist/providers.generated.js +108 -0
- package/dist/salesforce.generated.d.ts +151 -0
- package/dist/salesforce.generated.d.ts.map +1 -0
- package/dist/salesforce.generated.js +24 -0
- package/dist/slack.generated.d.ts +290 -0
- package/dist/slack.generated.d.ts.map +1 -0
- package/dist/slack.generated.js +30 -0
- package/dist/sync.d.ts +2 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +3 -3
- package/dist/triggers.generated.d.ts +107 -32
- package/dist/triggers.generated.d.ts.map +1 -1
- package/dist/triggers.generated.js +36 -24
- package/dist/workflow-connections-types.test.d.ts +2 -0
- package/dist/workflow-connections-types.test.d.ts.map +1 -0
- package/dist/workflow-types.test.d.ts +2 -0
- package/dist/workflow-types.test.d.ts.map +1 -0
- package/dist/workflow.d.ts +24 -20
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +16 -19
- package/docs/BUILD.md +83 -14
- package/docs/CONNECTIONS.md +130 -0
- package/package.json +5 -1
- package/src/box.generated.ts +187 -0
- package/src/calendar.generated.ts +1117 -0
- package/src/cli/build.test.ts +35 -4
- package/src/cli/build.ts +6 -5
- package/src/cli/emit-manifest.ts +1 -5
- package/src/confluence.generated.ts +109 -0
- package/src/connection-actions.ts +2 -0
- package/src/connection-trigger-definitions.generated.ts +48 -0
- package/src/connections.test.ts +157 -0
- package/src/connections.ts +126 -0
- package/src/context.test.ts +26 -0
- package/src/context.ts +8 -0
- package/src/cursor.generated.ts +167 -0
- package/src/custom-block.test.ts +4 -4
- package/src/custom-block.ts +2 -2
- package/src/discord.generated.ts +318 -0
- package/src/gmail.generated.ts +205 -0
- package/src/googleCalendar.generated.ts +95 -0
- package/src/googleDrive.generated.ts +235 -0
- package/src/googleDriveOauth.generated.ts +980 -0
- package/src/index.ts +7 -0
- package/src/outlook.generated.ts +249 -0
- package/src/providers.generated.ts +207 -0
- package/src/salesforce.generated.ts +170 -0
- package/src/slack.generated.ts +330 -0
- package/src/sync.ts +2 -2
- package/src/triggers.generated.ts +112 -32
- package/src/workflow-connections-types.test.ts +59 -0
- package/src/workflow-types.test.ts +144 -0
- package/src/workflow.test.ts +135 -25
- package/src/workflow.ts +63 -34
|
@@ -1,20 +1,29 @@
|
|
|
1
|
+
import type { WorkflowConnection, WorkflowConnectionKeys } from "./connections.js";
|
|
1
2
|
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
3
|
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
|
-
/**
|
|
4
|
-
export type SlackMessageTrigger = {
|
|
4
|
+
/** Triggers immediately after a new message is posted in Slack (includes new threads and replies) */
|
|
5
|
+
export type SlackMessageTrigger<TKey extends string = string> = {
|
|
5
6
|
type: "slack.message";
|
|
7
|
+
/** Key of the declared slack connection. */
|
|
8
|
+
connectionKey?: TKey;
|
|
6
9
|
};
|
|
7
|
-
/**
|
|
8
|
-
export type SlackReactionAddedTrigger = {
|
|
10
|
+
/** Triggers immediately after a reaction is added to a message in Slack */
|
|
11
|
+
export type SlackReactionAddedTrigger<TKey extends string = string> = {
|
|
9
12
|
type: "slack.reaction.added";
|
|
13
|
+
/** Key of the declared slack connection. */
|
|
14
|
+
connectionKey?: TKey;
|
|
10
15
|
};
|
|
11
|
-
/**
|
|
12
|
-
export type SlackAppMentionTrigger = {
|
|
16
|
+
/** Triggers when the agent is mentioned in a Slack channel or direct message */
|
|
17
|
+
export type SlackAppMentionTrigger<TKey extends string = string> = {
|
|
13
18
|
type: "slack.app.mention";
|
|
19
|
+
/** Key of the declared slack connection. */
|
|
20
|
+
connectionKey?: TKey;
|
|
14
21
|
};
|
|
15
|
-
/**
|
|
16
|
-
export type DiscordInteractionTrigger = {
|
|
22
|
+
/** Triggers when a user invokes the /ai slash command in a configured Discord channel */
|
|
23
|
+
export type DiscordInteractionTrigger<TKey extends string = string> = {
|
|
17
24
|
type: "discord.interaction";
|
|
25
|
+
/** Key of the declared discord connection. */
|
|
26
|
+
connectionKey?: TKey;
|
|
18
27
|
};
|
|
19
28
|
/** An email was received. */
|
|
20
29
|
export type MailEmailReceivedTrigger = {
|
|
@@ -28,17 +37,23 @@ export type MailEmailSentTrigger = {
|
|
|
28
37
|
export type MailLabelAppliedTrigger = {
|
|
29
38
|
type: "mail.label.applied";
|
|
30
39
|
};
|
|
31
|
-
/**
|
|
32
|
-
export type CalendarEventCreatedTrigger = {
|
|
40
|
+
/** Triggers immediately when a calendar event is created */
|
|
41
|
+
export type CalendarEventCreatedTrigger<TKey extends string = string> = {
|
|
33
42
|
type: "calendar.event.created";
|
|
43
|
+
/** Key of the declared calendar connection. */
|
|
44
|
+
connectionKey?: TKey;
|
|
34
45
|
};
|
|
35
|
-
/**
|
|
36
|
-
export type CalendarEventUpdatedTrigger = {
|
|
46
|
+
/** Triggers immediately when a calendar event is updated */
|
|
47
|
+
export type CalendarEventUpdatedTrigger<TKey extends string = string> = {
|
|
37
48
|
type: "calendar.event.updated";
|
|
49
|
+
/** Key of the declared calendar connection. */
|
|
50
|
+
connectionKey?: TKey;
|
|
38
51
|
};
|
|
39
|
-
/**
|
|
40
|
-
export type CalendarEventCanceledTrigger = {
|
|
52
|
+
/** Triggers immediately when a calendar event is canceled */
|
|
53
|
+
export type CalendarEventCanceledTrigger<TKey extends string = string> = {
|
|
41
54
|
type: "calendar.event.canceled";
|
|
55
|
+
/** Key of the declared calendar connection. */
|
|
56
|
+
connectionKey?: TKey;
|
|
42
57
|
};
|
|
43
58
|
/** A page has been added to a database. */
|
|
44
59
|
export type NotionPageCreatedTrigger = {
|
|
@@ -76,9 +91,11 @@ export type NotionDatabaseAgentUpdatedTrigger = {
|
|
|
76
91
|
export type WebhookTrigger = {
|
|
77
92
|
type: "webhooks.webhook";
|
|
78
93
|
};
|
|
79
|
-
/**
|
|
80
|
-
export type GoogleDriveOauthFilesChangedTrigger = {
|
|
94
|
+
/** Watches for file changes in a specific Google Drive folder (direct children only) or shared drive. The My Drive root is not supported. Fires on a schedule and provides change tokens for fetching the list of changes. */
|
|
95
|
+
export type GoogleDriveOauthFilesChangedTrigger<TKey extends string = string> = {
|
|
81
96
|
type: "googleDriveOauth.filesChanged";
|
|
97
|
+
/** Key of the declared googleDriveOauth connection. */
|
|
98
|
+
connectionKey?: TKey;
|
|
82
99
|
};
|
|
83
100
|
/** A recurring schedule fired. */
|
|
84
101
|
export type RecurrenceTrigger = {
|
|
@@ -89,27 +106,35 @@ export declare const triggers: {
|
|
|
89
106
|
/**
|
|
90
107
|
* Declare that a workflow can run on `slack.message` events.
|
|
91
108
|
*
|
|
92
|
-
*
|
|
109
|
+
* Triggers immediately after a new message is posted in Slack (includes new threads and replies)
|
|
93
110
|
*/
|
|
94
|
-
readonly slackMessage: (
|
|
111
|
+
readonly slackMessage: <const TKey extends string = never>(options?: {
|
|
112
|
+
connectionKey: TKey;
|
|
113
|
+
} | undefined) => SlackMessageTrigger<TKey>;
|
|
95
114
|
/**
|
|
96
115
|
* Declare that a workflow can run on `slack.reaction.added` events.
|
|
97
116
|
*
|
|
98
|
-
*
|
|
117
|
+
* Triggers immediately after a reaction is added to a message in Slack
|
|
99
118
|
*/
|
|
100
|
-
readonly slackReactionAdded: (
|
|
119
|
+
readonly slackReactionAdded: <const TKey extends string = never>(options?: {
|
|
120
|
+
connectionKey: TKey;
|
|
121
|
+
} | undefined) => SlackReactionAddedTrigger<TKey>;
|
|
101
122
|
/**
|
|
102
123
|
* Declare that a workflow can run on `slack.app.mention` events.
|
|
103
124
|
*
|
|
104
|
-
*
|
|
125
|
+
* Triggers when the agent is mentioned in a Slack channel or direct message
|
|
105
126
|
*/
|
|
106
|
-
readonly slackAppMention: (
|
|
127
|
+
readonly slackAppMention: <const TKey extends string = never>(options?: {
|
|
128
|
+
connectionKey: TKey;
|
|
129
|
+
} | undefined) => SlackAppMentionTrigger<TKey>;
|
|
107
130
|
/**
|
|
108
131
|
* Declare that a workflow can run on `discord.interaction` events.
|
|
109
132
|
*
|
|
110
|
-
*
|
|
133
|
+
* Triggers when a user invokes the /ai slash command in a configured Discord channel
|
|
111
134
|
*/
|
|
112
|
-
readonly discordInteraction: (
|
|
135
|
+
readonly discordInteraction: <const TKey extends string = never>(options?: {
|
|
136
|
+
connectionKey: TKey;
|
|
137
|
+
} | undefined) => DiscordInteractionTrigger<TKey>;
|
|
113
138
|
/**
|
|
114
139
|
* Declare that a workflow can run on `mail.email.received` events.
|
|
115
140
|
*
|
|
@@ -131,21 +156,27 @@ export declare const triggers: {
|
|
|
131
156
|
/**
|
|
132
157
|
* Declare that a workflow can run on `calendar.event.created` events.
|
|
133
158
|
*
|
|
134
|
-
*
|
|
159
|
+
* Triggers immediately when a calendar event is created
|
|
135
160
|
*/
|
|
136
|
-
readonly calendarEventCreated: (
|
|
161
|
+
readonly calendarEventCreated: <const TKey extends string = never>(options?: {
|
|
162
|
+
connectionKey: TKey;
|
|
163
|
+
} | undefined) => CalendarEventCreatedTrigger<TKey>;
|
|
137
164
|
/**
|
|
138
165
|
* Declare that a workflow can run on `calendar.event.updated` events.
|
|
139
166
|
*
|
|
140
|
-
*
|
|
167
|
+
* Triggers immediately when a calendar event is updated
|
|
141
168
|
*/
|
|
142
|
-
readonly calendarEventUpdated: (
|
|
169
|
+
readonly calendarEventUpdated: <const TKey extends string = never>(options?: {
|
|
170
|
+
connectionKey: TKey;
|
|
171
|
+
} | undefined) => CalendarEventUpdatedTrigger<TKey>;
|
|
143
172
|
/**
|
|
144
173
|
* Declare that a workflow can run on `calendar.event.canceled` events.
|
|
145
174
|
*
|
|
146
|
-
*
|
|
175
|
+
* Triggers immediately when a calendar event is canceled
|
|
147
176
|
*/
|
|
148
|
-
readonly calendarEventCanceled: (
|
|
177
|
+
readonly calendarEventCanceled: <const TKey extends string = never>(options?: {
|
|
178
|
+
connectionKey: TKey;
|
|
179
|
+
} | undefined) => CalendarEventCanceledTrigger<TKey>;
|
|
149
180
|
/**
|
|
150
181
|
* Declare that a workflow can run on `notion.page.created` events.
|
|
151
182
|
*
|
|
@@ -203,9 +234,11 @@ export declare const triggers: {
|
|
|
203
234
|
/**
|
|
204
235
|
* Declare that a workflow can run on `googleDriveOauth.filesChanged` events.
|
|
205
236
|
*
|
|
206
|
-
*
|
|
237
|
+
* Watches for file changes in a specific Google Drive folder (direct children only) or shared drive. The My Drive root is not supported. Fires on a schedule and provides change tokens for fetching the list of changes.
|
|
207
238
|
*/
|
|
208
|
-
readonly googleDriveOauthFilesChanged: (
|
|
239
|
+
readonly googleDriveOauthFilesChanged: <const TKey extends string = never>(options?: {
|
|
240
|
+
connectionKey: TKey;
|
|
241
|
+
} | undefined) => GoogleDriveOauthFilesChangedTrigger<TKey>;
|
|
209
242
|
/**
|
|
210
243
|
* Declare that a workflow can run on `recurrence` events.
|
|
211
244
|
*
|
|
@@ -213,6 +246,48 @@ export declare const triggers: {
|
|
|
213
246
|
*/
|
|
214
247
|
readonly scheduled: () => RecurrenceTrigger;
|
|
215
248
|
};
|
|
249
|
+
/** Trigger creators restricted to the workflow's declared provider keys. */
|
|
250
|
+
export type WorkflowTriggerCreators<TConnections extends readonly WorkflowConnection[]> = {
|
|
251
|
+
slackMessage(options?: {
|
|
252
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "slack">;
|
|
253
|
+
}): SlackMessageTrigger<WorkflowConnectionKeys<TConnections, "slack">>;
|
|
254
|
+
slackReactionAdded(options?: {
|
|
255
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "slack">;
|
|
256
|
+
}): SlackReactionAddedTrigger<WorkflowConnectionKeys<TConnections, "slack">>;
|
|
257
|
+
slackAppMention(options?: {
|
|
258
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "slack">;
|
|
259
|
+
}): SlackAppMentionTrigger<WorkflowConnectionKeys<TConnections, "slack">>;
|
|
260
|
+
discordInteraction(options?: {
|
|
261
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "discord">;
|
|
262
|
+
}): DiscordInteractionTrigger<WorkflowConnectionKeys<TConnections, "discord">>;
|
|
263
|
+
mailEmailReceived(): MailEmailReceivedTrigger;
|
|
264
|
+
mailEmailSent(): MailEmailSentTrigger;
|
|
265
|
+
mailLabelApplied(): MailLabelAppliedTrigger;
|
|
266
|
+
calendarEventCreated(options?: {
|
|
267
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "calendar">;
|
|
268
|
+
}): CalendarEventCreatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">>;
|
|
269
|
+
calendarEventUpdated(options?: {
|
|
270
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "calendar">;
|
|
271
|
+
}): CalendarEventUpdatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">>;
|
|
272
|
+
calendarEventCanceled(options?: {
|
|
273
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "calendar">;
|
|
274
|
+
}): CalendarEventCanceledTrigger<WorkflowConnectionKeys<TConnections, "calendar">>;
|
|
275
|
+
notionPageCreated(): NotionPageCreatedTrigger;
|
|
276
|
+
notionPageUpdated(): NotionPageUpdatedTrigger;
|
|
277
|
+
notionPageDeleted(): NotionPageDeletedTrigger;
|
|
278
|
+
notionMeetingNoteSummaryCompleted(): NotionMeetingNoteSummaryCompletedTrigger;
|
|
279
|
+
notionCommentAdded(): NotionCommentAddedTrigger;
|
|
280
|
+
notionAgentMentioned(): NotionAgentMentionedTrigger;
|
|
281
|
+
notionButtonPressed(): NotionButtonPressedTrigger;
|
|
282
|
+
notionDatabaseAgentUpdated(): NotionDatabaseAgentUpdatedTrigger;
|
|
283
|
+
webhook(): WebhookTrigger;
|
|
284
|
+
googleDriveOauthFilesChanged(options?: {
|
|
285
|
+
connectionKey: WorkflowConnectionKeys<TConnections, "googleDriveOauth">;
|
|
286
|
+
}): GoogleDriveOauthFilesChangedTrigger<WorkflowConnectionKeys<TConnections, "googleDriveOauth">>;
|
|
287
|
+
scheduled(): RecurrenceTrigger;
|
|
288
|
+
};
|
|
289
|
+
/** Triggers whose connection keys belong to the declared provider. */
|
|
290
|
+
export type WorkflowTriggerForConnections<TConnections extends readonly WorkflowConnection[]> = SlackMessageTrigger<WorkflowConnectionKeys<TConnections, "slack">> | SlackReactionAddedTrigger<WorkflowConnectionKeys<TConnections, "slack">> | SlackAppMentionTrigger<WorkflowConnectionKeys<TConnections, "slack">> | DiscordInteractionTrigger<WorkflowConnectionKeys<TConnections, "discord">> | MailEmailReceivedTrigger | MailEmailSentTrigger | MailLabelAppliedTrigger | CalendarEventCreatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | CalendarEventUpdatedTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | CalendarEventCanceledTrigger<WorkflowConnectionKeys<TConnections, "calendar">> | NotionPageCreatedTrigger | NotionPageUpdatedTrigger | NotionPageDeletedTrigger | NotionMeetingNoteSummaryCompletedTrigger | NotionCommentAddedTrigger | NotionAgentMentionedTrigger | NotionButtonPressedTrigger | NotionDatabaseAgentUpdatedTrigger | WebhookTrigger | GoogleDriveOauthFilesChangedTrigger<WorkflowConnectionKeys<TConnections, "googleDriveOauth">> | RecurrenceTrigger;
|
|
216
291
|
/** Event that can trigger a workflow. */
|
|
217
292
|
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
293
|
/** All workflow trigger type strings. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggers.generated.d.ts","sourceRoot":"","sources":["../src/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,+BAA+B,EAC/B,sCAAsC,EACtC,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,UAAU,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,
|
|
1
|
+
{"version":3,"file":"triggers.generated.d.ts","sourceRoot":"","sources":["../src/triggers.generated.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,KAAK,EACX,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,EACl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,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"}
|
|
@@ -2,41 +2,45 @@ const triggers = {
|
|
|
2
2
|
/**
|
|
3
3
|
* Declare that a workflow can run on `slack.message` events.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Triggers immediately after a new message is posted in Slack (includes new threads and replies)
|
|
6
6
|
*/
|
|
7
|
-
slackMessage() {
|
|
7
|
+
slackMessage(options = void 0) {
|
|
8
8
|
return {
|
|
9
|
-
type: "slack.message"
|
|
9
|
+
type: "slack.message",
|
|
10
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
10
11
|
};
|
|
11
12
|
},
|
|
12
13
|
/**
|
|
13
14
|
* Declare that a workflow can run on `slack.reaction.added` events.
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
+
* Triggers immediately after a reaction is added to a message in Slack
|
|
16
17
|
*/
|
|
17
|
-
slackReactionAdded() {
|
|
18
|
+
slackReactionAdded(options = void 0) {
|
|
18
19
|
return {
|
|
19
|
-
type: "slack.reaction.added"
|
|
20
|
+
type: "slack.reaction.added",
|
|
21
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
20
22
|
};
|
|
21
23
|
},
|
|
22
24
|
/**
|
|
23
25
|
* Declare that a workflow can run on `slack.app.mention` events.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
27
|
+
* Triggers when the agent is mentioned in a Slack channel or direct message
|
|
26
28
|
*/
|
|
27
|
-
slackAppMention() {
|
|
29
|
+
slackAppMention(options = void 0) {
|
|
28
30
|
return {
|
|
29
|
-
type: "slack.app.mention"
|
|
31
|
+
type: "slack.app.mention",
|
|
32
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
30
33
|
};
|
|
31
34
|
},
|
|
32
35
|
/**
|
|
33
36
|
* Declare that a workflow can run on `discord.interaction` events.
|
|
34
37
|
*
|
|
35
|
-
*
|
|
38
|
+
* Triggers when a user invokes the /ai slash command in a configured Discord channel
|
|
36
39
|
*/
|
|
37
|
-
discordInteraction() {
|
|
40
|
+
discordInteraction(options = void 0) {
|
|
38
41
|
return {
|
|
39
|
-
type: "discord.interaction"
|
|
42
|
+
type: "discord.interaction",
|
|
43
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
40
44
|
};
|
|
41
45
|
},
|
|
42
46
|
/**
|
|
@@ -72,31 +76,34 @@ const triggers = {
|
|
|
72
76
|
/**
|
|
73
77
|
* Declare that a workflow can run on `calendar.event.created` events.
|
|
74
78
|
*
|
|
75
|
-
*
|
|
79
|
+
* Triggers immediately when a calendar event is created
|
|
76
80
|
*/
|
|
77
|
-
calendarEventCreated() {
|
|
81
|
+
calendarEventCreated(options = void 0) {
|
|
78
82
|
return {
|
|
79
|
-
type: "calendar.event.created"
|
|
83
|
+
type: "calendar.event.created",
|
|
84
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
80
85
|
};
|
|
81
86
|
},
|
|
82
87
|
/**
|
|
83
88
|
* Declare that a workflow can run on `calendar.event.updated` events.
|
|
84
89
|
*
|
|
85
|
-
*
|
|
90
|
+
* Triggers immediately when a calendar event is updated
|
|
86
91
|
*/
|
|
87
|
-
calendarEventUpdated() {
|
|
92
|
+
calendarEventUpdated(options = void 0) {
|
|
88
93
|
return {
|
|
89
|
-
type: "calendar.event.updated"
|
|
94
|
+
type: "calendar.event.updated",
|
|
95
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
90
96
|
};
|
|
91
97
|
},
|
|
92
98
|
/**
|
|
93
99
|
* Declare that a workflow can run on `calendar.event.canceled` events.
|
|
94
100
|
*
|
|
95
|
-
*
|
|
101
|
+
* Triggers immediately when a calendar event is canceled
|
|
96
102
|
*/
|
|
97
|
-
calendarEventCanceled() {
|
|
103
|
+
calendarEventCanceled(options = void 0) {
|
|
98
104
|
return {
|
|
99
|
-
type: "calendar.event.canceled"
|
|
105
|
+
type: "calendar.event.canceled",
|
|
106
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
100
107
|
};
|
|
101
108
|
},
|
|
102
109
|
/**
|
|
@@ -192,11 +199,12 @@ const triggers = {
|
|
|
192
199
|
/**
|
|
193
200
|
* Declare that a workflow can run on `googleDriveOauth.filesChanged` events.
|
|
194
201
|
*
|
|
195
|
-
*
|
|
202
|
+
* Watches for file changes in a specific Google Drive folder (direct children only) or shared drive. The My Drive root is not supported. Fires on a schedule and provides change tokens for fetching the list of changes.
|
|
196
203
|
*/
|
|
197
|
-
googleDriveOauthFilesChanged() {
|
|
204
|
+
googleDriveOauthFilesChanged(options = void 0) {
|
|
198
205
|
return {
|
|
199
|
-
type: "googleDriveOauth.filesChanged"
|
|
206
|
+
type: "googleDriveOauth.filesChanged",
|
|
207
|
+
...options === void 0 ? {} : { connectionKey: options.connectionKey }
|
|
200
208
|
};
|
|
201
209
|
},
|
|
202
210
|
/**
|
|
@@ -210,6 +218,9 @@ const triggers = {
|
|
|
210
218
|
};
|
|
211
219
|
}
|
|
212
220
|
};
|
|
221
|
+
function createWorkflowTriggers() {
|
|
222
|
+
return triggers;
|
|
223
|
+
}
|
|
213
224
|
const WORKFLOW_TRIGGER_TYPES = [
|
|
214
225
|
"slack.message",
|
|
215
226
|
"slack.reaction.added",
|
|
@@ -235,5 +246,6 @@ const WORKFLOW_TRIGGER_TYPES = [
|
|
|
235
246
|
];
|
|
236
247
|
export {
|
|
237
248
|
WORKFLOW_TRIGGER_TYPES,
|
|
249
|
+
createWorkflowTriggers,
|
|
238
250
|
triggers
|
|
239
251
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-connections-types.test.d.ts","sourceRoot":"","sources":["../src/workflow-connections-types.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-types.test.d.ts","sourceRoot":"","sources":["../src/workflow-types.test.ts"],"names":[],"mappings":""}
|
package/dist/workflow.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type WorkflowConnection, type WorkflowConnections } from "./connections.js";
|
|
1
2
|
import type { CapabilityContext } from "./context.js";
|
|
2
3
|
import { type RunMetadata } from "./runtime-metadata.js";
|
|
3
|
-
import type { WorkflowEventMap, WorkflowTrigger } from "./triggers.generated.js";
|
|
4
|
+
import type { WorkflowEventMap, WorkflowTrigger, WorkflowTriggerCreators, WorkflowTriggerForConnections } from "./triggers.generated.js";
|
|
4
5
|
type HandlerOptions = {
|
|
5
6
|
/** Return the concrete result instead of writing the output envelope. */
|
|
6
7
|
concreteOutput?: true;
|
|
@@ -8,19 +9,11 @@ type HandlerOptions = {
|
|
|
8
9
|
export type WorkflowEvent = WorkflowEventMap[keyof WorkflowEventMap];
|
|
9
10
|
export type WorkflowEventForTrigger<T extends WorkflowTrigger> = WorkflowEventMap[T["type"]];
|
|
10
11
|
export type WorkflowEventForTriggers<T extends readonly WorkflowTrigger[]> = WorkflowEventForTrigger<T[number]>;
|
|
11
|
-
|
|
12
|
-
export type WorkflowConnection = {
|
|
13
|
-
type: "calendar";
|
|
14
|
-
};
|
|
15
|
-
/** Connection requirements supported by workflow capabilities. */
|
|
16
|
-
export declare const connections: {
|
|
17
|
-
/** Require an authorized Calendar connection. */
|
|
18
|
-
calendar(): WorkflowConnection;
|
|
19
|
-
};
|
|
12
|
+
export { connections, type WorkflowConnection, type WorkflowConnections } from "./connections.js";
|
|
20
13
|
/**
|
|
21
|
-
* Configuration passed to {@link
|
|
14
|
+
* Configuration passed to {@link workflow}.
|
|
22
15
|
*/
|
|
23
|
-
export type WorkflowConfiguration<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]]> = {
|
|
16
|
+
export type WorkflowConfiguration<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], TConnections extends readonly WorkflowConnection[] = readonly WorkflowConnection[]> = {
|
|
24
17
|
/**
|
|
25
18
|
* A human-readable name for the workflow, shown in the UI when viewing workflows
|
|
26
19
|
*/
|
|
@@ -38,11 +31,17 @@ export type WorkflowConfiguration<TTriggers extends readonly [WorkflowTrigger, .
|
|
|
38
31
|
/**
|
|
39
32
|
* Connections that must be set up before this workflow can run.
|
|
40
33
|
*/
|
|
41
|
-
connections?:
|
|
42
|
-
handler: (event: WorkflowEventForTriggers<TTriggers>, context: WorkflowContext) => Promise<void> | void;
|
|
34
|
+
connections?: TConnections;
|
|
35
|
+
handler: (event: WorkflowEventForTriggers<TTriggers>, context: WorkflowContext<TConnections>) => Promise<void> | void;
|
|
36
|
+
};
|
|
37
|
+
/** Configuration that checks trigger keys against declared connections. */
|
|
38
|
+
export type WorkflowTriggerConfiguration<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], TConnections extends readonly WorkflowConnection[]> = Omit<WorkflowConfiguration<TTriggers, TConnections>, "triggers"> & {
|
|
39
|
+
triggers: (context: {
|
|
40
|
+
triggers: WorkflowTriggerCreators<NoInfer<TConnections>>;
|
|
41
|
+
}) => TTriggers;
|
|
43
42
|
};
|
|
44
43
|
/**
|
|
45
|
-
* A workflow capability as returned by {@link
|
|
44
|
+
* A workflow capability as returned by {@link workflow}.
|
|
46
45
|
*
|
|
47
46
|
* Note that a workflow carries no key of its own — the build tool derives
|
|
48
47
|
* the capability key from the file the workflow is default-exported from.
|
|
@@ -72,9 +71,9 @@ export type Workflow<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTri
|
|
|
72
71
|
* ```ts
|
|
73
72
|
* // src/workflows/onPageCreated.ts
|
|
74
73
|
* import { triggers } from "@notionhq/apps/triggers";
|
|
75
|
-
* import {
|
|
74
|
+
* import { workflow } from "@notionhq/apps/workflow";
|
|
76
75
|
*
|
|
77
|
-
* export default
|
|
76
|
+
* export default workflow({
|
|
78
77
|
* name: "Send Welcome Email",
|
|
79
78
|
* description: "Sends a welcome email when a new page is added",
|
|
80
79
|
* triggers: [triggers.notionPageCreated()],
|
|
@@ -88,7 +87,11 @@ export type Workflow<TTriggers extends readonly [WorkflowTrigger, ...WorkflowTri
|
|
|
88
87
|
* });
|
|
89
88
|
* ```
|
|
90
89
|
*/
|
|
91
|
-
export declare function
|
|
90
|
+
export declare function workflow<const TTriggers extends readonly [
|
|
91
|
+
WorkflowTriggerForConnections<NoInfer<TConnections>>,
|
|
92
|
+
...WorkflowTriggerForConnections<NoInfer<TConnections>>[]
|
|
93
|
+
], const TConnections extends readonly WorkflowConnection[] = readonly []>(configuration: WorkflowTriggerConfiguration<TTriggers, TConnections>): Workflow<TTriggers>;
|
|
94
|
+
export declare function workflow<const TTriggers extends readonly [WorkflowTrigger, ...WorkflowTrigger[]], const TConnections extends readonly WorkflowConnection[] = readonly []>(configuration: WorkflowConfiguration<TTriggers, TConnections>): Workflow<TTriggers>;
|
|
92
95
|
/** Context passed to a workflow step. */
|
|
93
96
|
export type StepContext = {
|
|
94
97
|
/**
|
|
@@ -112,7 +115,9 @@ type WorkflowStep = {
|
|
|
112
115
|
<T>(name: string, options: WorkflowStepOptions, fn: (context: StepContext) => T | Promise<T>): Promise<WorkflowStepResult<T>>;
|
|
113
116
|
};
|
|
114
117
|
/** Context passed to a workflow handler. */
|
|
115
|
-
export type WorkflowContext =
|
|
118
|
+
export type WorkflowContext<TConnections extends readonly WorkflowConnection[] = readonly WorkflowConnection[]> = CapabilityContext & {
|
|
119
|
+
connections: WorkflowConnections<TConnections>;
|
|
120
|
+
} & RunMetadata & {
|
|
116
121
|
/**
|
|
117
122
|
* Run an observable unit of work within the workflow.
|
|
118
123
|
*
|
|
@@ -135,5 +140,4 @@ export type WorkflowContext = CapabilityContext & RunMetadata & {
|
|
|
135
140
|
*/
|
|
136
141
|
step: WorkflowStep;
|
|
137
142
|
};
|
|
138
|
-
export {};
|
|
139
143
|
//# sourceMappingURL=workflow.d.ts.map
|
package/dist/workflow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKtD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE1E,OAAO,KAAK,EACX,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,6BAA6B,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,KAAK,cAAc,GAAG;IACrB,yEAAyE;IACzE,cAAc,CAAC,EAAE,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,gBAAgB,CAAC,CAAC;AAErE,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,eAAe,IAAI,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7F,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,SAAS,eAAe,EAAE,IACxE,uBAAuB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,E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EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC,EACD,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC1C,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF,4CAA4C;AAC5C,MAAM,MAAM,eAAe,CAC1B,YAAY,SAAS,SAAS,kBAAkB,EAAE,GAAG,SAAS,kBAAkB,EAAE,IAC/E,iBAAiB,GAAG;IACvB,WAAW,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAC/C,GAAG,WAAW,GAAG;IAChB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC"}
|
package/dist/workflow.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createWorkflowConnections,
|
|
3
|
+
validateConnectionRequirements,
|
|
4
|
+
validateTriggerConnections
|
|
5
|
+
} from "./connections.js";
|
|
1
6
|
import { createHash } from "node:crypto";
|
|
2
7
|
import { readFile } from "node:fs/promises";
|
|
3
8
|
import { join } from "node:path";
|
|
@@ -6,36 +11,28 @@ import { ExecutionError } from "./error.js";
|
|
|
6
11
|
import { writeOutput } from "./output.js";
|
|
7
12
|
import { resolveRuntimeInput } from "./runtime-input.js";
|
|
8
13
|
import { readRunMetadata } from "./runtime-metadata.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function createWorkflow(configuration) {
|
|
16
|
-
if (configuration.connections !== void 0) {
|
|
17
|
-
const connectionTypes = /* @__PURE__ */ new Set();
|
|
18
|
-
for (const connection of configuration.connections) {
|
|
19
|
-
if (connectionTypes.has(connection.type)) {
|
|
20
|
-
throw new Error(`Duplicate workflow connection: ${connection.type}`);
|
|
21
|
-
}
|
|
22
|
-
connectionTypes.add(connection.type);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
14
|
+
import { createWorkflowTriggers } from "./triggers.generated.js";
|
|
15
|
+
import { connections } from "./connections.js";
|
|
16
|
+
function workflow(configuration) {
|
|
17
|
+
const triggers = typeof configuration.triggers === "function" ? configuration.triggers({ triggers: createWorkflowTriggers() }) : configuration.triggers;
|
|
18
|
+
validateConnectionRequirements(configuration.connections ?? []);
|
|
19
|
+
validateTriggerConnections(triggers, configuration.connections ?? []);
|
|
25
20
|
return {
|
|
26
21
|
_tag: "workflow",
|
|
27
22
|
config: {
|
|
28
23
|
name: configuration.name,
|
|
29
24
|
description: configuration.description,
|
|
30
|
-
triggers
|
|
25
|
+
triggers,
|
|
31
26
|
...configuration.connections === void 0 ? {} : { connections: configuration.connections }
|
|
32
27
|
},
|
|
33
28
|
async handler(event, options) {
|
|
34
29
|
try {
|
|
35
30
|
event = await resolveRuntimeInput(event);
|
|
36
31
|
const runMetadata = readRunMetadata();
|
|
32
|
+
const baseContext = createCapabilityContext();
|
|
37
33
|
const capabilityContext = {
|
|
38
|
-
...
|
|
34
|
+
...baseContext,
|
|
35
|
+
connections: createWorkflowConnections(baseContext.notion),
|
|
39
36
|
...runMetadata,
|
|
40
37
|
step: createStep(runMetadata)
|
|
41
38
|
};
|
|
@@ -225,5 +222,5 @@ function isNodeError(error) {
|
|
|
225
222
|
}
|
|
226
223
|
export {
|
|
227
224
|
connections,
|
|
228
|
-
|
|
225
|
+
workflow
|
|
229
226
|
};
|