@notionhq/apps 0.0.12 → 0.0.14
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 +32 -0
- 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.d.ts.map +1 -1
- package/dist/cli/build.js +41 -10
- package/dist/cli/codegen.d.ts +2 -0
- package/dist/cli/codegen.d.ts.map +1 -1
- package/dist/cli/codegen.js +13 -2
- package/dist/cli/discover.d.ts +2 -0
- package/dist/cli/discover.d.ts.map +1 -1
- package/dist/cli/discover.js +4 -2
- package/dist/cli/emit-manifest.d.ts +3 -1
- package/dist/cli/emit-manifest.d.ts.map +1 -1
- package/dist/cli/emit-manifest.js +10 -4
- package/dist/cli/index.js +33 -1
- 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/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 +54 -0
- package/dist/custom-block.d.ts.map +1 -0
- package/dist/custom-block.js +30 -0
- package/dist/custom-block.test.d.ts +2 -0
- package/dist/custom-block.test.d.ts.map +1 -0
- package/dist/custom-blocks.d.ts +2 -0
- package/dist/custom-blocks.d.ts.map +1 -0
- package/dist/custom-blocks.js +1 -0
- 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/manifest.d.ts +1 -1
- package/dist/manifest.d.ts.map +1 -1
- package/dist/nds.css +1 -0
- package/dist/notion-as-code/database.d.ts +4 -3
- package/dist/notion-as-code/database.d.ts.map +1 -1
- package/dist/notion-as-code/database.js +11 -2
- package/dist/notion-as-code/intents.d.ts +4 -1
- package/dist/notion-as-code/intents.d.ts.map +1 -1
- package/dist/notion-as-code/page.d.ts +4 -4
- package/dist/notion-as-code/page.d.ts.map +1 -1
- package/dist/notion-as-code/page.js +11 -2
- 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/react.d.ts +2 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +1 -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/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 +20 -16
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +14 -17
- package/docs/BUILD.md +83 -14
- package/docs/CONNECTIONS.md +129 -0
- package/package.json +16 -2
- package/src/box.generated.ts +187 -0
- package/src/calendar.generated.ts +1117 -0
- package/src/cli/build.test.ts +87 -0
- package/src/cli/build.ts +47 -9
- package/src/cli/codegen.test.ts +2 -0
- package/src/cli/codegen.ts +25 -7
- package/src/cli/discover.test.ts +12 -0
- package/src/cli/discover.ts +6 -2
- package/src/cli/emit-manifest.ts +13 -3
- package/src/cli/index.ts +33 -1
- 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/cursor.generated.ts +167 -0
- package/src/custom-block.test.ts +19 -0
- package/src/custom-block.ts +41 -0
- package/src/custom-blocks.ts +1 -0
- 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/manifest.ts +1 -1
- package/src/nds.css +1 -0
- package/src/notion-as-code/database.ts +19 -11
- package/src/notion-as-code/intents.ts +2 -1
- package/src/notion-as-code/page.ts +17 -11
- package/src/outlook.generated.ts +249 -0
- package/src/providers.generated.ts +207 -0
- package/src/react.ts +1 -0
- package/src/salesforce.generated.ts +170 -0
- package/src/slack.generated.ts +330 -0
- 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 +112 -2
- package/src/workflow.ts +58 -29
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
// Generated by notion tool-core codegen-script-types --connections. Do not edit.
|
|
2
|
+
import type { ConnectionActionInvoker } from "./connection-actions.js"
|
|
3
|
+
/**
|
|
4
|
+
* Script input for the "Add Discord reaction" effect (`discord.addReaction`),
|
|
5
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
6
|
+
*
|
|
7
|
+
* Add a reaction to a Discord message
|
|
8
|
+
*/
|
|
9
|
+
export type AddReactionScriptInput = {
|
|
10
|
+
/**
|
|
11
|
+
* The Discord channel ID containing the message.
|
|
12
|
+
*/
|
|
13
|
+
channelId: string
|
|
14
|
+
/**
|
|
15
|
+
* The Discord message ID to react to.
|
|
16
|
+
*/
|
|
17
|
+
messageId: string
|
|
18
|
+
/**
|
|
19
|
+
* The emoji to react with. Use Unicode emoji (e.g. "👍") or custom emoji in the format "name:id" (e.g. "notionlogo:123456789").
|
|
20
|
+
*/
|
|
21
|
+
emoji: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Canonical Tool Core output for the "Add Discord reaction" effect (`discord.addReaction`).
|
|
26
|
+
* This is the definition's output schema; the effect's script surface may
|
|
27
|
+
* re-encode it before returning.
|
|
28
|
+
*/
|
|
29
|
+
export type AddReactionScriptOutput = Record<string, never>
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Script input for the "Get recent Discord channel messages" effect (`discord.getRecentChannelMessages`),
|
|
33
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
34
|
+
*
|
|
35
|
+
* Get recent messages from a Discord channel
|
|
36
|
+
*/
|
|
37
|
+
export type GetRecentChannelMessagesScriptInput = {
|
|
38
|
+
/**
|
|
39
|
+
* The Discord channel ID to read messages from.
|
|
40
|
+
*/
|
|
41
|
+
channelId: string
|
|
42
|
+
/**
|
|
43
|
+
* Number of messages to retrieve (1-50, default 25).
|
|
44
|
+
*/
|
|
45
|
+
limit?: number
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Canonical Tool Core output for the "Get recent Discord channel messages" effect (`discord.getRecentChannelMessages`).
|
|
50
|
+
* This is the definition's output schema; the effect's script surface may
|
|
51
|
+
* re-encode it before returning.
|
|
52
|
+
*/
|
|
53
|
+
export type GetRecentChannelMessagesScriptOutput = Array<{
|
|
54
|
+
/**
|
|
55
|
+
* The Discord message ID (snowflake).
|
|
56
|
+
*/
|
|
57
|
+
id: string
|
|
58
|
+
/**
|
|
59
|
+
* The Discord channel ID containing the message.
|
|
60
|
+
*/
|
|
61
|
+
channelId: string
|
|
62
|
+
/**
|
|
63
|
+
* The Discord guild (server) ID.
|
|
64
|
+
*/
|
|
65
|
+
guildId: string
|
|
66
|
+
/**
|
|
67
|
+
* The Discord markdown message content.
|
|
68
|
+
*/
|
|
69
|
+
content: string
|
|
70
|
+
/**
|
|
71
|
+
* Whether the message was sent by the bot.
|
|
72
|
+
*/
|
|
73
|
+
fromBot: boolean
|
|
74
|
+
/**
|
|
75
|
+
* The message timestamp in ISO 8601 format.
|
|
76
|
+
*/
|
|
77
|
+
timestamp: string
|
|
78
|
+
/**
|
|
79
|
+
* A user-navigable URL to the message.
|
|
80
|
+
*/
|
|
81
|
+
url: string
|
|
82
|
+
/**
|
|
83
|
+
* The channel name, when available.
|
|
84
|
+
*/
|
|
85
|
+
channelName?: string
|
|
86
|
+
}>
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Script input for the "List Discord channels" effect (`discord.listChannels`),
|
|
90
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
91
|
+
*
|
|
92
|
+
* List text channels in the Discord server
|
|
93
|
+
*/
|
|
94
|
+
export type ListChannelsScriptInput = Record<string, never>
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Canonical Tool Core output for the "List Discord channels" effect (`discord.listChannels`).
|
|
98
|
+
* This is the definition's output schema; the effect's script surface may
|
|
99
|
+
* re-encode it before returning.
|
|
100
|
+
*/
|
|
101
|
+
export type ListChannelsScriptOutput = Array<{
|
|
102
|
+
/**
|
|
103
|
+
* The Discord channel ID (snowflake).
|
|
104
|
+
*/
|
|
105
|
+
id: string
|
|
106
|
+
/**
|
|
107
|
+
* The channel name.
|
|
108
|
+
*/
|
|
109
|
+
name: string
|
|
110
|
+
/**
|
|
111
|
+
* The channel type: "text", "announcement", "forum", or "media".
|
|
112
|
+
*/
|
|
113
|
+
type: string
|
|
114
|
+
}>
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Script input for the "Remove Discord reaction" effect (`discord.removeReaction`),
|
|
118
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
119
|
+
*
|
|
120
|
+
* Remove a reaction from a Discord message
|
|
121
|
+
*/
|
|
122
|
+
export type RemoveReactionScriptInput = {
|
|
123
|
+
/**
|
|
124
|
+
* The Discord channel ID containing the message.
|
|
125
|
+
*/
|
|
126
|
+
channelId: string
|
|
127
|
+
/**
|
|
128
|
+
* The Discord message ID to remove the reaction from.
|
|
129
|
+
*/
|
|
130
|
+
messageId: string
|
|
131
|
+
/**
|
|
132
|
+
* The emoji to remove. Use Unicode emoji (e.g. "👍") or custom emoji in the format "name:id" (e.g. "notionlogo:123456789").
|
|
133
|
+
*/
|
|
134
|
+
emoji: string
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Canonical Tool Core output for the "Remove Discord reaction" effect (`discord.removeReaction`).
|
|
139
|
+
* This is the definition's output schema; the effect's script surface may
|
|
140
|
+
* re-encode it before returning.
|
|
141
|
+
*/
|
|
142
|
+
export type RemoveReactionScriptOutput = Record<string, never>
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Script input for the "Send Discord channel message" effect (`discord.sendMessageToChannel`),
|
|
146
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
147
|
+
*
|
|
148
|
+
* Send a new message to a Discord channel
|
|
149
|
+
*/
|
|
150
|
+
export type SendMessageToChannelScriptInput = {
|
|
151
|
+
/**
|
|
152
|
+
* The Discord channel ID (snowflake) to send the message to.
|
|
153
|
+
*/
|
|
154
|
+
channelId: string
|
|
155
|
+
/**
|
|
156
|
+
* ## Follow these guidelines when sending Discord messages:
|
|
157
|
+
* **Response Length:**
|
|
158
|
+
* - Keep responses to 1-2 short sentences maximum
|
|
159
|
+
* - No long paragraphs or blocks of text
|
|
160
|
+
* - Break longer content into bullets or line breaks
|
|
161
|
+
* - Every response must be instantly scannable
|
|
162
|
+
*
|
|
163
|
+
* **Tone:**
|
|
164
|
+
* - Write like a friendly human co-worker
|
|
165
|
+
* - Be concise and direct
|
|
166
|
+
*
|
|
167
|
+
* **Formatting:**
|
|
168
|
+
* - Use standard Discord markdown
|
|
169
|
+
* - Use bullets for lists
|
|
170
|
+
* - Use **bold** for emphasis
|
|
171
|
+
* - Use line breaks for clarity
|
|
172
|
+
* - Emojis allowed sparingly for clarity or tone
|
|
173
|
+
*
|
|
174
|
+
* **Links:**
|
|
175
|
+
* - Always use markdown link syntax: [link text](url)
|
|
176
|
+
* - Never use raw URLs
|
|
177
|
+
*/
|
|
178
|
+
content: string
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Canonical Tool Core output for the "Send Discord channel message" effect (`discord.sendMessageToChannel`).
|
|
183
|
+
* This is the definition's output schema; the effect's script surface may
|
|
184
|
+
* re-encode it before returning.
|
|
185
|
+
*/
|
|
186
|
+
export type SendMessageToChannelScriptOutput = {
|
|
187
|
+
/**
|
|
188
|
+
* The Discord message ID (snowflake).
|
|
189
|
+
*/
|
|
190
|
+
id: string
|
|
191
|
+
/**
|
|
192
|
+
* The Discord channel ID containing the message.
|
|
193
|
+
*/
|
|
194
|
+
channelId: string
|
|
195
|
+
/**
|
|
196
|
+
* The Discord guild (server) ID.
|
|
197
|
+
*/
|
|
198
|
+
guildId: string
|
|
199
|
+
/**
|
|
200
|
+
* The Discord markdown message content.
|
|
201
|
+
*/
|
|
202
|
+
content: string
|
|
203
|
+
/**
|
|
204
|
+
* Whether the message was sent by the bot.
|
|
205
|
+
*/
|
|
206
|
+
fromBot: boolean
|
|
207
|
+
/**
|
|
208
|
+
* The message timestamp in ISO 8601 format.
|
|
209
|
+
*/
|
|
210
|
+
timestamp: string
|
|
211
|
+
/**
|
|
212
|
+
* A user-navigable URL to the message.
|
|
213
|
+
*/
|
|
214
|
+
url: string
|
|
215
|
+
/**
|
|
216
|
+
* The channel name, when available.
|
|
217
|
+
*/
|
|
218
|
+
channelName?: string
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Script input for the "Update Discord message" effect (`discord.updateMessage`),
|
|
223
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
224
|
+
*
|
|
225
|
+
* Update an existing Discord message
|
|
226
|
+
*/
|
|
227
|
+
export type UpdateMessageScriptInput = {
|
|
228
|
+
/**
|
|
229
|
+
* The Discord channel ID containing the message.
|
|
230
|
+
*/
|
|
231
|
+
channelId: string
|
|
232
|
+
/**
|
|
233
|
+
* The Discord message ID to update.
|
|
234
|
+
*/
|
|
235
|
+
messageId: string
|
|
236
|
+
/**
|
|
237
|
+
* The new content for the message (Discord markdown).
|
|
238
|
+
*/
|
|
239
|
+
content: string
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Canonical Tool Core output for the "Update Discord message" effect (`discord.updateMessage`).
|
|
244
|
+
* This is the definition's output schema; the effect's script surface may
|
|
245
|
+
* re-encode it before returning.
|
|
246
|
+
*/
|
|
247
|
+
export type UpdateMessageScriptOutput = {
|
|
248
|
+
/**
|
|
249
|
+
* The Discord message ID (snowflake).
|
|
250
|
+
*/
|
|
251
|
+
id: string
|
|
252
|
+
/**
|
|
253
|
+
* The Discord channel ID containing the message.
|
|
254
|
+
*/
|
|
255
|
+
channelId: string
|
|
256
|
+
/**
|
|
257
|
+
* The Discord guild (server) ID.
|
|
258
|
+
*/
|
|
259
|
+
guildId: string
|
|
260
|
+
/**
|
|
261
|
+
* The Discord markdown message content.
|
|
262
|
+
*/
|
|
263
|
+
content: string
|
|
264
|
+
/**
|
|
265
|
+
* Whether the message was sent by the bot.
|
|
266
|
+
*/
|
|
267
|
+
fromBot: boolean
|
|
268
|
+
/**
|
|
269
|
+
* The message timestamp in ISO 8601 format.
|
|
270
|
+
*/
|
|
271
|
+
timestamp: string
|
|
272
|
+
/**
|
|
273
|
+
* A user-navigable URL to the message.
|
|
274
|
+
*/
|
|
275
|
+
url: string
|
|
276
|
+
/**
|
|
277
|
+
* The channel name, when available.
|
|
278
|
+
*/
|
|
279
|
+
channelName?: string
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export class DiscordConnectionClient {
|
|
283
|
+
constructor(private readonly invoke: ConnectionActionInvoker) {}
|
|
284
|
+
addReaction(args: AddReactionScriptInput): Promise<AddReactionScriptOutput> {
|
|
285
|
+
return this.invoke<AddReactionScriptOutput>("addReaction", args)
|
|
286
|
+
}
|
|
287
|
+
getRecentChannelMessages(
|
|
288
|
+
args: GetRecentChannelMessagesScriptInput,
|
|
289
|
+
): Promise<GetRecentChannelMessagesScriptOutput> {
|
|
290
|
+
return this.invoke<GetRecentChannelMessagesScriptOutput>(
|
|
291
|
+
"getRecentChannelMessages",
|
|
292
|
+
args,
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
listChannels(
|
|
296
|
+
args: ListChannelsScriptInput,
|
|
297
|
+
): Promise<ListChannelsScriptOutput> {
|
|
298
|
+
return this.invoke<ListChannelsScriptOutput>("listChannels", args)
|
|
299
|
+
}
|
|
300
|
+
removeReaction(
|
|
301
|
+
args: RemoveReactionScriptInput,
|
|
302
|
+
): Promise<RemoveReactionScriptOutput> {
|
|
303
|
+
return this.invoke<RemoveReactionScriptOutput>("removeReaction", args)
|
|
304
|
+
}
|
|
305
|
+
sendMessageToChannel(
|
|
306
|
+
args: SendMessageToChannelScriptInput,
|
|
307
|
+
): Promise<SendMessageToChannelScriptOutput> {
|
|
308
|
+
return this.invoke<SendMessageToChannelScriptOutput>(
|
|
309
|
+
"sendMessageToChannel",
|
|
310
|
+
args,
|
|
311
|
+
)
|
|
312
|
+
}
|
|
313
|
+
updateMessage(
|
|
314
|
+
args: UpdateMessageScriptInput,
|
|
315
|
+
): Promise<UpdateMessageScriptOutput> {
|
|
316
|
+
return this.invoke<UpdateMessageScriptOutput>("updateMessage", args)
|
|
317
|
+
}
|
|
318
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
// Generated by notion tool-core codegen-script-types --connections. Do not edit.
|
|
2
|
+
import type { ConnectionActionInvoker } from "./connection-actions.js"
|
|
3
|
+
/**
|
|
4
|
+
* Script input for the "Load Gmail thread" effect (`gmail.loadThread`),
|
|
5
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
6
|
+
*
|
|
7
|
+
* Load a Gmail thread.
|
|
8
|
+
*/
|
|
9
|
+
export type LoadThreadScriptInput = {
|
|
10
|
+
/**
|
|
11
|
+
* Gmail thread ID.
|
|
12
|
+
*/
|
|
13
|
+
threadId?: string
|
|
14
|
+
/**
|
|
15
|
+
* Gmail thread URL or gmail:// connector href.
|
|
16
|
+
*/
|
|
17
|
+
url?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Canonical Tool Core output for the "Load Gmail thread" effect (`gmail.loadThread`).
|
|
22
|
+
* This is the definition's output schema; the effect's script surface may
|
|
23
|
+
* re-encode it before returning.
|
|
24
|
+
*/
|
|
25
|
+
export type LoadThreadScriptOutput = {
|
|
26
|
+
type: "gmail"
|
|
27
|
+
threadId: string
|
|
28
|
+
subject: string
|
|
29
|
+
messages: Array<{
|
|
30
|
+
messageId: string
|
|
31
|
+
user: {
|
|
32
|
+
name: string
|
|
33
|
+
notionUserId?: string
|
|
34
|
+
notionUserName?: string
|
|
35
|
+
}
|
|
36
|
+
text: string
|
|
37
|
+
subject?: string
|
|
38
|
+
timestamp: number
|
|
39
|
+
attachments?: Array<{
|
|
40
|
+
attachmentId?: string
|
|
41
|
+
filename: string
|
|
42
|
+
mimeType: string
|
|
43
|
+
sizeBytes: number
|
|
44
|
+
inline: boolean
|
|
45
|
+
}>
|
|
46
|
+
}>
|
|
47
|
+
timestamp: number
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Script input for the "Query Gmail" effect (`gmail.query`),
|
|
52
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
53
|
+
*
|
|
54
|
+
* Query Gmail threads with structured parameters.
|
|
55
|
+
*/
|
|
56
|
+
export type QueryScriptInput = {
|
|
57
|
+
/**
|
|
58
|
+
* Gmail search query string (from:, to:, subject:, after:, before:, has:attachment, is:unread, etc.).
|
|
59
|
+
*/
|
|
60
|
+
q?: string
|
|
61
|
+
/**
|
|
62
|
+
* Maximum number of threads to return (default: 20, max: 100).
|
|
63
|
+
*/
|
|
64
|
+
maxResults?: number
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Canonical Tool Core output for the "Query Gmail" effect (`gmail.query`).
|
|
69
|
+
* This is the definition's output schema; the effect's script surface may
|
|
70
|
+
* re-encode it before returning.
|
|
71
|
+
*/
|
|
72
|
+
export type QueryScriptOutput = {
|
|
73
|
+
threads: Array<{
|
|
74
|
+
type: "gmail"
|
|
75
|
+
threadId: string
|
|
76
|
+
subject: string
|
|
77
|
+
messages: Array<{
|
|
78
|
+
messageId: string
|
|
79
|
+
user: {
|
|
80
|
+
name: string
|
|
81
|
+
notionUserId?: string
|
|
82
|
+
notionUserName?: string
|
|
83
|
+
}
|
|
84
|
+
text: string
|
|
85
|
+
subject?: string
|
|
86
|
+
timestamp: number
|
|
87
|
+
attachments?: Array<{
|
|
88
|
+
attachmentId?: string
|
|
89
|
+
filename: string
|
|
90
|
+
mimeType: string
|
|
91
|
+
sizeBytes: number
|
|
92
|
+
inline: boolean
|
|
93
|
+
}>
|
|
94
|
+
}>
|
|
95
|
+
timestamp: number
|
|
96
|
+
}>
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Script input for the "Read Gmail attachment" effect (`gmail.readAttachment`),
|
|
101
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
102
|
+
*
|
|
103
|
+
* Read a Gmail attachment.
|
|
104
|
+
*/
|
|
105
|
+
export type ReadAttachmentScriptInput = {
|
|
106
|
+
/**
|
|
107
|
+
* Gmail message ID from loadThread.
|
|
108
|
+
*/
|
|
109
|
+
messageId: string
|
|
110
|
+
/**
|
|
111
|
+
* Optional attachment filename from loadThread. Useful as a fallback when an attachmentId is unavailable.
|
|
112
|
+
*/
|
|
113
|
+
filename?: string
|
|
114
|
+
/**
|
|
115
|
+
* Optional Gmail attachment ID from loadThread. Use it when present to target a specific attachment.
|
|
116
|
+
*/
|
|
117
|
+
attachmentId?: string
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Canonical Tool Core output for the "Read Gmail attachment" effect (`gmail.readAttachment`).
|
|
122
|
+
* This is the definition's output schema; the effect's script surface may
|
|
123
|
+
* re-encode it before returning.
|
|
124
|
+
*/
|
|
125
|
+
export type ReadAttachmentScriptOutput = {
|
|
126
|
+
type: "gmail"
|
|
127
|
+
items: Array<
|
|
128
|
+
| {
|
|
129
|
+
attachmentId?: string
|
|
130
|
+
filename: string
|
|
131
|
+
mimeType: string
|
|
132
|
+
sizeBytes: number
|
|
133
|
+
inline: boolean
|
|
134
|
+
contentType: "attachment"
|
|
135
|
+
message: string
|
|
136
|
+
}
|
|
137
|
+
| {
|
|
138
|
+
attachmentId?: string
|
|
139
|
+
filename: string
|
|
140
|
+
mimeType: string
|
|
141
|
+
sizeBytes: number
|
|
142
|
+
inline: boolean
|
|
143
|
+
contentType: "text"
|
|
144
|
+
text: string
|
|
145
|
+
}
|
|
146
|
+
| {
|
|
147
|
+
attachmentId?: string
|
|
148
|
+
filename: string
|
|
149
|
+
mimeType: string
|
|
150
|
+
sizeBytes: number
|
|
151
|
+
inline: boolean
|
|
152
|
+
contentType: "unsupported"
|
|
153
|
+
message: string
|
|
154
|
+
}
|
|
155
|
+
>
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Script input for the "Search Gmail" effect (`gmail.search`),
|
|
160
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
161
|
+
*
|
|
162
|
+
* Search Gmail via the configured connector.
|
|
163
|
+
*/
|
|
164
|
+
export type SearchScriptInput = {
|
|
165
|
+
/**
|
|
166
|
+
* Search query for Gmail.
|
|
167
|
+
*/
|
|
168
|
+
query: string
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Canonical Tool Core output for the "Search Gmail" effect (`gmail.search`).
|
|
173
|
+
* This is the definition's output schema; the effect's script surface may
|
|
174
|
+
* re-encode it before returning.
|
|
175
|
+
*/
|
|
176
|
+
export type SearchScriptOutput = {
|
|
177
|
+
results: Array<{
|
|
178
|
+
id: string
|
|
179
|
+
title: string
|
|
180
|
+
path: string
|
|
181
|
+
text: string
|
|
182
|
+
lastEdited: string
|
|
183
|
+
isPrivate: boolean
|
|
184
|
+
pageId: string
|
|
185
|
+
emailAddress: string
|
|
186
|
+
}>
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export class GmailConnectionClient {
|
|
190
|
+
constructor(private readonly invoke: ConnectionActionInvoker) {}
|
|
191
|
+
loadThread(args: LoadThreadScriptInput): Promise<LoadThreadScriptOutput> {
|
|
192
|
+
return this.invoke<LoadThreadScriptOutput>("loadThread", args)
|
|
193
|
+
}
|
|
194
|
+
query(args: QueryScriptInput): Promise<QueryScriptOutput> {
|
|
195
|
+
return this.invoke<QueryScriptOutput>("query", args)
|
|
196
|
+
}
|
|
197
|
+
readAttachment(
|
|
198
|
+
args: ReadAttachmentScriptInput,
|
|
199
|
+
): Promise<ReadAttachmentScriptOutput> {
|
|
200
|
+
return this.invoke<ReadAttachmentScriptOutput>("readAttachment", args)
|
|
201
|
+
}
|
|
202
|
+
search(args: SearchScriptInput): Promise<SearchScriptOutput> {
|
|
203
|
+
return this.invoke<SearchScriptOutput>("search", args)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Generated by notion tool-core codegen-script-types --connections. Do not edit.
|
|
2
|
+
import type { ConnectionActionInvoker } from "./connection-actions.js"
|
|
3
|
+
/**
|
|
4
|
+
* Script input for the "Query Google Calendar connector" effect (`googleCalendar.query`),
|
|
5
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
6
|
+
*
|
|
7
|
+
* Query Google Calendar events.
|
|
8
|
+
*/
|
|
9
|
+
export type QueryScriptInput = {
|
|
10
|
+
/**
|
|
11
|
+
* Search query to filter events by text (title, description, location, attendees).
|
|
12
|
+
*/
|
|
13
|
+
q?: string
|
|
14
|
+
/**
|
|
15
|
+
* Lower bound (inclusive) for event start time in ISO 8601 format.
|
|
16
|
+
*/
|
|
17
|
+
timeMin?: string
|
|
18
|
+
/**
|
|
19
|
+
* Upper bound (exclusive) for event start time in ISO 8601 format.
|
|
20
|
+
*/
|
|
21
|
+
timeMax?: string
|
|
22
|
+
/**
|
|
23
|
+
* Maximum number of events to return (default: 50, max: 250).
|
|
24
|
+
*/
|
|
25
|
+
maxResults?: number
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Canonical Tool Core output for the "Query Google Calendar connector" effect (`googleCalendar.query`).
|
|
30
|
+
* This is the definition's output schema; the effect's script surface may
|
|
31
|
+
* re-encode it before returning.
|
|
32
|
+
*/
|
|
33
|
+
export type QueryScriptOutput = {
|
|
34
|
+
events: Array<{
|
|
35
|
+
id: string
|
|
36
|
+
title: string
|
|
37
|
+
text: string
|
|
38
|
+
start?: string
|
|
39
|
+
end?: string
|
|
40
|
+
location?: string
|
|
41
|
+
url?: string
|
|
42
|
+
isRecurring: boolean
|
|
43
|
+
attendees?: Array<{
|
|
44
|
+
name?: string
|
|
45
|
+
email?: string
|
|
46
|
+
responseStatus?:
|
|
47
|
+
| "accepted"
|
|
48
|
+
| "declined"
|
|
49
|
+
| "tentative"
|
|
50
|
+
| "noResponse"
|
|
51
|
+
| "unknown"
|
|
52
|
+
}>
|
|
53
|
+
}>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Script input for the "Search Google Calendar connector" effect (`googleCalendar.search`),
|
|
58
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
59
|
+
*
|
|
60
|
+
* Search Google Calendar via the configured connector.
|
|
61
|
+
*/
|
|
62
|
+
export type SearchScriptInput = {
|
|
63
|
+
/**
|
|
64
|
+
* Search query for Google Calendar.
|
|
65
|
+
*/
|
|
66
|
+
query: string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Canonical Tool Core output for the "Search Google Calendar connector" effect (`googleCalendar.search`).
|
|
71
|
+
* This is the definition's output schema; the effect's script surface may
|
|
72
|
+
* re-encode it before returning.
|
|
73
|
+
*/
|
|
74
|
+
export type SearchScriptOutput = {
|
|
75
|
+
results: Array<{
|
|
76
|
+
id: string
|
|
77
|
+
title: string
|
|
78
|
+
path: string
|
|
79
|
+
text: string
|
|
80
|
+
lastEdited: string
|
|
81
|
+
pageId: string
|
|
82
|
+
emailAddress: string
|
|
83
|
+
isPrivate: boolean
|
|
84
|
+
}>
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export class GoogleCalendarConnectionClient {
|
|
88
|
+
constructor(private readonly invoke: ConnectionActionInvoker) {}
|
|
89
|
+
query(args: QueryScriptInput): Promise<QueryScriptOutput> {
|
|
90
|
+
return this.invoke<QueryScriptOutput>("query", args)
|
|
91
|
+
}
|
|
92
|
+
search(args: SearchScriptInput): Promise<SearchScriptOutput> {
|
|
93
|
+
return this.invoke<SearchScriptOutput>("search", args)
|
|
94
|
+
}
|
|
95
|
+
}
|