@notionhq/apps 0.0.39 → 0.0.40
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/slack.generated.d.ts +194 -0
- package/dist/slack.generated.d.ts.map +1 -1
- package/dist/slack.generated.js +24 -0
- package/package.json +1 -1
- package/src/connections.test.ts +51 -0
- package/src/slack.generated.ts +236 -0
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import type { ConnectionActionInvoker } from "./connection-actions.js";
|
|
2
|
+
/**
|
|
3
|
+
* Script input for the "Add a reaction to a Slack message" effect (`slack.addReactionToMessage`),
|
|
4
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
5
|
+
*
|
|
6
|
+
* Add a reaction to a Slack message
|
|
7
|
+
*/
|
|
8
|
+
export type AddReactionToMessageScriptInput = {
|
|
9
|
+
/**
|
|
10
|
+
* The URI of the Slack message
|
|
11
|
+
*/
|
|
12
|
+
prefixedMessageUri: string;
|
|
13
|
+
reaction: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Canonical Tool Core output for the "Add a reaction to a Slack message" effect (`slack.addReactionToMessage`).
|
|
17
|
+
* This is the definition's output schema; the effect's script surface may
|
|
18
|
+
* re-encode it before returning.
|
|
19
|
+
*/
|
|
20
|
+
export type AddReactionToMessageScriptOutput = {
|
|
21
|
+
channelName: string;
|
|
22
|
+
prefixedMessageUri: string;
|
|
23
|
+
reaction: string;
|
|
24
|
+
status: "added" | "already_absent" | "already_present" | "removed";
|
|
25
|
+
message?: string;
|
|
26
|
+
};
|
|
2
27
|
/**
|
|
3
28
|
* Script input for the "Find a Slack user by email" effect (`slack.findUserByEmail`),
|
|
4
29
|
* derived from its Tool Core definition's call_function input projection.
|
|
@@ -70,6 +95,112 @@ export type GetThreadsInChannelSinceScriptOutput = Array<Array<{
|
|
|
70
95
|
fileIds?: Array<string>;
|
|
71
96
|
files?: Array<string>;
|
|
72
97
|
}>>;
|
|
98
|
+
/**
|
|
99
|
+
* Script input for the "Get a Slack user by ID" effect (`slack.getUser`),
|
|
100
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
101
|
+
*
|
|
102
|
+
* Get a Slack user by ID
|
|
103
|
+
*/
|
|
104
|
+
export type GetUserScriptInput = {
|
|
105
|
+
userId: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Canonical Tool Core output for the "Get a Slack user by ID" effect (`slack.getUser`).
|
|
109
|
+
* This is the definition's output schema; the effect's script surface may
|
|
110
|
+
* re-encode it before returning.
|
|
111
|
+
*/
|
|
112
|
+
export type GetUserScriptOutput = {
|
|
113
|
+
handle: string;
|
|
114
|
+
id: string;
|
|
115
|
+
uri: string;
|
|
116
|
+
displayName?: string;
|
|
117
|
+
email?: string;
|
|
118
|
+
notionUser?: string;
|
|
119
|
+
realName?: string;
|
|
120
|
+
statusEmoji?: string;
|
|
121
|
+
statusText?: string;
|
|
122
|
+
timeZone?: string;
|
|
123
|
+
title?: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Script input for the "Get all messages from a user within a time range" effect (`slack.getUserMessages`),
|
|
127
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
128
|
+
*
|
|
129
|
+
* Get all messages from a user within a time range
|
|
130
|
+
*/
|
|
131
|
+
export type GetUserMessagesScriptInput = {
|
|
132
|
+
/**
|
|
133
|
+
* Name of the user to search for. Can be display name, handle, or partial match. Either name or email must be provided.
|
|
134
|
+
*/
|
|
135
|
+
name: string;
|
|
136
|
+
/**
|
|
137
|
+
* Email address of the Slack user. Either name or email must be provided.
|
|
138
|
+
*/
|
|
139
|
+
email?: string;
|
|
140
|
+
/**
|
|
141
|
+
* ISO 8601 timestamp for the start of the search range. Defaults to 7 days ago if not specified.
|
|
142
|
+
*/
|
|
143
|
+
since?: string;
|
|
144
|
+
} | {
|
|
145
|
+
/**
|
|
146
|
+
* Name of the user to search for. Can be display name, handle, or partial match. Either name or email must be provided.
|
|
147
|
+
*/
|
|
148
|
+
name?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Email address of the Slack user. Either name or email must be provided.
|
|
151
|
+
*/
|
|
152
|
+
email: string;
|
|
153
|
+
/**
|
|
154
|
+
* ISO 8601 timestamp for the start of the search range. Defaults to 7 days ago if not specified.
|
|
155
|
+
*/
|
|
156
|
+
since?: string;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Canonical Tool Core output for the "Get all messages from a user within a time range" effect (`slack.getUserMessages`).
|
|
160
|
+
* This is the definition's output schema; the effect's script surface may
|
|
161
|
+
* re-encode it before returning.
|
|
162
|
+
*/
|
|
163
|
+
export type GetUserMessagesScriptOutput = {
|
|
164
|
+
messages: Array<{
|
|
165
|
+
channelId: string;
|
|
166
|
+
id: string;
|
|
167
|
+
text: string;
|
|
168
|
+
timestamp: string;
|
|
169
|
+
channel?: string;
|
|
170
|
+
contextMessages?: {
|
|
171
|
+
after?: Array<{
|
|
172
|
+
text: string;
|
|
173
|
+
timestamp: string;
|
|
174
|
+
userId: string;
|
|
175
|
+
}>;
|
|
176
|
+
before?: Array<{
|
|
177
|
+
text: string;
|
|
178
|
+
timestamp: string;
|
|
179
|
+
userId: string;
|
|
180
|
+
}>;
|
|
181
|
+
};
|
|
182
|
+
url?: string;
|
|
183
|
+
}>;
|
|
184
|
+
totalCount: number;
|
|
185
|
+
user: {
|
|
186
|
+
handle: string;
|
|
187
|
+
id: string;
|
|
188
|
+
uri: string;
|
|
189
|
+
displayName?: string;
|
|
190
|
+
email?: string;
|
|
191
|
+
notionUser?: string;
|
|
192
|
+
realName?: string;
|
|
193
|
+
statusEmoji?: string;
|
|
194
|
+
statusText?: string;
|
|
195
|
+
timeZone?: string;
|
|
196
|
+
title?: string;
|
|
197
|
+
};
|
|
198
|
+
alternativeUsers?: Array<{
|
|
199
|
+
displayName?: string;
|
|
200
|
+
email?: string;
|
|
201
|
+
handle?: string;
|
|
202
|
+
}>;
|
|
203
|
+
};
|
|
73
204
|
/**
|
|
74
205
|
* Script input for the "Load Slack message" effect (`slack.loadMessage`),
|
|
75
206
|
* derived from its Tool Core definition's call_function input projection.
|
|
@@ -122,6 +253,39 @@ export type LoadMessageScriptOutput = {
|
|
|
122
253
|
timestamp: number;
|
|
123
254
|
additionalMessageToModel?: string;
|
|
124
255
|
};
|
|
256
|
+
/**
|
|
257
|
+
* Script input for the "Parse a Slack URI or URL" effect (`slack.parseSlackUriOrUrl`),
|
|
258
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
259
|
+
*
|
|
260
|
+
* Parse a Slack message URI or URL to a parsed agent entity
|
|
261
|
+
*/
|
|
262
|
+
export type ParseSlackUriOrUrlScriptInput = {
|
|
263
|
+
/**
|
|
264
|
+
* A Slack message URI or URL.
|
|
265
|
+
*/
|
|
266
|
+
uriOrUrl: string;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Canonical Tool Core output for the "Parse a Slack URI or URL" effect (`slack.parseSlackUriOrUrl`).
|
|
270
|
+
* This is the definition's output schema; the effect's script surface may
|
|
271
|
+
* re-encode it before returning.
|
|
272
|
+
*/
|
|
273
|
+
export type ParseSlackUriOrUrlScriptOutput = {
|
|
274
|
+
channelId: string;
|
|
275
|
+
messageTs: string;
|
|
276
|
+
threadTs: string;
|
|
277
|
+
type: "slackMessage";
|
|
278
|
+
workspaceHost: string;
|
|
279
|
+
} | {
|
|
280
|
+
channelId: string;
|
|
281
|
+
type: "slackChannel";
|
|
282
|
+
workspaceHost: string;
|
|
283
|
+
} | {
|
|
284
|
+
type: "slackUser";
|
|
285
|
+
userId: string;
|
|
286
|
+
workspaceHost: string;
|
|
287
|
+
handle?: string;
|
|
288
|
+
};
|
|
125
289
|
/**
|
|
126
290
|
* Script input for the "Query Slack channels" effect (`slack.queryChannels`),
|
|
127
291
|
* derived from its Tool Core definition's call_function input projection.
|
|
@@ -207,6 +371,31 @@ export type QueryChannelsScriptOutput = Array<{
|
|
|
207
371
|
*/
|
|
208
372
|
isArchived: boolean;
|
|
209
373
|
}>;
|
|
374
|
+
/**
|
|
375
|
+
* Script input for the "Remove a reaction from a Slack message" effect (`slack.removeReactionFromMessage`),
|
|
376
|
+
* derived from its Tool Core definition's call_function input projection.
|
|
377
|
+
*
|
|
378
|
+
* Remove a reaction from a Slack message
|
|
379
|
+
*/
|
|
380
|
+
export type RemoveReactionFromMessageScriptInput = {
|
|
381
|
+
/**
|
|
382
|
+
* The URI of the Slack message
|
|
383
|
+
*/
|
|
384
|
+
prefixedMessageUri: string;
|
|
385
|
+
reaction: string;
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* Canonical Tool Core output for the "Remove a reaction from a Slack message" effect (`slack.removeReactionFromMessage`).
|
|
389
|
+
* This is the definition's output schema; the effect's script surface may
|
|
390
|
+
* re-encode it before returning.
|
|
391
|
+
*/
|
|
392
|
+
export type RemoveReactionFromMessageScriptOutput = {
|
|
393
|
+
channelName: string;
|
|
394
|
+
prefixedMessageUri: string;
|
|
395
|
+
reaction: string;
|
|
396
|
+
status: "added" | "already_absent" | "already_present" | "removed";
|
|
397
|
+
message?: string;
|
|
398
|
+
};
|
|
210
399
|
/**
|
|
211
400
|
* Script input for the "Search Slack messages" effect (`slack.search`),
|
|
212
401
|
* derived from its Tool Core definition's call_function input projection.
|
|
@@ -280,10 +469,15 @@ export type ViewFileUrlScriptOutput = {
|
|
|
280
469
|
export declare class SlackConnectionClient {
|
|
281
470
|
private readonly invoke;
|
|
282
471
|
constructor(invoke: ConnectionActionInvoker);
|
|
472
|
+
addReactionToMessage(args: AddReactionToMessageScriptInput): Promise<AddReactionToMessageScriptOutput>;
|
|
283
473
|
findUserByEmail(args: FindUserByEmailScriptInput): Promise<FindUserByEmailScriptOutput>;
|
|
284
474
|
getThreadsInChannelSince(args: GetThreadsInChannelSinceScriptInput): Promise<GetThreadsInChannelSinceScriptOutput>;
|
|
475
|
+
getUser(args: GetUserScriptInput): Promise<GetUserScriptOutput>;
|
|
476
|
+
getUserMessages(args: GetUserMessagesScriptInput): Promise<GetUserMessagesScriptOutput>;
|
|
285
477
|
loadMessage(args: LoadMessageScriptInput): Promise<LoadMessageScriptOutput>;
|
|
478
|
+
parseSlackUriOrUrl(args: ParseSlackUriOrUrlScriptInput): Promise<ParseSlackUriOrUrlScriptOutput>;
|
|
286
479
|
queryChannels(args: QueryChannelsScriptInput): Promise<QueryChannelsScriptOutput>;
|
|
480
|
+
removeReactionFromMessage(args: RemoveReactionFromMessageScriptInput): Promise<RemoveReactionFromMessageScriptOutput>;
|
|
287
481
|
search(args: SearchScriptInput): Promise<SearchScriptOutput>;
|
|
288
482
|
viewFileUrl(args: ViewFileUrlScriptInput): Promise<ViewFileUrlScriptOutput>;
|
|
289
483
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.generated.d.ts","sourceRoot":"","sources":["../src/slack.generated.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACtE;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACxC,KAAK,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GACpC;IACA,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACb,GACD,SAAS,CAAA;AAEZ;;;;;GAKG;AACH,MAAM,MAAM,mCAAmC,GAAG;IACjD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAC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M,EAAE,uBAAuB;IAC5D,oBAAoB,CACnB,IAAI,EAAE,+BAA+B,GACnC,OAAO,CAAC,gCAAgC,CAAC;IAM5C,eAAe,CACd,IAAI,EAAE,0BAA0B,GAC9B,OAAO,CAAC,2BAA2B,CAAC;IAGvC,wBAAwB,CACvB,IAAI,EAAE,mCAAmC,GACvC,OAAO,CAAC,oCAAoC,CAAC;IAMhD,OAAO,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAG/D,eAAe,CACd,IAAI,EAAE,0BAA0B,GAC9B,OAAO,CAAC,2BAA2B,CAAC;IAGvC,WAAW,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAG3E,kBAAkB,CACjB,IAAI,EAAE,6BAA6B,GACjC,OAAO,CAAC,8BAA8B,CAAC;IAM1C,aAAa,CACZ,IAAI,EAAE,wBAAwB,GAC5B,OAAO,CAAC,yBAAyB,CAAC;IAGrC,yBAAyB,CACxB,IAAI,EAAE,oCAAoC,GACxC,OAAO,CAAC,qCAAqC,CAAC;IAMjD,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAG5D,WAAW,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAG3E"}
|
package/dist/slack.generated.js
CHANGED
|
@@ -3,6 +3,12 @@ class SlackConnectionClient {
|
|
|
3
3
|
this.invoke = invoke;
|
|
4
4
|
}
|
|
5
5
|
invoke;
|
|
6
|
+
addReactionToMessage(args) {
|
|
7
|
+
return this.invoke(
|
|
8
|
+
"addReactionToMessage",
|
|
9
|
+
args
|
|
10
|
+
);
|
|
11
|
+
}
|
|
6
12
|
findUserByEmail(args) {
|
|
7
13
|
return this.invoke("findUserByEmail", args);
|
|
8
14
|
}
|
|
@@ -12,12 +18,30 @@ class SlackConnectionClient {
|
|
|
12
18
|
args
|
|
13
19
|
);
|
|
14
20
|
}
|
|
21
|
+
getUser(args) {
|
|
22
|
+
return this.invoke("getUser", args);
|
|
23
|
+
}
|
|
24
|
+
getUserMessages(args) {
|
|
25
|
+
return this.invoke("getUserMessages", args);
|
|
26
|
+
}
|
|
15
27
|
loadMessage(args) {
|
|
16
28
|
return this.invoke("loadMessage", args);
|
|
17
29
|
}
|
|
30
|
+
parseSlackUriOrUrl(args) {
|
|
31
|
+
return this.invoke(
|
|
32
|
+
"parseSlackUriOrUrl",
|
|
33
|
+
args
|
|
34
|
+
);
|
|
35
|
+
}
|
|
18
36
|
queryChannels(args) {
|
|
19
37
|
return this.invoke("queryChannels", args);
|
|
20
38
|
}
|
|
39
|
+
removeReactionFromMessage(args) {
|
|
40
|
+
return this.invoke(
|
|
41
|
+
"removeReactionFromMessage",
|
|
42
|
+
args
|
|
43
|
+
);
|
|
44
|
+
}
|
|
21
45
|
search(args) {
|
|
22
46
|
return this.invoke("search", args);
|
|
23
47
|
}
|
package/package.json
CHANGED
package/src/connections.test.ts
CHANGED
|
@@ -143,6 +143,57 @@ describe("workflow connection runtime", () => {
|
|
|
143
143
|
expect(Reflect.get(runtime, "toString")).toBeUndefined();
|
|
144
144
|
expect(runtime.support).toBe(runtime.support);
|
|
145
145
|
});
|
|
146
|
+
|
|
147
|
+
it("sends newly exposed Slack actions through the declared binding", async () => {
|
|
148
|
+
vi.stubEnv(
|
|
149
|
+
"NOTION_CONNECTION_BINDINGS",
|
|
150
|
+
'[{"key":"support","type":"slack","id":"support-id"}]',
|
|
151
|
+
);
|
|
152
|
+
const notion = new Client({ auth: "test" });
|
|
153
|
+
const request = vi.spyOn(notion, "request").mockResolvedValue({ result: {} });
|
|
154
|
+
const slack = createWorkflowConnections(notion, {
|
|
155
|
+
support: connections.slack(),
|
|
156
|
+
}).support;
|
|
157
|
+
|
|
158
|
+
await slack.getUser({ userId: "U123" });
|
|
159
|
+
await slack.getUserMessages({ email: "person@example.com" });
|
|
160
|
+
await slack.parseSlackUriOrUrl({
|
|
161
|
+
uriOrUrl: "https://example.slack.com/archives/C123/p123",
|
|
162
|
+
});
|
|
163
|
+
await slack.addReactionToMessage({
|
|
164
|
+
prefixedMessageUri: "slackMessage://C123/123",
|
|
165
|
+
reaction: "eyes",
|
|
166
|
+
});
|
|
167
|
+
await slack.removeReactionFromMessage({
|
|
168
|
+
prefixedMessageUri: "slackMessage://C123/123",
|
|
169
|
+
reaction: "eyes",
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
expect(request.mock.calls.map(([input]) => input.body)).toEqual([
|
|
173
|
+
{ connection: "support-id", action: "getUser", args: { userId: "U123" } },
|
|
174
|
+
{
|
|
175
|
+
connection: "support-id",
|
|
176
|
+
action: "getUserMessages",
|
|
177
|
+
args: { email: "person@example.com" },
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
connection: "support-id",
|
|
181
|
+
action: "parseSlackUriOrUrl",
|
|
182
|
+
args: { uriOrUrl: "https://example.slack.com/archives/C123/p123" },
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
connection: "support-id",
|
|
186
|
+
action: "addReactionToMessage",
|
|
187
|
+
args: { prefixedMessageUri: "slackMessage://C123/123", reaction: "eyes" },
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
connection: "support-id",
|
|
191
|
+
action: "removeReactionFromMessage",
|
|
192
|
+
args: { prefixedMessageUri: "slackMessage://C123/123", reaction: "eyes" },
|
|
193
|
+
},
|
|
194
|
+
]);
|
|
195
|
+
});
|
|
196
|
+
|
|
146
197
|
it("does not parse missing or malformed bindings until a declared client is used", () => {
|
|
147
198
|
vi.stubEnv("NOTION_CONNECTION_BINDINGS", "not json");
|
|
148
199
|
const runtime = createWorkflowConnections(new Client(), { support: connections.slack() });
|
package/src/slack.generated.ts
CHANGED
|
@@ -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
|
}
|