@distilled.cloud/slack 0.0.0 → 1.0.0-rc.9

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.
Files changed (212) hide show
  1. package/LICENSE +201 -0
  2. package/lib/credentials.d.ts +27 -0
  3. package/lib/credentials.d.ts.map +1 -0
  4. package/lib/credentials.js +53 -0
  5. package/lib/credentials.js.map +1 -0
  6. package/lib/errors.d.ts +83 -0
  7. package/lib/errors.d.ts.map +1 -0
  8. package/lib/errors.js +59 -0
  9. package/lib/errors.js.map +1 -0
  10. package/lib/index.d.ts +17 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +17 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/pagination.d.ts +31 -0
  15. package/lib/pagination.d.ts.map +1 -0
  16. package/lib/pagination.js +31 -0
  17. package/lib/pagination.js.map +1 -0
  18. package/lib/protocol.d.ts +18 -0
  19. package/lib/protocol.d.ts.map +1 -0
  20. package/lib/protocol.js +230 -0
  21. package/lib/protocol.js.map +1 -0
  22. package/lib/retry.d.ts +52 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +45 -0
  25. package/lib/retry.js.map +1 -0
  26. package/lib/services/admin.d.ts +2796 -0
  27. package/lib/services/admin.d.ts.map +1 -0
  28. package/lib/services/admin.js +3225 -0
  29. package/lib/services/admin.js.map +1 -0
  30. package/lib/services/api.d.ts +23 -0
  31. package/lib/services/api.d.ts.map +1 -0
  32. package/lib/services/api.js +26 -0
  33. package/lib/services/api.js.map +1 -0
  34. package/lib/services/apps.d.ts +568 -0
  35. package/lib/services/apps.d.ts.map +1 -0
  36. package/lib/services/apps.js +584 -0
  37. package/lib/services/apps.js.map +1 -0
  38. package/lib/services/assistant.d.ts +290 -0
  39. package/lib/services/assistant.d.ts.map +1 -0
  40. package/lib/services/assistant.js +232 -0
  41. package/lib/services/assistant.js.map +1 -0
  42. package/lib/services/auth.d.ts +90 -0
  43. package/lib/services/auth.d.ts.map +1 -0
  44. package/lib/services/auth.js +114 -0
  45. package/lib/services/auth.js.map +1 -0
  46. package/lib/services/blocks.d.ts +31 -0
  47. package/lib/services/blocks.d.ts.map +1 -0
  48. package/lib/services/blocks.js +31 -0
  49. package/lib/services/blocks.js.map +1 -0
  50. package/lib/services/bookmarks.d.ts +91 -0
  51. package/lib/services/bookmarks.d.ts.map +1 -0
  52. package/lib/services/bookmarks.js +98 -0
  53. package/lib/services/bookmarks.js.map +1 -0
  54. package/lib/services/bots.d.ts +60 -0
  55. package/lib/services/bots.d.ts.map +1 -0
  56. package/lib/services/bots.js +68 -0
  57. package/lib/services/bots.js.map +1 -0
  58. package/lib/services/calls.d.ts +124 -0
  59. package/lib/services/calls.d.ts.map +1 -0
  60. package/lib/services/calls.js +136 -0
  61. package/lib/services/calls.js.map +1 -0
  62. package/lib/services/canvases.d.ts +152 -0
  63. package/lib/services/canvases.d.ts.map +1 -0
  64. package/lib/services/canvases.js +152 -0
  65. package/lib/services/canvases.js.map +1 -0
  66. package/lib/services/chat.d.ts +525 -0
  67. package/lib/services/chat.d.ts.map +1 -0
  68. package/lib/services/chat.js +436 -0
  69. package/lib/services/chat.js.map +1 -0
  70. package/lib/services/conversations.d.ts +642 -0
  71. package/lib/services/conversations.d.ts.map +1 -0
  72. package/lib/services/conversations.js +769 -0
  73. package/lib/services/conversations.js.map +1 -0
  74. package/lib/services/dialog.d.ts +20 -0
  75. package/lib/services/dialog.d.ts.map +1 -0
  76. package/lib/services/dialog.js +27 -0
  77. package/lib/services/dialog.js.map +1 -0
  78. package/lib/services/dnd.d.ts +94 -0
  79. package/lib/services/dnd.d.ts.map +1 -0
  80. package/lib/services/dnd.js +111 -0
  81. package/lib/services/dnd.js.map +1 -0
  82. package/lib/services/emoji.d.ts +35 -0
  83. package/lib/services/emoji.d.ts.map +1 -0
  84. package/lib/services/emoji.js +40 -0
  85. package/lib/services/emoji.js.map +1 -0
  86. package/lib/services/entity.d.ts +93 -0
  87. package/lib/services/entity.d.ts.map +1 -0
  88. package/lib/services/entity.js +89 -0
  89. package/lib/services/entity.js.map +1 -0
  90. package/lib/services/files.d.ts +473 -0
  91. package/lib/services/files.d.ts.map +1 -0
  92. package/lib/services/files.js +510 -0
  93. package/lib/services/files.js.map +1 -0
  94. package/lib/services/functions.d.ts +235 -0
  95. package/lib/services/functions.d.ts.map +1 -0
  96. package/lib/services/functions.js +261 -0
  97. package/lib/services/functions.js.map +1 -0
  98. package/lib/services/index.d.ts +35 -0
  99. package/lib/services/index.d.ts.map +1 -0
  100. package/lib/services/index.js +36 -0
  101. package/lib/services/index.js.map +1 -0
  102. package/lib/services/lists.d.ts +300 -0
  103. package/lib/services/lists.d.ts.map +1 -0
  104. package/lib/services/lists.js +366 -0
  105. package/lib/services/lists.js.map +1 -0
  106. package/lib/services/migration.d.ts +34 -0
  107. package/lib/services/migration.d.ts.map +1 -0
  108. package/lib/services/migration.js +36 -0
  109. package/lib/services/migration.js.map +1 -0
  110. package/lib/services/oauth.d.ts +307 -0
  111. package/lib/services/oauth.d.ts.map +1 -0
  112. package/lib/services/oauth.js +278 -0
  113. package/lib/services/oauth.js.map +1 -0
  114. package/lib/services/openid.d.ts +86 -0
  115. package/lib/services/openid.d.ts.map +1 -0
  116. package/lib/services/openid.js +93 -0
  117. package/lib/services/openid.js.map +1 -0
  118. package/lib/services/pins.d.ts +64 -0
  119. package/lib/services/pins.d.ts.map +1 -0
  120. package/lib/services/pins.js +75 -0
  121. package/lib/services/pins.js.map +1 -0
  122. package/lib/services/reactions.d.ts +108 -0
  123. package/lib/services/reactions.d.ts.map +1 -0
  124. package/lib/services/reactions.js +119 -0
  125. package/lib/services/reactions.js.map +1 -0
  126. package/lib/services/reminders.d.ts +89 -0
  127. package/lib/services/reminders.d.ts.map +1 -0
  128. package/lib/services/reminders.js +109 -0
  129. package/lib/services/reminders.js.map +1 -0
  130. package/lib/services/rtm.d.ts +68 -0
  131. package/lib/services/rtm.d.ts.map +1 -0
  132. package/lib/services/rtm.js +74 -0
  133. package/lib/services/rtm.js.map +1 -0
  134. package/lib/services/search.d.ts +239 -0
  135. package/lib/services/search.d.ts.map +1 -0
  136. package/lib/services/search.js +190 -0
  137. package/lib/services/search.js.map +1 -0
  138. package/lib/services/stars.d.ts +126 -0
  139. package/lib/services/stars.d.ts.map +1 -0
  140. package/lib/services/stars.js +145 -0
  141. package/lib/services/stars.js.map +1 -0
  142. package/lib/services/team.d.ts +309 -0
  143. package/lib/services/team.d.ts.map +1 -0
  144. package/lib/services/team.js +336 -0
  145. package/lib/services/team.js.map +1 -0
  146. package/lib/services/tooling.d.ts +31 -0
  147. package/lib/services/tooling.d.ts.map +1 -0
  148. package/lib/services/tooling.js +38 -0
  149. package/lib/services/tooling.js.map +1 -0
  150. package/lib/services/usergroups.d.ts +183 -0
  151. package/lib/services/usergroups.d.ts.map +1 -0
  152. package/lib/services/usergroups.js +180 -0
  153. package/lib/services/usergroups.js.map +1 -0
  154. package/lib/services/users.d.ts +246 -0
  155. package/lib/services/users.d.ts.map +1 -0
  156. package/lib/services/users.js +309 -0
  157. package/lib/services/users.js.map +1 -0
  158. package/lib/services/views.d.ts +84 -0
  159. package/lib/services/views.d.ts.map +1 -0
  160. package/lib/services/views.js +95 -0
  161. package/lib/services/views.js.map +1 -0
  162. package/lib/services/workflows.d.ts +231 -0
  163. package/lib/services/workflows.d.ts.map +1 -0
  164. package/lib/services/workflows.js +240 -0
  165. package/lib/services/workflows.js.map +1 -0
  166. package/lib/traits.d.ts +11 -0
  167. package/lib/traits.d.ts.map +1 -0
  168. package/lib/traits.js +12 -0
  169. package/lib/traits.js.map +1 -0
  170. package/package.json +82 -4
  171. package/src/credentials.ts +86 -0
  172. package/src/errors.ts +101 -0
  173. package/src/index.ts +20 -0
  174. package/src/pagination.ts +35 -0
  175. package/src/protocol.ts +326 -0
  176. package/src/retry.ts +76 -0
  177. package/src/services/admin.ts +7729 -0
  178. package/src/services/api.ts +58 -0
  179. package/src/services/apps.ts +1441 -0
  180. package/src/services/assistant.ts +639 -0
  181. package/src/services/auth.ts +241 -0
  182. package/src/services/blocks.ts +80 -0
  183. package/src/services/bookmarks.ts +223 -0
  184. package/src/services/bots.ts +144 -0
  185. package/src/services/calls.ts +318 -0
  186. package/src/services/canvases.ts +392 -0
  187. package/src/services/chat.ts +1191 -0
  188. package/src/services/conversations.ts +1754 -0
  189. package/src/services/dialog.ts +55 -0
  190. package/src/services/dnd.ts +246 -0
  191. package/src/services/emoji.ts +91 -0
  192. package/src/services/entity.ts +225 -0
  193. package/src/services/files.ts +1192 -0
  194. package/src/services/functions.ts +647 -0
  195. package/src/services/index.ts +35 -0
  196. package/src/services/lists.ts +832 -0
  197. package/src/services/migration.ts +85 -0
  198. package/src/services/oauth.ts +658 -0
  199. package/src/services/openid.ts +243 -0
  200. package/src/services/pins.ts +167 -0
  201. package/src/services/reactions.ts +272 -0
  202. package/src/services/reminders.ts +240 -0
  203. package/src/services/rtm.ts +162 -0
  204. package/src/services/search.ts +507 -0
  205. package/src/services/stars.ts +323 -0
  206. package/src/services/team.ts +836 -0
  207. package/src/services/tooling.ts +78 -0
  208. package/src/services/usergroups.ts +441 -0
  209. package/src/services/users.ts +685 -0
  210. package/src/services/views.ts +212 -0
  211. package/src/services/workflows.ts +607 -0
  212. package/src/traits.ts +45 -0
@@ -0,0 +1,639 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as API from "@distilled.cloud/core/api";
4
+ import * as T from "../traits.ts";
5
+ import {
6
+ SlackProtocol,
7
+ type SlackOpError,
8
+ type SlackOpContext,
9
+ } from "../protocol.ts";
10
+ import { SlackError, SlackRateLimited } from "../errors.ts";
11
+ import * as Retry from "../retry.ts";
12
+
13
+ export type { SlackOpError, SlackOpContext };
14
+
15
+ export type SearchContextRequestChannelTypesItem =
16
+ | "public_channel"
17
+ | "private_channel"
18
+ | "mpim"
19
+ | "im";
20
+ export const SearchContextRequestChannelTypesItem = /*@__PURE__*/ S.String;
21
+
22
+ /** Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im`. */
23
+ export type SearchContextRequestChannelTypesList = Array<
24
+ SearchContextRequestChannelTypesItem | (string & {})
25
+ >;
26
+ export const SearchContextRequestChannelTypesList = /*@__PURE__*/ S.Array(
27
+ SearchContextRequestChannelTypesItem,
28
+ ) as any as S.Schema<SearchContextRequestChannelTypesList>;
29
+
30
+ export type SearchContextRequestContentTypesItem =
31
+ | "messages"
32
+ | "files"
33
+ | "enterprise"
34
+ | "channels"
35
+ | "users";
36
+ export const SearchContextRequestContentTypesItem = /*@__PURE__*/ S.String;
37
+
38
+ /** Content types to include, a comma-separated list of any combination of `messages`, `files`, `channels`, `users`. */
39
+ export type SearchContextRequestContentTypesList = Array<
40
+ SearchContextRequestContentTypesItem | (string & {})
41
+ >;
42
+ export const SearchContextRequestContentTypesList = /*@__PURE__*/ S.Array(
43
+ SearchContextRequestContentTypesItem,
44
+ ) as any as S.Schema<SearchContextRequestContentTypesList>;
45
+
46
+ /** The field to sort the results by. Defaults to score. Can be one of: score, timestamp. */
47
+ export type SearchContextRequestSort = "score" | "timestamp";
48
+ export const SearchContextRequestSort = /*@__PURE__*/ S.String;
49
+
50
+ /** The direction to sort the results by. Defaults to desc. */
51
+ export type SearchContextRequestSortDir = "asc" | "desc";
52
+ export const SearchContextRequestSortDir = /*@__PURE__*/ S.String;
53
+
54
+ /** 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). */
55
+ export type SearchContextRequestTermClausesList = Array<string>;
56
+ export const SearchContextRequestTermClausesList = /*@__PURE__*/ S.Array(
57
+ S.String,
58
+ ) as any as S.Schema<SearchContextRequestTermClausesList>;
59
+
60
+ export interface SearchContextRequest {
61
+ /** User prompt or search query */
62
+ query: string;
63
+ /** Send `action_token` as received in a message event. */
64
+ action_token?: string;
65
+ /** Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im`. */
66
+ channel_types?: SearchContextRequestChannelTypesList;
67
+ /** Content types to include, a comma-separated list of any combination of `messages`, `files`, `channels`, `users`. */
68
+ content_types?: SearchContextRequestContentTypesList;
69
+ /** Whether the results should include bots. */
70
+ include_bots?: boolean;
71
+ /** Whether to include deleted users in the user search results. Defaults to false. */
72
+ include_deleted_users?: boolean;
73
+ /** UNIX timestamp filter. If present, filters for results before this date. */
74
+ before?: number;
75
+ /** UNIX timestamp filter. If present, filters for results after this date. */
76
+ after?: number;
77
+ /** Whether to include context messages surrounding the main message result. Defaults to false if unspecified. */
78
+ include_context_messages?: boolean;
79
+ /** Context channel ID to support scoping the search when applicable. */
80
+ context_channel_id?: string;
81
+ /** The cursor returned by the API. Leave this blank for the first request and use this to get the next page of results. */
82
+ cursor?: string;
83
+ /** Number of results to return, up to a max of 20. Defaults to 20. */
84
+ limit?: number;
85
+ /** The field to sort the results by. Defaults to score. Can be one of: score, timestamp. */
86
+ sort?: SearchContextRequestSort | (string & {});
87
+ /** The direction to sort the results by. Defaults to desc. */
88
+ sort_dir?: SearchContextRequestSortDir | (string & {});
89
+ /** Whether to return the message blocks in the response. */
90
+ include_message_blocks?: boolean;
91
+ /** Whether to highlight the search query in the results. Defaults to false if unspecified. */
92
+ highlight?: boolean;
93
+ /** 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). */
94
+ term_clauses?: SearchContextRequestTermClausesList;
95
+ /** 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. */
96
+ modifiers?: string;
97
+ /** Whether to include archived channels in the search results. */
98
+ include_archived_channels?: boolean;
99
+ /** Whether to disable semantic search. When true, only keyword-based search is used. Defaults to false. */
100
+ disable_semantic_search?: boolean;
101
+ }
102
+ export const SearchContextRequest = /*@__PURE__*/ S.suspend(() =>
103
+ S.Struct({
104
+ query: S.String,
105
+ action_token: S.optional(S.String),
106
+ channel_types: S.optional(SearchContextRequestChannelTypesList),
107
+ content_types: S.optional(SearchContextRequestContentTypesList),
108
+ include_bots: S.optional(S.Boolean),
109
+ include_deleted_users: S.optional(S.Boolean),
110
+ before: S.optional(S.Number),
111
+ after: S.optional(S.Number),
112
+ include_context_messages: S.optional(S.Boolean),
113
+ context_channel_id: S.optional(S.String),
114
+ cursor: S.optional(S.String),
115
+ limit: S.optional(S.Number),
116
+ sort: S.optional(SearchContextRequestSort),
117
+ sort_dir: S.optional(SearchContextRequestSortDir),
118
+ include_message_blocks: S.optional(S.Boolean),
119
+ highlight: S.optional(S.Boolean),
120
+ term_clauses: S.optional(SearchContextRequestTermClausesList),
121
+ modifiers: S.optional(S.String),
122
+ include_archived_channels: S.optional(S.Boolean),
123
+ disable_semantic_search: S.optional(S.Boolean),
124
+ }).pipe(
125
+ T.Http({ method: "POST", uri: "/assistant.search.context", code: 200 }),
126
+ ),
127
+ ).annotate({
128
+ identifier: "SearchContextRequest",
129
+ }) as any as S.Schema<SearchContextRequest>;
130
+
131
+ /** Messages before the current message, if applicable. */
132
+ export type SearchContextResponseResultsMessagesItemContextMessagesBeforeList =
133
+ Array<unknown>;
134
+ export const SearchContextResponseResultsMessagesItemContextMessagesBeforeList =
135
+ /*@__PURE__*/ S.Array(
136
+ S.Unknown,
137
+ ) as any as S.Schema<SearchContextResponseResultsMessagesItemContextMessagesBeforeList>;
138
+
139
+ /** Messages after the current message. */
140
+ export type SearchContextResponseResultsMessagesItemContextMessagesAfterList =
141
+ Array<unknown>;
142
+ export const SearchContextResponseResultsMessagesItemContextMessagesAfterList =
143
+ /*@__PURE__*/ S.Array(
144
+ S.Unknown,
145
+ ) as any as S.Schema<SearchContextResponseResultsMessagesItemContextMessagesAfterList>;
146
+
147
+ export interface SearchContextResponseResultsMessagesItemContextMessages {
148
+ /** Messages before the current message, if applicable. */
149
+ before?: SearchContextResponseResultsMessagesItemContextMessagesBeforeList;
150
+ /** Messages after the current message. */
151
+ after?: SearchContextResponseResultsMessagesItemContextMessagesAfterList;
152
+ }
153
+ export const SearchContextResponseResultsMessagesItemContextMessages =
154
+ /*@__PURE__*/ S.suspend(() =>
155
+ S.Struct({
156
+ before: S.optional(
157
+ SearchContextResponseResultsMessagesItemContextMessagesBeforeList,
158
+ ),
159
+ after: S.optional(
160
+ SearchContextResponseResultsMessagesItemContextMessagesAfterList,
161
+ ),
162
+ }),
163
+ ).annotate({
164
+ identifier: "SearchContextResponseResultsMessagesItemContextMessages",
165
+ }) as any as S.Schema<SearchContextResponseResultsMessagesItemContextMessages>;
166
+
167
+ /** Blocks from the retrieved message. */
168
+ export type SearchContextResponseResultsMessagesItemBlocksList = Array<unknown>;
169
+ export const SearchContextResponseResultsMessagesItemBlocksList =
170
+ /*@__PURE__*/ S.Array(
171
+ S.Unknown,
172
+ ) as any as S.Schema<SearchContextResponseResultsMessagesItemBlocksList>;
173
+
174
+ export interface SearchContextResponseResultsMessagesItem {
175
+ /** Full name of the user who authored the message. */
176
+ author_name: string;
177
+ /** Email address of the user who authored the message, if visible to the searching user. */
178
+ author_email?: string;
179
+ /** ID of the user who authored the message. */
180
+ author_user_id: string;
181
+ /** ID of the workspace in which the message was sent. */
182
+ team_id: string;
183
+ /** ID of the channel in which the message was sent. */
184
+ channel_id: string;
185
+ /** Name of the channel in which the message was sent. */
186
+ channel_name: string;
187
+ /** Slack-format timestamp at which the message was sent. */
188
+ message_ts: string;
189
+ /** Content from the retrieved message. */
190
+ content: string;
191
+ /** Whether the message was authored by a bot (app) or not. */
192
+ is_author_bot: boolean;
193
+ permalink: string;
194
+ context_messages?: SearchContextResponseResultsMessagesItemContextMessages;
195
+ /** Blocks from the retrieved message. */
196
+ blocks?: SearchContextResponseResultsMessagesItemBlocksList;
197
+ reply_count?: number;
198
+ }
199
+ export const SearchContextResponseResultsMessagesItem = /*@__PURE__*/ S.suspend(
200
+ () =>
201
+ S.Struct({
202
+ author_name: S.String,
203
+ author_email: S.optional(S.String),
204
+ author_user_id: S.String,
205
+ team_id: S.String,
206
+ channel_id: S.String,
207
+ channel_name: S.String,
208
+ message_ts: S.String,
209
+ content: S.String,
210
+ is_author_bot: S.Boolean,
211
+ permalink: S.String,
212
+ context_messages: S.optional(
213
+ SearchContextResponseResultsMessagesItemContextMessages,
214
+ ),
215
+ blocks: S.optional(SearchContextResponseResultsMessagesItemBlocksList),
216
+ reply_count: S.optional(S.Number),
217
+ }),
218
+ ).annotate({
219
+ identifier: "SearchContextResponseResultsMessagesItem",
220
+ }) as any as S.Schema<SearchContextResponseResultsMessagesItem>;
221
+
222
+ export type SearchContextResponseResultsMessagesList =
223
+ Array<SearchContextResponseResultsMessagesItem>;
224
+ export const SearchContextResponseResultsMessagesList = /*@__PURE__*/ S.Array(
225
+ SearchContextResponseResultsMessagesItem,
226
+ ) as any as S.Schema<SearchContextResponseResultsMessagesList>;
227
+
228
+ export interface SearchContextResponseResultsFilesItem {
229
+ /** Full name of the user who uploaded or created the file. */
230
+ author_name: string;
231
+ /** Email address of the user who uploaded or created the file, if visible to the searching user */
232
+ author_email?: string;
233
+ /** ID of the user who uploaded or created the file. */
234
+ author_user_id: string;
235
+ /** ID of the user who uploaded the file. */
236
+ uploader_user_id: string;
237
+ /** ID of the workspace in which the file was uploaded. */
238
+ team_id: string;
239
+ /** ID of the file. */
240
+ file_id: string;
241
+ /** Epoch timestamp in microseconds at which the file was created. */
242
+ date_created: number;
243
+ /** Epoch timestamp in microseconds at which the file was uploaded. */
244
+ date_updated: number;
245
+ /** Title of the file */
246
+ title: string;
247
+ /** Type of the file. */
248
+ file_type: string;
249
+ /** Permanent link to the file in Slack. */
250
+ permalink: string;
251
+ /** Content from the retrieved file. */
252
+ content: string;
253
+ /** Size of the file in bytes. */
254
+ size?: number;
255
+ }
256
+ export const SearchContextResponseResultsFilesItem = /*@__PURE__*/ S.suspend(
257
+ () =>
258
+ S.Struct({
259
+ author_name: S.String,
260
+ author_email: S.optional(S.String),
261
+ author_user_id: S.String,
262
+ uploader_user_id: S.String,
263
+ team_id: S.String,
264
+ file_id: S.String,
265
+ date_created: S.Number,
266
+ date_updated: S.Number,
267
+ title: S.String,
268
+ file_type: S.String,
269
+ permalink: S.String,
270
+ content: S.String,
271
+ size: S.optional(S.Number),
272
+ }),
273
+ ).annotate({
274
+ identifier: "SearchContextResponseResultsFilesItem",
275
+ }) as any as S.Schema<SearchContextResponseResultsFilesItem>;
276
+
277
+ export type SearchContextResponseResultsFilesList =
278
+ Array<SearchContextResponseResultsFilesItem>;
279
+ export const SearchContextResponseResultsFilesList = /*@__PURE__*/ S.Array(
280
+ SearchContextResponseResultsFilesItem,
281
+ ) as any as S.Schema<SearchContextResponseResultsFilesList>;
282
+
283
+ export type SearchContextResponseResultsEnterpriseList = Array<unknown>;
284
+ export const SearchContextResponseResultsEnterpriseList = /*@__PURE__*/ S.Array(
285
+ S.Unknown,
286
+ ) as any as S.Schema<SearchContextResponseResultsEnterpriseList>;
287
+
288
+ export interface SearchContextResponseResultsChannelsItem {
289
+ /** ID of the workspace in which the channel was created. */
290
+ team_id: string;
291
+ /** ID of the user who created the channel. */
292
+ creator_user_id: string;
293
+ /** Full name of the user who created the channel. */
294
+ creator_name?: string;
295
+ /** Epoch timestamp in microseconds at which the channel was created. */
296
+ date_created: number;
297
+ /** Epoch timestamp in microseconds at which the channel was updated. */
298
+ date_updated: number;
299
+ /** Name of the channel. */
300
+ name: string;
301
+ /** Topic of the channel. */
302
+ topic?: string;
303
+ /** Purpose of the channel. */
304
+ purpose?: string;
305
+ /** Permanent link to the channel in Slack. */
306
+ permalink: string;
307
+ /** Whether the channel is archived. */
308
+ is_archived: boolean;
309
+ }
310
+ export const SearchContextResponseResultsChannelsItem = /*@__PURE__*/ S.suspend(
311
+ () =>
312
+ S.Struct({
313
+ team_id: S.String,
314
+ creator_user_id: S.String,
315
+ creator_name: S.optional(S.String),
316
+ date_created: S.Number,
317
+ date_updated: S.Number,
318
+ name: S.String,
319
+ topic: S.optional(S.String),
320
+ purpose: S.optional(S.String),
321
+ permalink: S.String,
322
+ is_archived: S.Boolean,
323
+ }),
324
+ ).annotate({
325
+ identifier: "SearchContextResponseResultsChannelsItem",
326
+ }) as any as S.Schema<SearchContextResponseResultsChannelsItem>;
327
+
328
+ export type SearchContextResponseResultsChannelsList =
329
+ Array<SearchContextResponseResultsChannelsItem>;
330
+ export const SearchContextResponseResultsChannelsList = /*@__PURE__*/ S.Array(
331
+ SearchContextResponseResultsChannelsItem,
332
+ ) as any as S.Schema<SearchContextResponseResultsChannelsList>;
333
+
334
+ export interface SearchContextResponseResultsUsersItem {
335
+ /** The encoded user ID */
336
+ user_id: string;
337
+ /** The permalink to the user in Slack */
338
+ permalink: string;
339
+ /** The permalink to the user's profile photo. */
340
+ profile_pic_permalink?: string;
341
+ /** The user's full name, which might be different from the display name. */
342
+ full_name: string;
343
+ /** The user's job title. */
344
+ title: string;
345
+ /** The user's local timezone. */
346
+ timezone: string;
347
+ /** The user's email address. */
348
+ email: string;
349
+ }
350
+ export const SearchContextResponseResultsUsersItem = /*@__PURE__*/ S.suspend(
351
+ () =>
352
+ S.Struct({
353
+ user_id: S.String,
354
+ permalink: S.String,
355
+ profile_pic_permalink: S.optional(S.String),
356
+ full_name: S.String,
357
+ title: S.String,
358
+ timezone: S.String,
359
+ email: S.String,
360
+ }),
361
+ ).annotate({
362
+ identifier: "SearchContextResponseResultsUsersItem",
363
+ }) as any as S.Schema<SearchContextResponseResultsUsersItem>;
364
+
365
+ export type SearchContextResponseResultsUsersList =
366
+ Array<SearchContextResponseResultsUsersItem>;
367
+ export const SearchContextResponseResultsUsersList = /*@__PURE__*/ S.Array(
368
+ SearchContextResponseResultsUsersItem,
369
+ ) as any as S.Schema<SearchContextResponseResultsUsersList>;
370
+
371
+ export interface SearchContextResponseResults {
372
+ messages?: SearchContextResponseResultsMessagesList;
373
+ files?: SearchContextResponseResultsFilesList;
374
+ enterprise?: SearchContextResponseResultsEnterpriseList;
375
+ channels?: SearchContextResponseResultsChannelsList;
376
+ users?: SearchContextResponseResultsUsersList;
377
+ }
378
+ export const SearchContextResponseResults = /*@__PURE__*/ S.suspend(() =>
379
+ S.Struct({
380
+ messages: S.optional(SearchContextResponseResultsMessagesList),
381
+ files: S.optional(SearchContextResponseResultsFilesList),
382
+ enterprise: S.optional(SearchContextResponseResultsEnterpriseList),
383
+ channels: S.optional(SearchContextResponseResultsChannelsList),
384
+ users: S.optional(SearchContextResponseResultsUsersList),
385
+ }),
386
+ ).annotate({
387
+ identifier: "SearchContextResponseResults",
388
+ }) as any as S.Schema<SearchContextResponseResults>;
389
+
390
+ /** Pagination metadata. An empty `next_cursor` means the last page. */
391
+ export interface SearchContextResponseResponseMetadata {
392
+ /** Cursor for the next page — pass as `cursor` on the next call. */
393
+ next_cursor?: string;
394
+ }
395
+ export const SearchContextResponseResponseMetadata = /*@__PURE__*/ S.suspend(
396
+ () =>
397
+ S.Struct({
398
+ next_cursor: S.optional(S.String),
399
+ }),
400
+ ).annotate({
401
+ identifier: "SearchContextResponseResponseMetadata",
402
+ }) as any as S.Schema<SearchContextResponseResponseMetadata>;
403
+
404
+ export interface SearchContextResponse {
405
+ /** Always `true` (a failed call raises a typed error instead). */
406
+ ok: boolean;
407
+ results: SearchContextResponseResults;
408
+ /** Pagination metadata. An empty `next_cursor` means the last page. */
409
+ response_metadata?: SearchContextResponseResponseMetadata;
410
+ }
411
+ export const SearchContextResponse = /*@__PURE__*/ S.suspend(() =>
412
+ S.Struct({
413
+ ok: S.Boolean,
414
+ results: SearchContextResponseResults,
415
+ response_metadata: S.optional(SearchContextResponseResponseMetadata),
416
+ }),
417
+ ).annotate({
418
+ identifier: "SearchContextResponse",
419
+ }) as any as S.Schema<SearchContextResponse>;
420
+
421
+ export interface SearchInfoRequest {}
422
+ export const SearchInfoRequest = /*@__PURE__*/ S.suspend(() =>
423
+ S.Struct({}).pipe(
424
+ T.Http({ method: "POST", uri: "/assistant.search.info", code: 200 }),
425
+ ),
426
+ ).annotate({
427
+ identifier: "SearchInfoRequest",
428
+ }) as any as S.Schema<SearchInfoRequest>;
429
+
430
+ export interface SearchInfoResponse {
431
+ /** Always `true` (a failed call raises a typed error instead). */
432
+ ok: boolean;
433
+ /** Whether AI search is enabled for the team */
434
+ is_ai_search_enabled: boolean;
435
+ }
436
+ export const SearchInfoResponse = /*@__PURE__*/ S.suspend(() =>
437
+ S.Struct({
438
+ ok: S.Boolean,
439
+ is_ai_search_enabled: S.Boolean,
440
+ }),
441
+ ).annotate({
442
+ identifier: "SearchInfoResponse",
443
+ }) as any as S.Schema<SearchInfoResponse>;
444
+
445
+ /** The list of messages to rotate through as a loading indicator. Maximum of 10 messages. */
446
+ export type SetStatusRequestLoadingMessagesList = Array<string>;
447
+ export const SetStatusRequestLoadingMessagesList = /*@__PURE__*/ S.Array(
448
+ S.String,
449
+ ) as any as S.Schema<SetStatusRequestLoadingMessagesList>;
450
+
451
+ export interface SetStatusRequest {
452
+ /** Channel ID containing the assistant thread. */
453
+ channel_id: string;
454
+ /** Message timestamp of the thread of where to set the status. */
455
+ thread_ts: string;
456
+ /** 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. */
457
+ status: string;
458
+ /** The list of messages to rotate through as a loading indicator. Maximum of 10 messages. */
459
+ loading_messages?: SetStatusRequestLoadingMessagesList;
460
+ /** Emoji to use as the icon for this message. Overrides `icon_url`. */
461
+ icon_emoji?: string;
462
+ /** Image URL to use as the icon for this message. */
463
+ icon_url?: string;
464
+ /** The bot's username to display. */
465
+ username?: string;
466
+ }
467
+ export const SetStatusRequest = /*@__PURE__*/ S.suspend(() =>
468
+ S.Struct({
469
+ channel_id: S.String,
470
+ thread_ts: S.String,
471
+ status: S.String,
472
+ loading_messages: S.optional(SetStatusRequestLoadingMessagesList),
473
+ icon_emoji: S.optional(S.String),
474
+ icon_url: S.optional(S.String),
475
+ username: S.optional(S.String),
476
+ }).pipe(
477
+ T.Http({ method: "POST", uri: "/assistant.threads.setStatus", code: 200 }),
478
+ ),
479
+ ).annotate({
480
+ identifier: "SetStatusRequest",
481
+ }) as any as S.Schema<SetStatusRequest>;
482
+
483
+ export interface SetStatusResponse {
484
+ /** Always `true` (a failed call raises a typed error instead). */
485
+ ok: boolean;
486
+ }
487
+ export const SetStatusResponse = /*@__PURE__*/ S.suspend(() =>
488
+ S.Struct({
489
+ ok: S.Boolean,
490
+ }),
491
+ ).annotate({
492
+ identifier: "SetStatusResponse",
493
+ }) as any as S.Schema<SetStatusResponse>;
494
+
495
+ export interface SetSuggestedPromptsRequest {
496
+ /** Channel ID containing the assistant thread. */
497
+ channel_id: string;
498
+ /** Message timestamp of the thread to set suggested prompts for. */
499
+ thread_ts?: string;
500
+ /** Each prompt should be supplied with its `title` and `message` attribute. */
501
+ prompts: unknown;
502
+ /** Title for the list of provided prompts. For example: Suggested Prompts, Related Questions. */
503
+ title?: string;
504
+ }
505
+ export const SetSuggestedPromptsRequest = /*@__PURE__*/ S.suspend(() =>
506
+ S.Struct({
507
+ channel_id: S.String,
508
+ thread_ts: S.optional(S.String),
509
+ prompts: S.Unknown,
510
+ title: S.optional(S.String),
511
+ }).pipe(
512
+ T.Http({
513
+ method: "POST",
514
+ uri: "/assistant.threads.setSuggestedPrompts",
515
+ code: 200,
516
+ }),
517
+ ),
518
+ ).annotate({
519
+ identifier: "SetSuggestedPromptsRequest",
520
+ }) as any as S.Schema<SetSuggestedPromptsRequest>;
521
+
522
+ export interface SetSuggestedPromptsResponse {
523
+ /** Always `true` (a failed call raises a typed error instead). */
524
+ ok: boolean;
525
+ }
526
+ export const SetSuggestedPromptsResponse = /*@__PURE__*/ S.suspend(() =>
527
+ S.Struct({
528
+ ok: S.Boolean,
529
+ }),
530
+ ).annotate({
531
+ identifier: "SetSuggestedPromptsResponse",
532
+ }) as any as S.Schema<SetSuggestedPromptsResponse>;
533
+
534
+ export interface SetTitleRequest {
535
+ /** Channel ID containing the assistant thread. */
536
+ channel_id: string;
537
+ /** Message timestamp of the thread to set suggested prompts for. */
538
+ thread_ts: string;
539
+ /** The title to use for the thread. */
540
+ title: string;
541
+ }
542
+ export const SetTitleRequest = /*@__PURE__*/ S.suspend(() =>
543
+ S.Struct({
544
+ channel_id: S.String,
545
+ thread_ts: S.String,
546
+ title: S.String,
547
+ }).pipe(
548
+ T.Http({ method: "POST", uri: "/assistant.threads.setTitle", code: 200 }),
549
+ ),
550
+ ).annotate({
551
+ identifier: "SetTitleRequest",
552
+ }) as any as S.Schema<SetTitleRequest>;
553
+
554
+ export interface SetTitleResponse {
555
+ /** Always `true` (a failed call raises a typed error instead). */
556
+ ok: boolean;
557
+ }
558
+ export const SetTitleResponse = /*@__PURE__*/ S.suspend(() =>
559
+ S.Struct({
560
+ ok: S.Boolean,
561
+ }),
562
+ ).annotate({
563
+ identifier: "SetTitleResponse",
564
+ }) as any as S.Schema<SetTitleResponse>;
565
+
566
+ export type SearchContextError = SlackOpError;
567
+ /** 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 */
568
+ export const searchContext: API.OperationMethod<
569
+ SearchContextRequest,
570
+ SearchContextResponse,
571
+ SearchContextError,
572
+ SlackOpContext
573
+ > = /*@__PURE__*/ API.make(() => ({
574
+ input: SearchContextRequest,
575
+ output: SearchContextResponse,
576
+ errors: [SlackError, SlackRateLimited],
577
+ protocol: SlackProtocol,
578
+ retry: Retry.Retry,
579
+ }));
580
+
581
+ export type SearchInfoError = SlackOpError;
582
+ /** 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 */
583
+ export const searchInfo: API.OperationMethod<
584
+ SearchInfoRequest,
585
+ SearchInfoResponse,
586
+ SearchInfoError,
587
+ SlackOpContext
588
+ > = /*@__PURE__*/ API.make(() => ({
589
+ input: SearchInfoRequest,
590
+ output: SearchInfoResponse,
591
+ errors: [SlackError, SlackRateLimited],
592
+ protocol: SlackProtocol,
593
+ retry: Retry.Retry,
594
+ }));
595
+
596
+ export type SetStatusError = SlackOpError;
597
+ /** Set the status for an AI assistant thread. Required scopes — bot: `chat:write` Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` — Error returned when given an invalid channel_id - `invalid_thread_ts` — Error returned when given an invalid thread_ts - `reserved_username` — Reserved usernames are not allowed to be used. See https://docs.slack.dev/reference/methods/assistant.threads.setStatus */
598
+ export const setStatus: API.OperationMethod<
599
+ SetStatusRequest,
600
+ SetStatusResponse,
601
+ SetStatusError,
602
+ SlackOpContext
603
+ > = /*@__PURE__*/ API.make(() => ({
604
+ input: SetStatusRequest,
605
+ output: SetStatusResponse,
606
+ errors: [SlackError, SlackRateLimited],
607
+ protocol: SlackProtocol,
608
+ retry: Retry.Retry,
609
+ }));
610
+
611
+ export type SetSuggestedPromptsError = SlackOpError;
612
+ /** Set suggested prompts for the given assistant thread Required scopes — bot: `assistant:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_thread_ts` — Thread not found - `channel_not_found` — Error returned when given an invalid channel_id - `message_not_found` — Error returned when given an invalid message - `not_agent_app` — This method requires the app to be configured as an agent. Enable the Agent feature in your app configuration at https://api.slack.com/apps. See https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts */
613
+ export const setSuggestedPrompts: API.OperationMethod<
614
+ SetSuggestedPromptsRequest,
615
+ SetSuggestedPromptsResponse,
616
+ SetSuggestedPromptsError,
617
+ SlackOpContext
618
+ > = /*@__PURE__*/ API.make(() => ({
619
+ input: SetSuggestedPromptsRequest,
620
+ output: SetSuggestedPromptsResponse,
621
+ errors: [SlackError, SlackRateLimited],
622
+ protocol: SlackProtocol,
623
+ retry: Retry.Retry,
624
+ }));
625
+
626
+ export type SetTitleError = SlackOpError;
627
+ /** Set the title for the given assistant thread Required scopes — bot: `assistant:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `invalid_thread_ts` — Thread not found - `channel_not_found` — Error returned when given an invalid channel_id See https://docs.slack.dev/reference/methods/assistant.threads.setTitle */
628
+ export const setTitle: API.OperationMethod<
629
+ SetTitleRequest,
630
+ SetTitleResponse,
631
+ SetTitleError,
632
+ SlackOpContext
633
+ > = /*@__PURE__*/ API.make(() => ({
634
+ input: SetTitleRequest,
635
+ output: SetTitleResponse,
636
+ errors: [SlackError, SlackRateLimited],
637
+ protocol: SlackProtocol,
638
+ retry: Retry.Retry,
639
+ }));