@notionhq/apps 0.0.39 → 0.0.41

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.
@@ -1,5 +1,32 @@
1
1
  // Generated by notion tool-core codegen-script-types --connections. Do not edit.
2
2
  import type { ConnectionActionInvoker } from "./connection-actions.js"
3
+ /**
4
+ * Script input for the "Add a reaction to a Slack message" effect (`slack.addReactionToMessage`),
5
+ * derived from its Tool Core definition's call_function input projection.
6
+ *
7
+ * Add a reaction to a Slack message
8
+ */
9
+ export type AddReactionToMessageScriptInput = {
10
+ /**
11
+ * The URI of the Slack message
12
+ */
13
+ prefixedMessageUri: string
14
+ reaction: string
15
+ }
16
+
17
+ /**
18
+ * Canonical Tool Core output for the "Add a reaction to a Slack message" effect (`slack.addReactionToMessage`).
19
+ * This is the definition's output schema; the effect's script surface may
20
+ * re-encode it before returning.
21
+ */
22
+ export type AddReactionToMessageScriptOutput = {
23
+ channelName: string
24
+ prefixedMessageUri: string
25
+ reaction: string
26
+ status: "added" | "already_absent" | "already_present" | "removed"
27
+ message?: string
28
+ }
29
+
3
30
  /**
4
31
  * Script input for the "Find a Slack user by email" effect (`slack.findUserByEmail`),
5
32
  * derived from its Tool Core definition's call_function input projection.
@@ -81,6 +108,118 @@ export type GetThreadsInChannelSinceScriptOutput = Array<
81
108
  }>
82
109
  >
83
110
 
111
+ /**
112
+ * Script input for the "Get a Slack user by ID" effect (`slack.getUser`),
113
+ * derived from its Tool Core definition's call_function input projection.
114
+ *
115
+ * Get a Slack user by ID
116
+ */
117
+ export type GetUserScriptInput = {
118
+ userId: string
119
+ }
120
+
121
+ /**
122
+ * Canonical Tool Core output for the "Get a Slack user by ID" effect (`slack.getUser`).
123
+ * This is the definition's output schema; the effect's script surface may
124
+ * re-encode it before returning.
125
+ */
126
+ export type GetUserScriptOutput = {
127
+ handle: string
128
+ id: string
129
+ uri: string
130
+ displayName?: string
131
+ email?: string
132
+ notionUser?: string
133
+ realName?: string
134
+ statusEmoji?: string
135
+ statusText?: string
136
+ timeZone?: string
137
+ title?: string
138
+ }
139
+
140
+ /**
141
+ * Script input for the "Get all messages from a user within a time range" effect (`slack.getUserMessages`),
142
+ * derived from its Tool Core definition's call_function input projection.
143
+ *
144
+ * Get all messages from a user within a time range
145
+ */
146
+ export type GetUserMessagesScriptInput =
147
+ | {
148
+ /**
149
+ * Name of the user to search for. Can be display name, handle, or partial match. Either name or email must be provided.
150
+ */
151
+ name: string
152
+ /**
153
+ * Email address of the Slack user. Either name or email must be provided.
154
+ */
155
+ email?: string
156
+ /**
157
+ * ISO 8601 timestamp for the start of the search range. Defaults to 7 days ago if not specified.
158
+ */
159
+ since?: string
160
+ }
161
+ | {
162
+ /**
163
+ * Name of the user to search for. Can be display name, handle, or partial match. Either name or email must be provided.
164
+ */
165
+ name?: string
166
+ /**
167
+ * Email address of the Slack user. Either name or email must be provided.
168
+ */
169
+ email: string
170
+ /**
171
+ * ISO 8601 timestamp for the start of the search range. Defaults to 7 days ago if not specified.
172
+ */
173
+ since?: string
174
+ }
175
+
176
+ /**
177
+ * Canonical Tool Core output for the "Get all messages from a user within a time range" effect (`slack.getUserMessages`).
178
+ * This is the definition's output schema; the effect's script surface may
179
+ * re-encode it before returning.
180
+ */
181
+ export type GetUserMessagesScriptOutput = {
182
+ messages: Array<{
183
+ channelId: string
184
+ id: string
185
+ text: string
186
+ timestamp: string
187
+ channel?: string
188
+ contextMessages?: {
189
+ after?: Array<{
190
+ text: string
191
+ timestamp: string
192
+ userId: string
193
+ }>
194
+ before?: Array<{
195
+ text: string
196
+ timestamp: string
197
+ userId: string
198
+ }>
199
+ }
200
+ url?: string
201
+ }>
202
+ totalCount: number
203
+ user: {
204
+ handle: string
205
+ id: string
206
+ uri: string
207
+ displayName?: string
208
+ email?: string
209
+ notionUser?: string
210
+ realName?: string
211
+ statusEmoji?: string
212
+ statusText?: string
213
+ timeZone?: string
214
+ title?: string
215
+ }
216
+ alternativeUsers?: Array<{
217
+ displayName?: string
218
+ email?: string
219
+ handle?: string
220
+ }>
221
+ }
222
+
84
223
  /**
85
224
  * Script input for the "Load Slack message" effect (`slack.loadMessage`),
86
225
  * derived from its Tool Core definition's call_function input projection.
@@ -137,6 +276,44 @@ export type LoadMessageScriptOutput = {
137
276
  additionalMessageToModel?: string
138
277
  }
139
278
 
279
+ /**
280
+ * Script input for the "Parse a Slack URI or URL" effect (`slack.parseSlackUriOrUrl`),
281
+ * derived from its Tool Core definition's call_function input projection.
282
+ *
283
+ * Parse a Slack message URI or URL to a parsed agent entity
284
+ */
285
+ export type ParseSlackUriOrUrlScriptInput = {
286
+ /**
287
+ * A Slack message URI or URL.
288
+ */
289
+ uriOrUrl: string
290
+ }
291
+
292
+ /**
293
+ * Canonical Tool Core output for the "Parse a Slack URI or URL" effect (`slack.parseSlackUriOrUrl`).
294
+ * This is the definition's output schema; the effect's script surface may
295
+ * re-encode it before returning.
296
+ */
297
+ export type ParseSlackUriOrUrlScriptOutput =
298
+ | {
299
+ channelId: string
300
+ messageTs: string
301
+ threadTs: string
302
+ type: "slackMessage"
303
+ workspaceHost: string
304
+ }
305
+ | {
306
+ channelId: string
307
+ type: "slackChannel"
308
+ workspaceHost: string
309
+ }
310
+ | {
311
+ type: "slackUser"
312
+ userId: string
313
+ workspaceHost: string
314
+ handle?: string
315
+ }
316
+
140
317
  /**
141
318
  * Script input for the "Query Slack channels" effect (`slack.queryChannels`),
142
319
  * derived from its Tool Core definition's call_function input projection.
@@ -224,6 +401,33 @@ export type QueryChannelsScriptOutput = Array<{
224
401
  isArchived: boolean
225
402
  }>
226
403
 
404
+ /**
405
+ * Script input for the "Remove a reaction from a Slack message" effect (`slack.removeReactionFromMessage`),
406
+ * derived from its Tool Core definition's call_function input projection.
407
+ *
408
+ * Remove a reaction from a Slack message
409
+ */
410
+ export type RemoveReactionFromMessageScriptInput = {
411
+ /**
412
+ * The URI of the Slack message
413
+ */
414
+ prefixedMessageUri: string
415
+ reaction: string
416
+ }
417
+
418
+ /**
419
+ * Canonical Tool Core output for the "Remove a reaction from a Slack message" effect (`slack.removeReactionFromMessage`).
420
+ * This is the definition's output schema; the effect's script surface may
421
+ * re-encode it before returning.
422
+ */
423
+ export type RemoveReactionFromMessageScriptOutput = {
424
+ channelName: string
425
+ prefixedMessageUri: string
426
+ reaction: string
427
+ status: "added" | "already_absent" | "already_present" | "removed"
428
+ message?: string
429
+ }
430
+
227
431
  /**
228
432
  * Script input for the "Search Slack messages" effect (`slack.search`),
229
433
  * derived from its Tool Core definition's call_function input projection.
@@ -300,6 +504,14 @@ export type ViewFileUrlScriptOutput = {
300
504
 
301
505
  export class SlackConnectionClient {
302
506
  constructor(private readonly invoke: ConnectionActionInvoker) {}
507
+ addReactionToMessage(
508
+ args: AddReactionToMessageScriptInput,
509
+ ): Promise<AddReactionToMessageScriptOutput> {
510
+ return this.invoke<AddReactionToMessageScriptOutput>(
511
+ "addReactionToMessage",
512
+ args,
513
+ )
514
+ }
303
515
  findUserByEmail(
304
516
  args: FindUserByEmailScriptInput,
305
517
  ): Promise<FindUserByEmailScriptOutput> {
@@ -313,14 +525,38 @@ export class SlackConnectionClient {
313
525
  args,
314
526
  )
315
527
  }
528
+ getUser(args: GetUserScriptInput): Promise<GetUserScriptOutput> {
529
+ return this.invoke<GetUserScriptOutput>("getUser", args)
530
+ }
531
+ getUserMessages(
532
+ args: GetUserMessagesScriptInput,
533
+ ): Promise<GetUserMessagesScriptOutput> {
534
+ return this.invoke<GetUserMessagesScriptOutput>("getUserMessages", args)
535
+ }
316
536
  loadMessage(args: LoadMessageScriptInput): Promise<LoadMessageScriptOutput> {
317
537
  return this.invoke<LoadMessageScriptOutput>("loadMessage", args)
318
538
  }
539
+ parseSlackUriOrUrl(
540
+ args: ParseSlackUriOrUrlScriptInput,
541
+ ): Promise<ParseSlackUriOrUrlScriptOutput> {
542
+ return this.invoke<ParseSlackUriOrUrlScriptOutput>(
543
+ "parseSlackUriOrUrl",
544
+ args,
545
+ )
546
+ }
319
547
  queryChannels(
320
548
  args: QueryChannelsScriptInput,
321
549
  ): Promise<QueryChannelsScriptOutput> {
322
550
  return this.invoke<QueryChannelsScriptOutput>("queryChannels", args)
323
551
  }
552
+ removeReactionFromMessage(
553
+ args: RemoveReactionFromMessageScriptInput,
554
+ ): Promise<RemoveReactionFromMessageScriptOutput> {
555
+ return this.invoke<RemoveReactionFromMessageScriptOutput>(
556
+ "removeReactionFromMessage",
557
+ args,
558
+ )
559
+ }
324
560
  search(args: SearchScriptInput): Promise<SearchScriptOutput> {
325
561
  return this.invoke<SearchScriptOutput>("search", args)
326
562
  }