@distilled.cloud/slack 1.0.0-rc.17 → 1.0.0-rc.19
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/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/credentials.d.ts +2 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/index.d.ts +3 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.lazy.js.map +1 -1
- package/lib/protocol.d.ts +3 -2
- package/lib/protocol.d.ts.map +1 -1
- package/lib/services/admin.d.ts +594 -356
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +149 -139
- package/lib/services/admin.js.map +1 -1
- package/lib/services/agents.d.ts +89 -97
- package/lib/services/agents.d.ts.map +1 -1
- package/lib/services/agents.js +1 -1
- package/lib/services/agents.js.map +1 -1
- package/lib/services/api.d.ts +2 -2
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +1 -1
- package/lib/services/api.js.map +1 -1
- package/lib/services/apps.d.ts +74 -74
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +34 -33
- package/lib/services/apps.js.map +1 -1
- package/lib/services/assistant.d.ts +55 -46
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +1 -1
- package/lib/services/assistant.js.map +1 -1
- package/lib/services/auth.d.ts +27 -27
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +1 -1
- package/lib/services/auth.js.map +1 -1
- package/lib/services/blocks.d.ts +3 -3
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +1 -1
- package/lib/services/blocks.js.map +1 -1
- package/lib/services/bookmarks.d.ts +19 -19
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +1 -1
- package/lib/services/bookmarks.js.map +1 -1
- package/lib/services/bots.d.ts +23 -23
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +1 -1
- package/lib/services/bots.js.map +1 -1
- package/lib/services/calls.d.ts +10 -10
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +1 -1
- package/lib/services/calls.js.map +1 -1
- package/lib/services/canvases.d.ts +18 -18
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +1 -1
- package/lib/services/canvases.js.map +1 -1
- package/lib/services/chat.d.ts +103 -103
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +1 -1
- package/lib/services/chat.js.map +1 -1
- package/lib/services/conversations.d.ts +109 -103
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +39 -38
- package/lib/services/conversations.js.map +1 -1
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +1 -1
- package/lib/services/dialog.js.map +1 -1
- package/lib/services/dnd.d.ts +14 -14
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +1 -1
- package/lib/services/dnd.js.map +1 -1
- package/lib/services/emoji.d.ts +6 -6
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +1 -1
- package/lib/services/emoji.js.map +1 -1
- package/lib/services/entity.d.ts +14 -14
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +1 -1
- package/lib/services/entity.js.map +1 -1
- package/lib/services/files.d.ts +106 -106
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +30 -1
- package/lib/services/files.js.map +1 -1
- package/lib/services/functions.d.ts +37 -37
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +1 -1
- package/lib/services/functions.js.map +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +1 -0
- package/lib/services/lists.d.ts +47 -45
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +1 -1
- package/lib/services/lists.js.map +1 -1
- package/lib/services/migration.d.ts +3 -3
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +1 -1
- package/lib/services/migration.js.map +1 -1
- package/lib/services/oauth.d.ts +102 -102
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +1 -1
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/openid.d.ts +40 -40
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +1 -1
- package/lib/services/openid.js.map +1 -1
- package/lib/services/pins.d.ts +9 -9
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +1 -1
- package/lib/services/pins.js.map +1 -1
- package/lib/services/reactions.d.ts +23 -23
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +1 -1
- package/lib/services/reactions.js.map +1 -1
- package/lib/services/reminders.d.ts +8 -8
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +1 -1
- package/lib/services/reminders.js.map +1 -1
- package/lib/services/rtm.d.ts +11 -11
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +1 -1
- package/lib/services/rtm.js.map +1 -1
- package/lib/services/search.d.ts +84 -80
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +1 -1
- package/lib/services/search.js.map +1 -1
- package/lib/services/slackbot.d.ts +366 -0
- package/lib/services/slackbot.d.ts.map +1 -0
- package/lib/services/slackbot.js +2 -0
- package/lib/services/slackbot.js.map +1 -0
- package/lib/services/stars.d.ts +16 -16
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +1 -1
- package/lib/services/stars.js.map +1 -1
- package/lib/services/team.d.ts +39 -37
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +1 -1
- package/lib/services/team.js.map +1 -1
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +1 -1
- package/lib/services/tooling.js.map +1 -1
- package/lib/services/usergroups.d.ts +30 -30
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +1 -1
- package/lib/services/usergroups.js.map +1 -1
- package/lib/services/users.d.ts +37 -37
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +1 -1
- package/lib/services/users.js.map +1 -1
- package/lib/services/views.d.ts +9 -9
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +1 -1
- package/lib/services/views.js.map +1 -1
- package/lib/services/workflows.d.ts +16 -16
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +1 -1
- package/lib/services/workflows.js.map +1 -1
- package/lib/services.lazy/admin.js +2 -2
- package/lib/services.lazy/apps.js +1 -1
- package/lib/services.lazy/conversations.js +1 -1
- package/lib/services.lazy/files.js +3 -1
- package/lib/services.lazy/index.js +2 -2
- package/lib/services.lazy/slackbot.js +1 -0
- package/package.json +8 -7
- package/src/credentials.ts +3 -2
- package/src/index.ts +3 -4
- package/src/protocol.ts +23 -21
- package/src/services/admin.ts +1882 -1034
- package/src/services/agents.ts +128 -103
- package/src/services/api.ts +17 -2
- package/src/services/apps.ts +133 -74
- package/src/services/assistant.ts +109 -54
- package/src/services/auth.ts +46 -27
- package/src/services/blocks.ts +18 -3
- package/src/services/bookmarks.ts +40 -19
- package/src/services/bots.ts +38 -23
- package/src/services/calls.ts +35 -10
- package/src/services/canvases.ts +77 -46
- package/src/services/chat.ts +142 -103
- package/src/services/conversations.ts +195 -115
- package/src/services/dialog.ts +15 -0
- package/src/services/dnd.ts +37 -14
- package/src/services/emoji.ts +21 -6
- package/src/services/entity.ts +33 -14
- package/src/services/files.ts +149 -106
- package/src/services/functions.ts +66 -37
- package/src/services/index.ts +1 -0
- package/src/services/lists.ts +86 -46
- package/src/services/migration.ts +18 -3
- package/src/services/oauth.ts +127 -102
- package/src/services/openid.ts +57 -40
- package/src/services/pins.ts +28 -9
- package/src/services/reactions.ts +44 -23
- package/src/services/reminders.ts +31 -8
- package/src/services/rtm.ts +28 -11
- package/src/services/search.ts +142 -130
- package/src/services/slackbot.ts +766 -0
- package/src/services/stars.ts +35 -16
- package/src/services/team.ts +73 -37
- package/src/services/tooling.ts +15 -0
- package/src/services/usergroups.ts +57 -30
- package/src/services/users.ts +76 -37
- package/src/services/views.ts +30 -9
- package/src/services/workflows.ts +45 -16
|
@@ -3,6 +3,7 @@ import * as API from "@distilled.cloud/core/api";
|
|
|
3
3
|
import * as S from "@distilled.cloud/core/schema-lite";
|
|
4
4
|
import * as __L from "@distilled.cloud/core/schema-lite";
|
|
5
5
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
6
|
+
import { slackPaginate } from "../pagination.ts";
|
|
6
7
|
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
7
8
|
import * as Retry from "../retry.ts";
|
|
8
9
|
import * as T from "../traits.ts";
|
|
@@ -11,6 +12,19 @@ const __s: any[] = [];
|
|
|
11
12
|
|
|
12
13
|
export type { SlackOpError, SlackOpContext };
|
|
13
14
|
|
|
15
|
+
/** Span facts shared by every operation (com.distilled.telemetry#service). */
|
|
16
|
+
const TELEMETRY = {
|
|
17
|
+
system: "slack-api",
|
|
18
|
+
responseHeaders: [
|
|
19
|
+
{ header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
|
|
20
|
+
{ header: "request-id", name: "http.response.header.request-id", transform: "list" },
|
|
21
|
+
{ header: "x-slack-req-id", name: "http.response.header.x-slack-req-id", transform: "list" },
|
|
22
|
+
],
|
|
23
|
+
prefix: "Slack",
|
|
24
|
+
service: "Assistant",
|
|
25
|
+
propagate: "w3c",
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
14
28
|
export type SearchContextRequestChannelTypesItem =
|
|
15
29
|
| "public_channel"
|
|
16
30
|
| "private_channel"
|
|
@@ -40,43 +54,43 @@ export interface SearchContextRequest {
|
|
|
40
54
|
/** User prompt or search query */
|
|
41
55
|
query: string;
|
|
42
56
|
/** Send `action_token` as received in a message event. */
|
|
43
|
-
action_token?: string;
|
|
57
|
+
action_token?: string | undefined;
|
|
44
58
|
/** Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im`. */
|
|
45
|
-
channel_types?: SearchContextRequestChannelTypesList;
|
|
59
|
+
channel_types?: SearchContextRequestChannelTypesList | undefined;
|
|
46
60
|
/** Content types to include, a comma-separated list of any combination of `messages`, `files`, `channels`, `users`. */
|
|
47
|
-
content_types?: SearchContextRequestContentTypesList;
|
|
61
|
+
content_types?: SearchContextRequestContentTypesList | undefined;
|
|
48
62
|
/** Whether the results should include bots. */
|
|
49
|
-
include_bots?: boolean;
|
|
63
|
+
include_bots?: boolean | undefined;
|
|
50
64
|
/** Whether to include deleted users in the user search results. Defaults to false. */
|
|
51
|
-
include_deleted_users?: boolean;
|
|
65
|
+
include_deleted_users?: boolean | undefined;
|
|
52
66
|
/** UNIX timestamp filter. If present, filters for results before this date. */
|
|
53
|
-
before?: number;
|
|
67
|
+
before?: number | undefined;
|
|
54
68
|
/** UNIX timestamp filter. If present, filters for results after this date. */
|
|
55
|
-
after?: number;
|
|
69
|
+
after?: number | undefined;
|
|
56
70
|
/** Whether to include context messages surrounding the main message result. Defaults to false if unspecified. */
|
|
57
|
-
include_context_messages?: boolean;
|
|
71
|
+
include_context_messages?: boolean | undefined;
|
|
58
72
|
/** Context channel ID to support scoping the search when applicable. */
|
|
59
|
-
context_channel_id?: string;
|
|
73
|
+
context_channel_id?: string | undefined;
|
|
60
74
|
/** The cursor returned by the API. Leave this blank for the first request and use this to get the next page of results. */
|
|
61
|
-
cursor?: string;
|
|
75
|
+
cursor?: string | undefined;
|
|
62
76
|
/** Number of results to return, up to a max of 20. Defaults to 20. */
|
|
63
|
-
limit?: number;
|
|
77
|
+
limit?: number | undefined;
|
|
64
78
|
/** The field to sort the results by. Defaults to score. Can be one of: score, timestamp. */
|
|
65
|
-
sort?: SearchContextRequestSort | (string & {});
|
|
79
|
+
sort?: SearchContextRequestSort | (string & {}) | undefined;
|
|
66
80
|
/** The direction to sort the results by. Defaults to desc. */
|
|
67
|
-
sort_dir?: SearchContextRequestSortDir | (string & {});
|
|
81
|
+
sort_dir?: SearchContextRequestSortDir | (string & {}) | undefined;
|
|
68
82
|
/** Whether to return the message blocks in the response. */
|
|
69
|
-
include_message_blocks?: boolean;
|
|
83
|
+
include_message_blocks?: boolean | undefined;
|
|
70
84
|
/** Whether to highlight the search query in the results. Defaults to false if unspecified. */
|
|
71
|
-
highlight?: boolean;
|
|
85
|
+
highlight?: boolean | undefined;
|
|
72
86
|
/** A list of term clauses. A term clause is a string with search terms. Search results returned will match every term clause specified (i.e., conjunctive normal form). */
|
|
73
|
-
term_clauses?: SearchContextRequestTermClausesList;
|
|
87
|
+
term_clauses?: SearchContextRequestTermClausesList | undefined;
|
|
74
88
|
/** A string containing only modifiers in the format of `modifier:value`. Search results returned will match the modifier value. For now modifiers only affect term clauses. */
|
|
75
|
-
modifiers?: string;
|
|
89
|
+
modifiers?: string | undefined;
|
|
76
90
|
/** Whether to include archived channels in the search results. */
|
|
77
|
-
include_archived_channels?: boolean;
|
|
91
|
+
include_archived_channels?: boolean | undefined;
|
|
78
92
|
/** Whether to disable semantic search. When true, only keyword-based search is used. Defaults to false. */
|
|
79
|
-
disable_semantic_search?: boolean;
|
|
93
|
+
disable_semantic_search?: boolean | undefined;
|
|
80
94
|
}
|
|
81
95
|
/** Messages before the current message, if applicable. */
|
|
82
96
|
export type SearchContextResponseResultsMessagesItemContextMessagesBeforeList = Array<unknown>;
|
|
@@ -84,9 +98,9 @@ export type SearchContextResponseResultsMessagesItemContextMessagesBeforeList =
|
|
|
84
98
|
export type SearchContextResponseResultsMessagesItemContextMessagesAfterList = Array<unknown>;
|
|
85
99
|
export interface SearchContextResponseResultsMessagesItemContextMessages {
|
|
86
100
|
/** Messages before the current message, if applicable. */
|
|
87
|
-
before?: SearchContextResponseResultsMessagesItemContextMessagesBeforeList;
|
|
101
|
+
before?: SearchContextResponseResultsMessagesItemContextMessagesBeforeList | undefined;
|
|
88
102
|
/** Messages after the current message. */
|
|
89
|
-
after?: SearchContextResponseResultsMessagesItemContextMessagesAfterList;
|
|
103
|
+
after?: SearchContextResponseResultsMessagesItemContextMessagesAfterList | undefined;
|
|
90
104
|
}
|
|
91
105
|
/** Blocks from the retrieved message. */
|
|
92
106
|
export type SearchContextResponseResultsMessagesItemBlocksList = Array<unknown>;
|
|
@@ -94,7 +108,7 @@ export interface SearchContextResponseResultsMessagesItem {
|
|
|
94
108
|
/** Full name of the user who authored the message. */
|
|
95
109
|
author_name: string;
|
|
96
110
|
/** Email address of the user who authored the message, if visible to the searching user. */
|
|
97
|
-
author_email?: string;
|
|
111
|
+
author_email?: string | undefined;
|
|
98
112
|
/** ID of the user who authored the message. */
|
|
99
113
|
author_user_id: string;
|
|
100
114
|
/** ID of the workspace in which the message was sent. */
|
|
@@ -110,10 +124,10 @@ export interface SearchContextResponseResultsMessagesItem {
|
|
|
110
124
|
/** Whether the message was authored by a bot (app) or not. */
|
|
111
125
|
is_author_bot: boolean;
|
|
112
126
|
permalink: string;
|
|
113
|
-
context_messages?: SearchContextResponseResultsMessagesItemContextMessages;
|
|
127
|
+
context_messages?: SearchContextResponseResultsMessagesItemContextMessages | undefined;
|
|
114
128
|
/** Blocks from the retrieved message. */
|
|
115
|
-
blocks?: SearchContextResponseResultsMessagesItemBlocksList;
|
|
116
|
-
reply_count?: number;
|
|
129
|
+
blocks?: SearchContextResponseResultsMessagesItemBlocksList | undefined;
|
|
130
|
+
reply_count?: number | undefined;
|
|
117
131
|
}
|
|
118
132
|
export type SearchContextResponseResultsMessagesList =
|
|
119
133
|
Array<SearchContextResponseResultsMessagesItem>;
|
|
@@ -121,7 +135,7 @@ export interface SearchContextResponseResultsFilesItem {
|
|
|
121
135
|
/** Full name of the user who uploaded or created the file. */
|
|
122
136
|
author_name: string;
|
|
123
137
|
/** Email address of the user who uploaded or created the file, if visible to the searching user */
|
|
124
|
-
author_email?: string;
|
|
138
|
+
author_email?: string | undefined;
|
|
125
139
|
/** ID of the user who uploaded or created the file. */
|
|
126
140
|
author_user_id: string;
|
|
127
141
|
/** ID of the user who uploaded the file. */
|
|
@@ -143,17 +157,23 @@ export interface SearchContextResponseResultsFilesItem {
|
|
|
143
157
|
/** Content from the retrieved file. */
|
|
144
158
|
content: string;
|
|
145
159
|
/** Size of the file in bytes. */
|
|
146
|
-
size?: number;
|
|
160
|
+
size?: number | undefined;
|
|
147
161
|
}
|
|
148
162
|
export type SearchContextResponseResultsFilesList = Array<SearchContextResponseResultsFilesItem>;
|
|
149
163
|
export type SearchContextResponseResultsEnterpriseList = Array<unknown>;
|
|
164
|
+
/** Type of the channel */
|
|
165
|
+
export type SearchContextResponseResultsChannelsItemChannelType =
|
|
166
|
+
| "public_channel"
|
|
167
|
+
| "private_channel"
|
|
168
|
+
| "mpim"
|
|
169
|
+
| "im";
|
|
150
170
|
export interface SearchContextResponseResultsChannelsItem {
|
|
151
171
|
/** ID of the workspace in which the channel was created. */
|
|
152
172
|
team_id: string;
|
|
153
173
|
/** ID of the user who created the channel. */
|
|
154
174
|
creator_user_id: string;
|
|
155
175
|
/** Full name of the user who created the channel. */
|
|
156
|
-
creator_name?: string;
|
|
176
|
+
creator_name?: string | undefined;
|
|
157
177
|
/** Epoch timestamp in microseconds at which the channel was created. */
|
|
158
178
|
date_created: number;
|
|
159
179
|
/** Epoch timestamp in microseconds at which the channel was updated. */
|
|
@@ -161,13 +181,15 @@ export interface SearchContextResponseResultsChannelsItem {
|
|
|
161
181
|
/** Name of the channel. */
|
|
162
182
|
name: string;
|
|
163
183
|
/** Topic of the channel. */
|
|
164
|
-
topic?: string;
|
|
184
|
+
topic?: string | undefined;
|
|
165
185
|
/** Purpose of the channel. */
|
|
166
|
-
purpose?: string;
|
|
186
|
+
purpose?: string | undefined;
|
|
167
187
|
/** Permanent link to the channel in Slack. */
|
|
168
188
|
permalink: string;
|
|
169
189
|
/** Whether the channel is archived. */
|
|
170
190
|
is_archived: boolean;
|
|
191
|
+
/** Type of the channel */
|
|
192
|
+
channel_type: SearchContextResponseResultsChannelsItemChannelType;
|
|
171
193
|
}
|
|
172
194
|
export type SearchContextResponseResultsChannelsList =
|
|
173
195
|
Array<SearchContextResponseResultsChannelsItem>;
|
|
@@ -177,7 +199,7 @@ export interface SearchContextResponseResultsUsersItem {
|
|
|
177
199
|
/** The permalink to the user in Slack */
|
|
178
200
|
permalink: string;
|
|
179
201
|
/** The permalink to the user's profile photo. */
|
|
180
|
-
profile_pic_permalink?: string;
|
|
202
|
+
profile_pic_permalink?: string | undefined;
|
|
181
203
|
/** The user's full name, which might be different from the display name. */
|
|
182
204
|
full_name: string;
|
|
183
205
|
/** The user's job title. */
|
|
@@ -189,23 +211,33 @@ export interface SearchContextResponseResultsUsersItem {
|
|
|
189
211
|
}
|
|
190
212
|
export type SearchContextResponseResultsUsersList = Array<SearchContextResponseResultsUsersItem>;
|
|
191
213
|
export interface SearchContextResponseResults {
|
|
192
|
-
messages?: SearchContextResponseResultsMessagesList;
|
|
193
|
-
files?: SearchContextResponseResultsFilesList;
|
|
194
|
-
enterprise?: SearchContextResponseResultsEnterpriseList;
|
|
195
|
-
channels?: SearchContextResponseResultsChannelsList;
|
|
196
|
-
users?: SearchContextResponseResultsUsersList;
|
|
214
|
+
messages?: SearchContextResponseResultsMessagesList | undefined;
|
|
215
|
+
files?: SearchContextResponseResultsFilesList | undefined;
|
|
216
|
+
enterprise?: SearchContextResponseResultsEnterpriseList | undefined;
|
|
217
|
+
channels?: SearchContextResponseResultsChannelsList | undefined;
|
|
218
|
+
users?: SearchContextResponseResultsUsersList | undefined;
|
|
197
219
|
}
|
|
198
220
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
199
221
|
export interface SearchContextResponseResponseMetadata {
|
|
200
222
|
/** Cursor for the next page -- pass as `cursor` on the next call. */
|
|
201
|
-
next_cursor?: string;
|
|
223
|
+
next_cursor?: string | undefined;
|
|
202
224
|
}
|
|
225
|
+
export type SearchContextResponseFailedContentTypesItem =
|
|
226
|
+
| "messages"
|
|
227
|
+
| "files"
|
|
228
|
+
| "channels"
|
|
229
|
+
| "users";
|
|
230
|
+
/** Requested content types whose search failed. Their lists in `results` are empty because they could not be searched, not because nothing matched. Present only when at least one failed; see the `content_type_search_failed` warning. */
|
|
231
|
+
export type SearchContextResponseFailedContentTypesList =
|
|
232
|
+
Array<SearchContextResponseFailedContentTypesItem>;
|
|
203
233
|
export interface SearchContextResponse {
|
|
204
234
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
205
235
|
ok: boolean;
|
|
206
236
|
results: SearchContextResponseResults;
|
|
207
237
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
208
|
-
response_metadata?: SearchContextResponseResponseMetadata;
|
|
238
|
+
response_metadata?: SearchContextResponseResponseMetadata | undefined;
|
|
239
|
+
/** Requested content types whose search failed. Their lists in `results` are empty because they could not be searched, not because nothing matched. Present only when at least one failed; see the `content_type_search_failed` warning. */
|
|
240
|
+
failed_content_types: SearchContextResponseFailedContentTypesList;
|
|
209
241
|
}
|
|
210
242
|
export interface SearchInfoRequest {}
|
|
211
243
|
export interface SearchInfoResponse {
|
|
@@ -224,13 +256,13 @@ export interface SetStatusRequest {
|
|
|
224
256
|
/** Status of the specified bot user, e.g., 'is thinking...'. A two minute timeout applies, which will cause the status to be removed if no message has been sent. */
|
|
225
257
|
status: string;
|
|
226
258
|
/** The list of messages to rotate through as a loading indicator. Maximum of 10 messages. */
|
|
227
|
-
loading_messages?: SetStatusRequestLoadingMessagesList;
|
|
259
|
+
loading_messages?: SetStatusRequestLoadingMessagesList | undefined;
|
|
228
260
|
/** Emoji to use as the icon for this message. Overrides `icon_url`. */
|
|
229
|
-
icon_emoji?: string;
|
|
261
|
+
icon_emoji?: string | undefined;
|
|
230
262
|
/** Image URL to use as the icon for this message. */
|
|
231
|
-
icon_url?: string;
|
|
263
|
+
icon_url?: string | undefined;
|
|
232
264
|
/** The bot's username to display. */
|
|
233
|
-
username?: string;
|
|
265
|
+
username?: string | undefined;
|
|
234
266
|
}
|
|
235
267
|
export interface SetStatusResponse {
|
|
236
268
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -240,11 +272,11 @@ export interface SetSuggestedPromptsRequest {
|
|
|
240
272
|
/** Channel ID containing the assistant thread. */
|
|
241
273
|
channel_id: string;
|
|
242
274
|
/** Message timestamp of the thread to set suggested prompts for. If not provided, the prompts will be set for the latest message in the channel. */
|
|
243
|
-
thread_ts?: string;
|
|
275
|
+
thread_ts?: string | undefined;
|
|
244
276
|
/** Each prompt should be supplied with its `title` and `message` attribute. */
|
|
245
277
|
prompts: unknown;
|
|
246
278
|
/** Title for the list of provided prompts. For example: Suggested Prompts, Related Questions. */
|
|
247
|
-
title?: string;
|
|
279
|
+
title?: string | undefined;
|
|
248
280
|
}
|
|
249
281
|
export interface SetSuggestedPromptsResponse {
|
|
250
282
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -263,19 +295,32 @@ export interface SetTitleResponse {
|
|
|
263
295
|
ok: boolean;
|
|
264
296
|
}
|
|
265
297
|
export type SearchContextError = SlackOpError;
|
|
266
|
-
/** Searches messages, files, channels and users across your Slack organization. Required scopes -- user: `search:read.public`, `search:read.private`, `search:read.im`, `search:read.mpim`, `search:read.files`, `search:read.users`; bot: `search:read.public`, `search:read.files`, `search:read.users` Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal error. - `rate_limited` -- Rate limited. - `missing_query` -- Missing query. - `query_too_long` -- Query too long. - `feature_not_enabled` -- The feature is not available on the current workspace. - `invalid_action_token` -- The `action_token` provided is not valid. - `invalid_cursor` -- The cursormark provided is not valid. - `context_channel_not_found` -- Specified `context_channel_id` is invalid or the user lacks permission to view it. - `missing_scope` -- The requested channel types are not allowed by the provided scopes. - `assistant_search_context_disabled` -- We're having issues returning your search results. Please wait and try again. See https://docs.slack.dev/reference/methods/assistant.search.context */
|
|
267
|
-
export const searchContext: API.
|
|
298
|
+
/** Searches messages, files, channels and users across your Slack organization. Required scopes -- user: `search:read.public`, `search:read.private`, `search:read.im`, `search:read.mpim`, `search:read.files`, `search:read.users`; bot: `search:read.public`, `search:read.files`, `search:read.users` Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal error. - `rate_limited` -- Rate limited. - `missing_query` -- Missing query. - `query_too_long` -- Query too long. - `feature_not_enabled` -- The feature is not available on the current workspace. - `invalid_action_token` -- The `action_token` provided is not valid, has expired, or was not issued to the app whose token accompanies it. - `invalid_cursor` -- The cursormark provided is not valid. - `context_channel_not_found` -- Specified `context_channel_id` is invalid or the user lacks permission to view it. - `missing_scope` -- The requested channel types are not allowed by the provided scopes. - `assistant_search_context_disabled` -- We're having issues returning your search results. Please wait and try again. - `restricted_action` -- The calling user is a guest, or is not an active member of the workspace. See https://docs.slack.dev/reference/methods/assistant.search.context */
|
|
299
|
+
export const searchContext: API.PaginatedOperationMethod<
|
|
268
300
|
SearchContextRequest,
|
|
269
301
|
SearchContextResponse,
|
|
270
302
|
SearchContextError,
|
|
271
|
-
SlackOpContext
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
303
|
+
SlackOpContext,
|
|
304
|
+
SearchContextResponseFailedContentTypesItem
|
|
305
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
306
|
+
() => ({
|
|
307
|
+
input: __S(1, __c0, 1) as any as S.Schema<SearchContextRequest>,
|
|
308
|
+
output: __S(14, __c0, 14) as any as S.Schema<SearchContextResponse>,
|
|
309
|
+
errors: [SlackError, SlackRateLimited],
|
|
310
|
+
protocol: SlackProtocol,
|
|
311
|
+
retry: Retry.Retry,
|
|
312
|
+
telemetry: TELEMETRY,
|
|
313
|
+
span: "SearchContext",
|
|
314
|
+
pagination: {
|
|
315
|
+
mode: "cursor",
|
|
316
|
+
inputToken: "cursor",
|
|
317
|
+
outputToken: "response_metadata.next_cursor",
|
|
318
|
+
items: "failed_content_types",
|
|
319
|
+
pageSize: "limit",
|
|
320
|
+
} as const,
|
|
321
|
+
}),
|
|
322
|
+
slackPaginate,
|
|
323
|
+
) as any;
|
|
279
324
|
|
|
280
325
|
export type SearchInfoError = SlackOpError;
|
|
281
326
|
/** Returns search capabilities on a given team. Required scopes -- user: `search:read.public`; bot: `search:read.public` Rate limit tier: 2 See https://docs.slack.dev/reference/methods/assistant.search.info */
|
|
@@ -290,6 +335,8 @@ export const searchInfo: API.OperationMethod<
|
|
|
290
335
|
errors: [SlackError, SlackRateLimited],
|
|
291
336
|
protocol: SlackProtocol,
|
|
292
337
|
retry: Retry.Retry,
|
|
338
|
+
telemetry: TELEMETRY,
|
|
339
|
+
span: "SearchInfo",
|
|
293
340
|
}));
|
|
294
341
|
|
|
295
342
|
export type SetStatusError = SlackOpError;
|
|
@@ -305,6 +352,8 @@ export const setStatus: API.OperationMethod<
|
|
|
305
352
|
errors: [SlackError, SlackRateLimited],
|
|
306
353
|
protocol: SlackProtocol,
|
|
307
354
|
retry: Retry.Retry,
|
|
355
|
+
telemetry: TELEMETRY,
|
|
356
|
+
span: "SetStatus",
|
|
308
357
|
}));
|
|
309
358
|
|
|
310
359
|
export type SetSuggestedPromptsError = SlackOpError;
|
|
@@ -320,6 +369,8 @@ export const setSuggestedPrompts: API.OperationMethod<
|
|
|
320
369
|
errors: [SlackError, SlackRateLimited],
|
|
321
370
|
protocol: SlackProtocol,
|
|
322
371
|
retry: Retry.Retry,
|
|
372
|
+
telemetry: TELEMETRY,
|
|
373
|
+
span: "SetSuggestedPrompts",
|
|
323
374
|
}));
|
|
324
375
|
|
|
325
376
|
export type SetTitleError = SlackOpError;
|
|
@@ -335,6 +386,8 @@ export const setTitle: API.OperationMethod<
|
|
|
335
386
|
errors: [SlackError, SlackRateLimited],
|
|
336
387
|
protocol: SlackProtocol,
|
|
337
388
|
retry: Retry.Retry,
|
|
389
|
+
telemetry: TELEMETRY,
|
|
390
|
+
span: "SetTitle",
|
|
338
391
|
}));
|
|
339
392
|
|
|
340
393
|
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
@@ -429,6 +482,7 @@ function __c0(j: number): any {
|
|
|
429
482
|
purpose: S.optional(S.String),
|
|
430
483
|
permalink: S.String,
|
|
431
484
|
is_archived: S.Boolean,
|
|
485
|
+
channel_type: S.String,
|
|
432
486
|
}),
|
|
433
487
|
).annotate({ identifier: "SearchContextResponseResultsChannelsItem" });
|
|
434
488
|
case 9:
|
|
@@ -469,6 +523,7 @@ function __c0(j: number): any {
|
|
|
469
523
|
ok: S.Boolean,
|
|
470
524
|
results: __S(12, __c0, 12),
|
|
471
525
|
response_metadata: S.optional(__S(13, __c0, 13)),
|
|
526
|
+
failed_content_types: __S(0, __c0, 0),
|
|
472
527
|
}),
|
|
473
528
|
).annotate({ identifier: "SearchContextResponse" });
|
|
474
529
|
}
|
package/src/services/auth.ts
CHANGED
|
@@ -12,49 +12,62 @@ const __s: any[] = [];
|
|
|
12
12
|
|
|
13
13
|
export type { SlackOpError, SlackOpContext };
|
|
14
14
|
|
|
15
|
+
/** Span facts shared by every operation (com.distilled.telemetry#service). */
|
|
16
|
+
const TELEMETRY = {
|
|
17
|
+
system: "slack-api",
|
|
18
|
+
responseHeaders: [
|
|
19
|
+
{ header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
|
|
20
|
+
{ header: "request-id", name: "http.response.header.request-id", transform: "list" },
|
|
21
|
+
{ header: "x-slack-req-id", name: "http.response.header.x-slack-req-id", transform: "list" },
|
|
22
|
+
],
|
|
23
|
+
prefix: "Slack",
|
|
24
|
+
service: "Auth",
|
|
25
|
+
propagate: "w3c",
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
15
28
|
export interface ListTeamsRequest {
|
|
16
29
|
/** The maximum number of workspaces to return. Must be a positive integer no larger than 1000. */
|
|
17
|
-
limit?: number;
|
|
30
|
+
limit?: number | undefined;
|
|
18
31
|
/** Set `cursor` to `next_cursor` returned by the previous call to list items in the next page. */
|
|
19
|
-
cursor?: string;
|
|
32
|
+
cursor?: string | undefined;
|
|
20
33
|
/** Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace. */
|
|
21
|
-
include_icon?: boolean;
|
|
34
|
+
include_icon?: boolean | undefined;
|
|
22
35
|
}
|
|
23
36
|
/** Paths to icons */
|
|
24
37
|
export interface ListTeamsResponseTeamsItemIcon {
|
|
25
|
-
image_34?: string;
|
|
26
|
-
image_44?: string;
|
|
27
|
-
image_68?: string;
|
|
28
|
-
image_88?: string;
|
|
29
|
-
image_102?: string;
|
|
30
|
-
image_132?: string;
|
|
31
|
-
image_230?: string;
|
|
32
|
-
image_default?: boolean;
|
|
38
|
+
image_34?: string | undefined;
|
|
39
|
+
image_44?: string | undefined;
|
|
40
|
+
image_68?: string | undefined;
|
|
41
|
+
image_88?: string | undefined;
|
|
42
|
+
image_102?: string | undefined;
|
|
43
|
+
image_132?: string | undefined;
|
|
44
|
+
image_230?: string | undefined;
|
|
45
|
+
image_default?: boolean | undefined;
|
|
33
46
|
}
|
|
34
47
|
export interface ListTeamsResponseTeamsItem {
|
|
35
48
|
/** ID of the workspace */
|
|
36
|
-
id?: string;
|
|
49
|
+
id?: string | undefined;
|
|
37
50
|
/** Name of the workspace */
|
|
38
51
|
name: string;
|
|
39
52
|
/** Paths to icons */
|
|
40
|
-
icon?: ListTeamsResponseTeamsItemIcon;
|
|
53
|
+
icon?: ListTeamsResponseTeamsItemIcon | undefined;
|
|
41
54
|
}
|
|
42
55
|
export type ListTeamsResponseTeamsList = Array<ListTeamsResponseTeamsItem>;
|
|
43
56
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
44
57
|
export interface ListTeamsResponseResponseMetadata {
|
|
45
58
|
/** Cursor for the next page -- pass as `cursor` on the next call. */
|
|
46
|
-
next_cursor?: string;
|
|
59
|
+
next_cursor?: string | undefined;
|
|
47
60
|
}
|
|
48
61
|
export interface ListTeamsResponse {
|
|
49
62
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
50
63
|
ok: boolean;
|
|
51
64
|
teams: ListTeamsResponseTeamsList;
|
|
52
65
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
53
|
-
response_metadata?: ListTeamsResponseResponseMetadata;
|
|
66
|
+
response_metadata?: ListTeamsResponseResponseMetadata | undefined;
|
|
54
67
|
}
|
|
55
68
|
export interface RevokeAuthRequest {
|
|
56
69
|
/** Setting this parameter to `1` triggers a _testing mode_ where the specified token will not actually be revoked. */
|
|
57
|
-
test?: boolean;
|
|
70
|
+
test?: boolean | undefined;
|
|
58
71
|
}
|
|
59
72
|
export interface RevokeAuthResponse {
|
|
60
73
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -65,17 +78,17 @@ export interface TestAuthRequest {}
|
|
|
65
78
|
export interface TestAuthResponse {
|
|
66
79
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
67
80
|
ok: boolean;
|
|
68
|
-
user_id?: string;
|
|
69
|
-
url?: string;
|
|
70
|
-
team_id?: string;
|
|
71
|
-
user?: string | null;
|
|
72
|
-
team?: string;
|
|
73
|
-
app_id?: string;
|
|
74
|
-
app_name?: string;
|
|
75
|
-
enterprise_id?: string;
|
|
76
|
-
bot_id?: string;
|
|
77
|
-
is_enterprise_install?: boolean;
|
|
78
|
-
expires_in?: number | null;
|
|
81
|
+
user_id?: string | undefined;
|
|
82
|
+
url?: string | undefined;
|
|
83
|
+
team_id?: string | undefined;
|
|
84
|
+
user?: string | null | undefined;
|
|
85
|
+
team?: string | undefined;
|
|
86
|
+
app_id?: string | undefined;
|
|
87
|
+
app_name?: string | undefined;
|
|
88
|
+
enterprise_id?: string | undefined;
|
|
89
|
+
bot_id?: string | undefined;
|
|
90
|
+
is_enterprise_install?: boolean | undefined;
|
|
91
|
+
expires_in?: number | null | undefined;
|
|
79
92
|
}
|
|
80
93
|
export type ListTeamsError = SlackOpError;
|
|
81
94
|
/** Obtain a full list of workspaces your org-wide app has been approved for. Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Invalid cursor. - `invalid_limit` -- The value passed for `limit` was not valid. - `invalid_auth` -- The token doesn't have access to this endpoint. - `internal_error` -- There was an internal error. See https://docs.slack.dev/reference/methods/auth.teams.list */
|
|
@@ -92,6 +105,8 @@ export const listTeams: API.PaginatedOperationMethod<
|
|
|
92
105
|
errors: [SlackError, SlackRateLimited],
|
|
93
106
|
protocol: SlackProtocol,
|
|
94
107
|
retry: Retry.Retry,
|
|
108
|
+
telemetry: TELEMETRY,
|
|
109
|
+
span: "ListTeams",
|
|
95
110
|
pagination: {
|
|
96
111
|
mode: "cursor",
|
|
97
112
|
inputToken: "cursor",
|
|
@@ -116,6 +131,8 @@ export const revokeAuth: API.OperationMethod<
|
|
|
116
131
|
errors: [SlackError, SlackRateLimited],
|
|
117
132
|
protocol: SlackProtocol,
|
|
118
133
|
retry: Retry.Retry,
|
|
134
|
+
telemetry: TELEMETRY,
|
|
135
|
+
span: "RevokeAuth",
|
|
119
136
|
}));
|
|
120
137
|
|
|
121
138
|
export type TestAuthError = SlackOpError;
|
|
@@ -131,6 +148,8 @@ export const testAuth: API.OperationMethod<
|
|
|
131
148
|
errors: [SlackError, SlackRateLimited],
|
|
132
149
|
protocol: SlackProtocol,
|
|
133
150
|
retry: Retry.Retry,
|
|
151
|
+
telemetry: TELEMETRY,
|
|
152
|
+
span: "TestAuth",
|
|
134
153
|
}));
|
|
135
154
|
|
|
136
155
|
// Schema builders: each runs one schema initializer, on that schema's first use.
|
package/src/services/blocks.ts
CHANGED
|
@@ -11,17 +11,30 @@ const __s: any[] = [];
|
|
|
11
11
|
|
|
12
12
|
export type { SlackOpError, SlackOpContext };
|
|
13
13
|
|
|
14
|
+
/** Span facts shared by every operation (com.distilled.telemetry#service). */
|
|
15
|
+
const TELEMETRY = {
|
|
16
|
+
system: "slack-api",
|
|
17
|
+
responseHeaders: [
|
|
18
|
+
{ header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
|
|
19
|
+
{ header: "request-id", name: "http.response.header.request-id", transform: "list" },
|
|
20
|
+
{ header: "x-slack-req-id", name: "http.response.header.x-slack-req-id", transform: "list" },
|
|
21
|
+
],
|
|
22
|
+
prefix: "Slack",
|
|
23
|
+
service: "Blocks",
|
|
24
|
+
propagate: "w3c",
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
14
27
|
export type ValidateBlockRequestBlocksCase1ItemMap = { [key: string]: unknown | undefined };
|
|
15
28
|
export type ValidateBlockRequestBlocksCase1List = Array<ValidateBlockRequestBlocksCase1ItemMap>;
|
|
16
29
|
/** A JSON-encoded array of [structured blocks](/reference/block-kit/blocks). Provide exactly one of `blocks`, `view`, or `message`. */
|
|
17
30
|
export type ValidateBlockRequestBlocks = string | ValidateBlockRequestBlocksCase1List;
|
|
18
31
|
export interface ValidateBlockRequest {
|
|
19
32
|
/** A JSON-encoded array of [structured blocks](/reference/block-kit/blocks). Provide exactly one of `blocks`, `view`, or `message`. */
|
|
20
|
-
blocks?: ValidateBlockRequestBlocks;
|
|
33
|
+
blocks?: ValidateBlockRequestBlocks | undefined;
|
|
21
34
|
/** A JSON-encoded [message payload](/messaging/creating-interactive-messages) to validate. Provide exactly one of `blocks`, `view`, or `message`. */
|
|
22
|
-
message?: string;
|
|
35
|
+
message?: string | undefined;
|
|
23
36
|
/** A JSON-encoded [view payload](/reference/views) to validate. Provide exactly one of `blocks`, `view`, or `message`. */
|
|
24
|
-
view?: string;
|
|
37
|
+
view?: string | undefined;
|
|
25
38
|
}
|
|
26
39
|
export interface ValidateBlockResponse {
|
|
27
40
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -40,6 +53,8 @@ export const validateBlock: API.OperationMethod<
|
|
|
40
53
|
errors: [SlackError, SlackRateLimited],
|
|
41
54
|
protocol: SlackProtocol,
|
|
42
55
|
retry: Retry.Retry,
|
|
56
|
+
telemetry: TELEMETRY,
|
|
57
|
+
span: "ValidateBlock",
|
|
43
58
|
}));
|
|
44
59
|
|
|
45
60
|
// Schema builders: each runs one schema initializer, on that schema's first use.
|