@distilled.cloud/slack 1.0.0-rc.13 → 1.0.0-rc.15

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 (218) hide show
  1. package/lib/credentials.d.ts +2 -2
  2. package/lib/credentials.d.ts.map +1 -1
  3. package/lib/credentials.js +3 -3
  4. package/lib/credentials.js.map +1 -1
  5. package/lib/errors.d.ts.map +1 -1
  6. package/lib/errors.js +1 -1
  7. package/lib/errors.js.map +1 -1
  8. package/lib/index.d.ts +3 -3
  9. package/lib/index.d.ts.map +1 -1
  10. package/lib/index.js +3 -3
  11. package/lib/index.js.map +1 -1
  12. package/lib/pagination.d.ts.map +1 -1
  13. package/lib/pagination.js.map +1 -1
  14. package/lib/protocol.d.ts +3 -3
  15. package/lib/protocol.d.ts.map +1 -1
  16. package/lib/protocol.js +12 -18
  17. package/lib/protocol.js.map +1 -1
  18. package/lib/protocol.test.d.ts +2 -0
  19. package/lib/protocol.test.d.ts.map +1 -0
  20. package/lib/protocol.test.js +288 -0
  21. package/lib/protocol.test.js.map +1 -0
  22. package/lib/retry.d.ts +1 -1
  23. package/lib/retry.d.ts.map +1 -1
  24. package/lib/retry.js +1 -1
  25. package/lib/retry.js.map +1 -1
  26. package/lib/services/admin.d.ts +236 -29
  27. package/lib/services/admin.d.ts.map +1 -1
  28. package/lib/services/admin.js +417 -749
  29. package/lib/services/admin.js.map +1 -1
  30. package/lib/services/agents.d.ts +423 -0
  31. package/lib/services/agents.d.ts.map +1 -0
  32. package/lib/services/agents.js +315 -0
  33. package/lib/services/agents.js.map +1 -0
  34. package/lib/services/api.d.ts +1 -1
  35. package/lib/services/api.d.ts.map +1 -1
  36. package/lib/services/api.js +4 -6
  37. package/lib/services/api.js.map +1 -1
  38. package/lib/services/apps.d.ts +21 -3
  39. package/lib/services/apps.d.ts.map +1 -1
  40. package/lib/services/apps.js +65 -133
  41. package/lib/services/apps.js.map +1 -1
  42. package/lib/services/assistant.d.ts +4 -4
  43. package/lib/services/assistant.d.ts.map +1 -1
  44. package/lib/services/assistant.js +16 -38
  45. package/lib/services/assistant.js.map +1 -1
  46. package/lib/services/auth.d.ts +2 -2
  47. package/lib/services/auth.d.ts.map +1 -1
  48. package/lib/services/auth.js +11 -28
  49. package/lib/services/auth.js.map +1 -1
  50. package/lib/services/blocks.d.ts +1 -1
  51. package/lib/services/blocks.d.ts.map +1 -1
  52. package/lib/services/blocks.js +5 -9
  53. package/lib/services/blocks.js.map +1 -1
  54. package/lib/services/bookmarks.d.ts +4 -4
  55. package/lib/services/bookmarks.d.ts.map +1 -1
  56. package/lib/services/bookmarks.js +14 -30
  57. package/lib/services/bookmarks.js.map +1 -1
  58. package/lib/services/bots.d.ts +1 -1
  59. package/lib/services/bots.d.ts.map +1 -1
  60. package/lib/services/bots.js +7 -15
  61. package/lib/services/bots.js.map +1 -1
  62. package/lib/services/calls.d.ts +1 -1
  63. package/lib/services/calls.d.ts.map +1 -1
  64. package/lib/services/calls.js +13 -33
  65. package/lib/services/calls.js.map +1 -1
  66. package/lib/services/canvases.d.ts +22 -2
  67. package/lib/services/canvases.d.ts.map +1 -1
  68. package/lib/services/canvases.js +37 -48
  69. package/lib/services/canvases.js.map +1 -1
  70. package/lib/services/chat.d.ts +29 -25
  71. package/lib/services/chat.d.ts.map +1 -1
  72. package/lib/services/chat.js +47 -95
  73. package/lib/services/chat.js.map +1 -1
  74. package/lib/services/conversations.d.ts +10 -8
  75. package/lib/services/conversations.d.ts.map +1 -1
  76. package/lib/services/conversations.js +43 -115
  77. package/lib/services/conversations.js.map +1 -1
  78. package/lib/services/dialog.d.ts +1 -1
  79. package/lib/services/dialog.d.ts.map +1 -1
  80. package/lib/services/dialog.js +5 -9
  81. package/lib/services/dialog.js.map +1 -1
  82. package/lib/services/dnd.d.ts +1 -1
  83. package/lib/services/dnd.d.ts.map +1 -1
  84. package/lib/services/dnd.js +10 -24
  85. package/lib/services/dnd.js.map +1 -1
  86. package/lib/services/emoji.d.ts +1 -1
  87. package/lib/services/emoji.d.ts.map +1 -1
  88. package/lib/services/emoji.js +6 -11
  89. package/lib/services/emoji.js.map +1 -1
  90. package/lib/services/entity.d.ts +1 -1
  91. package/lib/services/entity.d.ts.map +1 -1
  92. package/lib/services/entity.js +8 -20
  93. package/lib/services/entity.js.map +1 -1
  94. package/lib/services/files.d.ts +5 -5
  95. package/lib/services/files.d.ts.map +1 -1
  96. package/lib/services/files.js +39 -109
  97. package/lib/services/files.js.map +1 -1
  98. package/lib/services/functions.d.ts +1 -1
  99. package/lib/services/functions.d.ts.map +1 -1
  100. package/lib/services/functions.js +28 -75
  101. package/lib/services/functions.js.map +1 -1
  102. package/lib/services/index.d.ts +1 -0
  103. package/lib/services/index.d.ts.map +1 -1
  104. package/lib/services/index.js +1 -0
  105. package/lib/services/index.js.map +1 -1
  106. package/lib/services/lists.d.ts +5 -1
  107. package/lib/services/lists.d.ts.map +1 -1
  108. package/lib/services/lists.js +35 -146
  109. package/lib/services/lists.js.map +1 -1
  110. package/lib/services/migration.d.ts +1 -1
  111. package/lib/services/migration.d.ts.map +1 -1
  112. package/lib/services/migration.js +5 -8
  113. package/lib/services/migration.js.map +1 -1
  114. package/lib/services/oauth.d.ts +38 -2
  115. package/lib/services/oauth.d.ts.map +1 -1
  116. package/lib/services/oauth.js +67 -50
  117. package/lib/services/oauth.js.map +1 -1
  118. package/lib/services/openid.d.ts +1 -1
  119. package/lib/services/openid.d.ts.map +1 -1
  120. package/lib/services/openid.js +7 -15
  121. package/lib/services/openid.js.map +1 -1
  122. package/lib/services/pins.d.ts +1 -1
  123. package/lib/services/pins.d.ts.map +1 -1
  124. package/lib/services/pins.js +7 -15
  125. package/lib/services/pins.js.map +1 -1
  126. package/lib/services/reactions.d.ts +2 -2
  127. package/lib/services/reactions.d.ts.map +1 -1
  128. package/lib/services/reactions.js +13 -29
  129. package/lib/services/reactions.js.map +1 -1
  130. package/lib/services/reminders.d.ts +1 -1
  131. package/lib/services/reminders.d.ts.map +1 -1
  132. package/lib/services/reminders.js +13 -33
  133. package/lib/services/reminders.js.map +1 -1
  134. package/lib/services/rtm.d.ts +1 -1
  135. package/lib/services/rtm.d.ts.map +1 -1
  136. package/lib/services/rtm.js +9 -21
  137. package/lib/services/rtm.js.map +1 -1
  138. package/lib/services/search.d.ts +1 -1
  139. package/lib/services/search.d.ts.map +1 -1
  140. package/lib/services/search.js +13 -30
  141. package/lib/services/search.js.map +1 -1
  142. package/lib/services/stars.d.ts +1 -1
  143. package/lib/services/stars.d.ts.map +1 -1
  144. package/lib/services/stars.js +10 -20
  145. package/lib/services/stars.js.map +1 -1
  146. package/lib/services/team.d.ts +1 -1
  147. package/lib/services/team.d.ts.map +1 -1
  148. package/lib/services/team.js +25 -62
  149. package/lib/services/team.js.map +1 -1
  150. package/lib/services/tooling.d.ts +1 -1
  151. package/lib/services/tooling.d.ts.map +1 -1
  152. package/lib/services/tooling.js +5 -9
  153. package/lib/services/tooling.js.map +1 -1
  154. package/lib/services/usergroups.d.ts +8 -3
  155. package/lib/services/usergroups.d.ts.map +1 -1
  156. package/lib/services/usergroups.js +23 -51
  157. package/lib/services/usergroups.js.map +1 -1
  158. package/lib/services/users.d.ts +2 -2
  159. package/lib/services/users.d.ts.map +1 -1
  160. package/lib/services/users.js +28 -81
  161. package/lib/services/users.js.map +1 -1
  162. package/lib/services/views.d.ts +1 -1
  163. package/lib/services/views.d.ts.map +1 -1
  164. package/lib/services/views.js +11 -27
  165. package/lib/services/views.js.map +1 -1
  166. package/lib/services/workflows.d.ts +1 -1
  167. package/lib/services/workflows.d.ts.map +1 -1
  168. package/lib/services/workflows.js +27 -71
  169. package/lib/services/workflows.js.map +1 -1
  170. package/package.json +15 -11
  171. package/src/credentials.ts +8 -10
  172. package/src/errors.ts +17 -31
  173. package/src/index.ts +3 -7
  174. package/src/pagination.ts +2 -5
  175. package/src/protocol.test.ts +372 -0
  176. package/src/protocol.ts +34 -66
  177. package/src/retry.ts +4 -9
  178. package/src/services/admin.ts +1241 -1557
  179. package/src/services/agents.ts +853 -0
  180. package/src/services/api.ts +4 -10
  181. package/src/services/apps.ts +146 -243
  182. package/src/services/assistant.ts +93 -144
  183. package/src/services/auth.ts +12 -33
  184. package/src/services/blocks.ts +9 -24
  185. package/src/services/bookmarks.ts +14 -34
  186. package/src/services/bots.ts +7 -19
  187. package/src/services/calls.ts +15 -43
  188. package/src/services/canvases.ts +82 -85
  189. package/src/services/chat.ts +134 -254
  190. package/src/services/conversations.ts +101 -217
  191. package/src/services/dialog.ts +5 -13
  192. package/src/services/dnd.ts +11 -31
  193. package/src/services/emoji.ts +9 -19
  194. package/src/services/entity.ts +17 -45
  195. package/src/services/files.ts +72 -165
  196. package/src/services/functions.ts +95 -168
  197. package/src/services/index.ts +1 -0
  198. package/src/services/lists.ts +65 -208
  199. package/src/services/migration.ts +8 -17
  200. package/src/services/oauth.ts +127 -60
  201. package/src/services/openid.ts +12 -34
  202. package/src/services/pins.ts +7 -19
  203. package/src/services/reactions.ts +19 -43
  204. package/src/services/reminders.ts +13 -37
  205. package/src/services/rtm.ts +9 -25
  206. package/src/services/search.ts +51 -92
  207. package/src/services/stars.ts +20 -31
  208. package/src/services/team.ts +81 -155
  209. package/src/services/tooling.ts +5 -13
  210. package/src/services/usergroups.ts +37 -68
  211. package/src/services/users.ts +35 -102
  212. package/src/services/views.ts +11 -31
  213. package/src/services/workflows.ts +65 -129
  214. package/lib/response-validation.test.d.ts +0 -4
  215. package/lib/response-validation.test.d.ts.map +0 -1
  216. package/lib/response-validation.test.js +0 -40
  217. package/lib/response-validation.test.js.map +0 -1
  218. package/src/response-validation.test.ts +0 -54
@@ -1,14 +1,10 @@
1
+ import * as API from "@distilled.cloud/core/api";
1
2
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
2
3
  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
4
  import { SlackError, SlackRateLimited } from "../errors.ts";
5
+ import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
11
6
  import * as Retry from "../retry.ts";
7
+ import * as T from "../traits.ts";
12
8
 
13
9
  export type { SlackOpError, SlackOpContext };
14
10
 
@@ -121,24 +117,18 @@ export const SearchContextRequest = /*@__PURE__*/ S.suspend(() =>
121
117
  modifiers: S.optional(S.String),
122
118
  include_archived_channels: S.optional(S.Boolean),
123
119
  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>;
120
+ }).pipe(T.Http({ method: "POST", uri: "/assistant.search.context", code: 200 })),
121
+ ).annotate({ identifier: "SearchContextRequest" }) as any as S.Schema<SearchContextRequest>;
130
122
 
131
123
  /** Messages before the current message, if applicable. */
132
- export type SearchContextResponseResultsMessagesItemContextMessagesBeforeList =
133
- Array<unknown>;
124
+ export type SearchContextResponseResultsMessagesItemContextMessagesBeforeList = Array<unknown>;
134
125
  export const SearchContextResponseResultsMessagesItemContextMessagesBeforeList =
135
126
  /*@__PURE__*/ S.Array(
136
127
  S.Unknown,
137
128
  ) as any as S.Schema<SearchContextResponseResultsMessagesItemContextMessagesBeforeList>;
138
129
 
139
130
  /** Messages after the current message. */
140
- export type SearchContextResponseResultsMessagesItemContextMessagesAfterList =
141
- Array<unknown>;
131
+ export type SearchContextResponseResultsMessagesItemContextMessagesAfterList = Array<unknown>;
142
132
  export const SearchContextResponseResultsMessagesItemContextMessagesAfterList =
143
133
  /*@__PURE__*/ S.Array(
144
134
  S.Unknown,
@@ -150,26 +140,20 @@ export interface SearchContextResponseResultsMessagesItemContextMessages {
150
140
  /** Messages after the current message. */
151
141
  after?: SearchContextResponseResultsMessagesItemContextMessagesAfterList;
152
142
  }
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>;
143
+ export const SearchContextResponseResultsMessagesItemContextMessages = /*@__PURE__*/ S.suspend(() =>
144
+ S.Struct({
145
+ before: S.optional(SearchContextResponseResultsMessagesItemContextMessagesBeforeList),
146
+ after: S.optional(SearchContextResponseResultsMessagesItemContextMessagesAfterList),
147
+ }),
148
+ ).annotate({
149
+ identifier: "SearchContextResponseResultsMessagesItemContextMessages",
150
+ }) as any as S.Schema<SearchContextResponseResultsMessagesItemContextMessages>;
166
151
 
167
152
  /** Blocks from the retrieved message. */
168
153
  export type SearchContextResponseResultsMessagesItemBlocksList = Array<unknown>;
169
- export const SearchContextResponseResultsMessagesItemBlocksList =
170
- /*@__PURE__*/ S.Array(
171
- S.Unknown,
172
- ) as any as S.Schema<SearchContextResponseResultsMessagesItemBlocksList>;
154
+ export const SearchContextResponseResultsMessagesItemBlocksList = /*@__PURE__*/ S.Array(
155
+ S.Unknown,
156
+ ) as any as S.Schema<SearchContextResponseResultsMessagesItemBlocksList>;
173
157
 
174
158
  export interface SearchContextResponseResultsMessagesItem {
175
159
  /** Full name of the user who authored the message. */
@@ -196,25 +180,22 @@ export interface SearchContextResponseResultsMessagesItem {
196
180
  blocks?: SearchContextResponseResultsMessagesItemBlocksList;
197
181
  reply_count?: number;
198
182
  }
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
- }),
183
+ export const SearchContextResponseResultsMessagesItem = /*@__PURE__*/ S.suspend(() =>
184
+ S.Struct({
185
+ author_name: S.String,
186
+ author_email: S.optional(S.String),
187
+ author_user_id: S.String,
188
+ team_id: S.String,
189
+ channel_id: S.String,
190
+ channel_name: S.String,
191
+ message_ts: S.String,
192
+ content: S.String,
193
+ is_author_bot: S.Boolean,
194
+ permalink: S.String,
195
+ context_messages: S.optional(SearchContextResponseResultsMessagesItemContextMessages),
196
+ blocks: S.optional(SearchContextResponseResultsMessagesItemBlocksList),
197
+ reply_count: S.optional(S.Number),
198
+ }),
218
199
  ).annotate({
219
200
  identifier: "SearchContextResponseResultsMessagesItem",
220
201
  }) as any as S.Schema<SearchContextResponseResultsMessagesItem>;
@@ -253,29 +234,27 @@ export interface SearchContextResponseResultsFilesItem {
253
234
  /** Size of the file in bytes. */
254
235
  size?: number;
255
236
  }
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
- }),
237
+ export const SearchContextResponseResultsFilesItem = /*@__PURE__*/ S.suspend(() =>
238
+ S.Struct({
239
+ author_name: S.String,
240
+ author_email: S.optional(S.String),
241
+ author_user_id: S.String,
242
+ uploader_user_id: S.String,
243
+ team_id: S.String,
244
+ file_id: S.String,
245
+ date_created: S.Number,
246
+ date_updated: S.Number,
247
+ title: S.String,
248
+ file_type: S.String,
249
+ permalink: S.String,
250
+ content: S.String,
251
+ size: S.optional(S.Number),
252
+ }),
273
253
  ).annotate({
274
254
  identifier: "SearchContextResponseResultsFilesItem",
275
255
  }) as any as S.Schema<SearchContextResponseResultsFilesItem>;
276
256
 
277
- export type SearchContextResponseResultsFilesList =
278
- Array<SearchContextResponseResultsFilesItem>;
257
+ export type SearchContextResponseResultsFilesList = Array<SearchContextResponseResultsFilesItem>;
279
258
  export const SearchContextResponseResultsFilesList = /*@__PURE__*/ S.Array(
280
259
  SearchContextResponseResultsFilesItem,
281
260
  ) as any as S.Schema<SearchContextResponseResultsFilesList>;
@@ -307,20 +286,19 @@ export interface SearchContextResponseResultsChannelsItem {
307
286
  /** Whether the channel is archived. */
308
287
  is_archived: boolean;
309
288
  }
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
- }),
289
+ export const SearchContextResponseResultsChannelsItem = /*@__PURE__*/ S.suspend(() =>
290
+ S.Struct({
291
+ team_id: S.String,
292
+ creator_user_id: S.String,
293
+ creator_name: S.optional(S.String),
294
+ date_created: S.Number,
295
+ date_updated: S.Number,
296
+ name: S.String,
297
+ topic: S.optional(S.String),
298
+ purpose: S.optional(S.String),
299
+ permalink: S.String,
300
+ is_archived: S.Boolean,
301
+ }),
324
302
  ).annotate({
325
303
  identifier: "SearchContextResponseResultsChannelsItem",
326
304
  }) as any as S.Schema<SearchContextResponseResultsChannelsItem>;
@@ -347,23 +325,21 @@ export interface SearchContextResponseResultsUsersItem {
347
325
  /** The user's email address. */
348
326
  email: string;
349
327
  }
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
- }),
328
+ export const SearchContextResponseResultsUsersItem = /*@__PURE__*/ S.suspend(() =>
329
+ S.Struct({
330
+ user_id: S.String,
331
+ permalink: S.String,
332
+ profile_pic_permalink: S.optional(S.String),
333
+ full_name: S.String,
334
+ title: S.String,
335
+ timezone: S.String,
336
+ email: S.String,
337
+ }),
361
338
  ).annotate({
362
339
  identifier: "SearchContextResponseResultsUsersItem",
363
340
  }) as any as S.Schema<SearchContextResponseResultsUsersItem>;
364
341
 
365
- export type SearchContextResponseResultsUsersList =
366
- Array<SearchContextResponseResultsUsersItem>;
342
+ export type SearchContextResponseResultsUsersList = Array<SearchContextResponseResultsUsersItem>;
367
343
  export const SearchContextResponseResultsUsersList = /*@__PURE__*/ S.Array(
368
344
  SearchContextResponseResultsUsersItem,
369
345
  ) as any as S.Schema<SearchContextResponseResultsUsersList>;
@@ -392,11 +368,10 @@ export interface SearchContextResponseResponseMetadata {
392
368
  /** Cursor for the next page — pass as `cursor` on the next call. */
393
369
  next_cursor?: string;
394
370
  }
395
- export const SearchContextResponseResponseMetadata = /*@__PURE__*/ S.suspend(
396
- () =>
397
- S.Struct({
398
- next_cursor: S.optional(S.String),
399
- }),
371
+ export const SearchContextResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
372
+ S.Struct({
373
+ next_cursor: S.optional(S.String),
374
+ }),
400
375
  ).annotate({
401
376
  identifier: "SearchContextResponseResponseMetadata",
402
377
  }) as any as S.Schema<SearchContextResponseResponseMetadata>;
@@ -414,18 +389,12 @@ export const SearchContextResponse = /*@__PURE__*/ S.suspend(() =>
414
389
  results: SearchContextResponseResults,
415
390
  response_metadata: S.optional(SearchContextResponseResponseMetadata),
416
391
  }),
417
- ).annotate({
418
- identifier: "SearchContextResponse",
419
- }) as any as S.Schema<SearchContextResponse>;
392
+ ).annotate({ identifier: "SearchContextResponse" }) as any as S.Schema<SearchContextResponse>;
420
393
 
421
394
  export interface SearchInfoRequest {}
422
395
  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>;
396
+ S.Struct({}).pipe(T.Http({ method: "POST", uri: "/assistant.search.info", code: 200 })),
397
+ ).annotate({ identifier: "SearchInfoRequest" }) as any as S.Schema<SearchInfoRequest>;
429
398
 
430
399
  export interface SearchInfoResponse {
431
400
  /** Always `true` (a failed call raises a typed error instead). */
@@ -438,9 +407,7 @@ export const SearchInfoResponse = /*@__PURE__*/ S.suspend(() =>
438
407
  ok: S.Boolean,
439
408
  is_ai_search_enabled: S.Boolean,
440
409
  }),
441
- ).annotate({
442
- identifier: "SearchInfoResponse",
443
- }) as any as S.Schema<SearchInfoResponse>;
410
+ ).annotate({ identifier: "SearchInfoResponse" }) as any as S.Schema<SearchInfoResponse>;
444
411
 
445
412
  /** The list of messages to rotate through as a loading indicator. Maximum of 10 messages. */
446
413
  export type SetStatusRequestLoadingMessagesList = Array<string>;
@@ -473,12 +440,8 @@ export const SetStatusRequest = /*@__PURE__*/ S.suspend(() =>
473
440
  icon_emoji: S.optional(S.String),
474
441
  icon_url: S.optional(S.String),
475
442
  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>;
443
+ }).pipe(T.Http({ method: "POST", uri: "/assistant.threads.setStatus", code: 200 })),
444
+ ).annotate({ identifier: "SetStatusRequest" }) as any as S.Schema<SetStatusRequest>;
482
445
 
483
446
  export interface SetStatusResponse {
484
447
  /** Always `true` (a failed call raises a typed error instead). */
@@ -488,14 +451,12 @@ export const SetStatusResponse = /*@__PURE__*/ S.suspend(() =>
488
451
  S.Struct({
489
452
  ok: S.Boolean,
490
453
  }),
491
- ).annotate({
492
- identifier: "SetStatusResponse",
493
- }) as any as S.Schema<SetStatusResponse>;
454
+ ).annotate({ identifier: "SetStatusResponse" }) as any as S.Schema<SetStatusResponse>;
494
455
 
495
456
  export interface SetSuggestedPromptsRequest {
496
457
  /** Channel ID containing the assistant thread. */
497
458
  channel_id: string;
498
- /** Message timestamp of the thread to set suggested prompts for. */
459
+ /** 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. */
499
460
  thread_ts?: string;
500
461
  /** Each prompt should be supplied with its `title` and `message` attribute. */
501
462
  prompts: unknown;
@@ -508,13 +469,7 @@ export const SetSuggestedPromptsRequest = /*@__PURE__*/ S.suspend(() =>
508
469
  thread_ts: S.optional(S.String),
509
470
  prompts: S.Unknown,
510
471
  title: S.optional(S.String),
511
- }).pipe(
512
- T.Http({
513
- method: "POST",
514
- uri: "/assistant.threads.setSuggestedPrompts",
515
- code: 200,
516
- }),
517
- ),
472
+ }).pipe(T.Http({ method: "POST", uri: "/assistant.threads.setSuggestedPrompts", code: 200 })),
518
473
  ).annotate({
519
474
  identifier: "SetSuggestedPromptsRequest",
520
475
  }) as any as S.Schema<SetSuggestedPromptsRequest>;
@@ -544,12 +499,8 @@ export const SetTitleRequest = /*@__PURE__*/ S.suspend(() =>
544
499
  channel_id: S.String,
545
500
  thread_ts: S.String,
546
501
  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>;
502
+ }).pipe(T.Http({ method: "POST", uri: "/assistant.threads.setTitle", code: 200 })),
503
+ ).annotate({ identifier: "SetTitleRequest" }) as any as S.Schema<SetTitleRequest>;
553
504
 
554
505
  export interface SetTitleResponse {
555
506
  /** Always `true` (a failed call raises a typed error instead). */
@@ -559,9 +510,7 @@ export const SetTitleResponse = /*@__PURE__*/ S.suspend(() =>
559
510
  S.Struct({
560
511
  ok: S.Boolean,
561
512
  }),
562
- ).annotate({
563
- identifier: "SetTitleResponse",
564
- }) as any as S.Schema<SetTitleResponse>;
513
+ ).annotate({ identifier: "SetTitleResponse" }) as any as S.Schema<SetTitleResponse>;
565
514
 
566
515
  export type SearchContextError = SlackOpError;
567
516
  /** 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 */
@@ -594,7 +543,7 @@ export const searchInfo: API.OperationMethod<
594
543
  }));
595
544
 
596
545
  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 */
546
+ /** 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. - `method_not_supported_for_channel_type` — This type of conversation cannot be used with this method. Use `agents.sessions.setStatus` to set status in a session channel. See https://docs.slack.dev/reference/methods/assistant.threads.setStatus */
598
547
  export const setStatus: API.OperationMethod<
599
548
  SetStatusRequest,
600
549
  SetStatusResponse,
@@ -609,7 +558,7 @@ export const setStatus: API.OperationMethod<
609
558
  }));
610
559
 
611
560
  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 */
561
+ /** 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 - `missing_thread_ts` — Missing thread_ts - `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. - `static_prompts_configured` — Suggested prompts can't be set dynamically without thread_ts because the app already has static suggested prompts configured. Remove the static prompts in your app configuration to set them via this method without thread_ts. See https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts */
613
562
  export const setSuggestedPrompts: API.OperationMethod<
614
563
  SetSuggestedPromptsRequest,
615
564
  SetSuggestedPromptsResponse,
@@ -1,15 +1,11 @@
1
+ import * as API from "@distilled.cloud/core/api";
1
2
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
2
3
  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 { slackPaginate } from "../pagination.ts";
11
4
  import { SlackError, SlackRateLimited } from "../errors.ts";
5
+ import { slackPaginate } from "../pagination.ts";
6
+ import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
12
7
  import * as Retry from "../retry.ts";
8
+ import * as T from "../traits.ts";
13
9
 
14
10
  export type { SlackOpError, SlackOpContext };
15
11
 
@@ -27,16 +23,9 @@ export const ListTeamsRequest = /*@__PURE__*/ S.suspend(() =>
27
23
  cursor: S.optional(S.String),
28
24
  include_icon: S.optional(S.Boolean),
29
25
  }).pipe(
30
- T.Http({
31
- method: "POST",
32
- uri: "/auth.teams.list",
33
- code: 200,
34
- contentType: "form-urlencoded",
35
- }),
26
+ T.Http({ method: "POST", uri: "/auth.teams.list", code: 200, contentType: "form-urlencoded" }),
36
27
  ),
37
- ).annotate({
38
- identifier: "ListTeamsRequest",
39
- }) as any as S.Schema<ListTeamsRequest>;
28
+ ).annotate({ identifier: "ListTeamsRequest" }) as any as S.Schema<ListTeamsRequest>;
40
29
 
41
30
  /** Paths to icons */
42
31
  export interface ListTeamsResponseTeamsItemIcon {
@@ -113,9 +102,7 @@ export const ListTeamsResponse = /*@__PURE__*/ S.suspend(() =>
113
102
  teams: ListTeamsResponseTeamsList,
114
103
  response_metadata: S.optional(ListTeamsResponseResponseMetadata),
115
104
  }),
116
- ).annotate({
117
- identifier: "ListTeamsResponse",
118
- }) as any as S.Schema<ListTeamsResponse>;
105
+ ).annotate({ identifier: "ListTeamsResponse" }) as any as S.Schema<ListTeamsResponse>;
119
106
 
120
107
  export interface RevokeAuthRequest {
121
108
  /** Setting this parameter to `1` triggers a _testing mode_ where the specified token will not actually be revoked. */
@@ -125,9 +112,7 @@ export const RevokeAuthRequest = /*@__PURE__*/ S.suspend(() =>
125
112
  S.Struct({
126
113
  test: S.optional(S.Boolean.pipe(T.Query())),
127
114
  }).pipe(T.Http({ method: "GET", uri: "/auth.revoke", code: 200 })),
128
- ).annotate({
129
- identifier: "RevokeAuthRequest",
130
- }) as any as S.Schema<RevokeAuthRequest>;
115
+ ).annotate({ identifier: "RevokeAuthRequest" }) as any as S.Schema<RevokeAuthRequest>;
131
116
 
132
117
  export interface RevokeAuthResponse {
133
118
  /** Always `true` (a failed call raises a typed error instead). */
@@ -139,16 +124,12 @@ export const RevokeAuthResponse = /*@__PURE__*/ S.suspend(() =>
139
124
  ok: S.Boolean,
140
125
  revoked: S.Boolean,
141
126
  }),
142
- ).annotate({
143
- identifier: "RevokeAuthResponse",
144
- }) as any as S.Schema<RevokeAuthResponse>;
127
+ ).annotate({ identifier: "RevokeAuthResponse" }) as any as S.Schema<RevokeAuthResponse>;
145
128
 
146
129
  export interface TestAuthRequest {}
147
130
  export const TestAuthRequest = /*@__PURE__*/ S.suspend(() =>
148
131
  S.Struct({}).pipe(T.Http({ method: "POST", uri: "/auth.test", code: 200 })),
149
- ).annotate({
150
- identifier: "TestAuthRequest",
151
- }) as any as S.Schema<TestAuthRequest>;
132
+ ).annotate({ identifier: "TestAuthRequest" }) as any as S.Schema<TestAuthRequest>;
152
133
 
153
134
  export interface TestAuthResponse {
154
135
  /** Always `true` (a failed call raises a typed error instead). */
@@ -180,12 +161,10 @@ export const TestAuthResponse = /*@__PURE__*/ S.suspend(() =>
180
161
  is_enterprise_install: S.optional(S.Boolean),
181
162
  expires_in: S.optional(S.NullOr(S.Number)),
182
163
  }),
183
- ).annotate({
184
- identifier: "TestAuthResponse",
185
- }) as any as S.Schema<TestAuthResponse>;
164
+ ).annotate({ identifier: "TestAuthResponse" }) as any as S.Schema<TestAuthResponse>;
186
165
 
187
166
  export type ListTeamsError = SlackOpError;
188
- /** Obtain a full list of workspaces your org-wide app has been approved for. Rate limit tier: 2 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 */
167
+ /** 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 */
189
168
  export const listTeams: API.PaginatedOperationMethod<
190
169
  ListTeamsRequest,
191
170
  ListTeamsResponse,
@@ -1,38 +1,27 @@
1
+ import * as API from "@distilled.cloud/core/api";
1
2
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
2
3
  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
4
  import { SlackError, SlackRateLimited } from "../errors.ts";
5
+ import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
11
6
  import * as Retry from "../retry.ts";
7
+ import * as T from "../traits.ts";
12
8
 
13
9
  export type { SlackOpError, SlackOpContext };
14
10
 
15
- export type ValidateBlockRequestBlocksCase1ItemMap = {
16
- [key: string]: unknown | undefined;
17
- };
11
+ export type ValidateBlockRequestBlocksCase1ItemMap = { [key: string]: unknown | undefined };
18
12
  export const ValidateBlockRequestBlocksCase1ItemMap = /*@__PURE__*/ S.Record(
19
13
  S.String,
20
14
  S.Unknown,
21
15
  ) as any as S.Schema<ValidateBlockRequestBlocksCase1ItemMap>;
22
16
 
23
- export type ValidateBlockRequestBlocksCase1List =
24
- Array<ValidateBlockRequestBlocksCase1ItemMap>;
17
+ export type ValidateBlockRequestBlocksCase1List = Array<ValidateBlockRequestBlocksCase1ItemMap>;
25
18
  export const ValidateBlockRequestBlocksCase1List = /*@__PURE__*/ S.Array(
26
19
  ValidateBlockRequestBlocksCase1ItemMap,
27
20
  ) as any as S.Schema<ValidateBlockRequestBlocksCase1List>;
28
21
 
29
22
  /** A JSON-encoded array of [structured blocks](/reference/block-kit/blocks). Provide exactly one of `blocks`, `view`, or `message`. */
30
- export type ValidateBlockRequestBlocks =
31
- | string
32
- | ValidateBlockRequestBlocksCase1List;
33
- export const ValidateBlockRequestBlocks = /*@__PURE__*/ S.Unknown.pipe(
34
- T.UnionCases([[], []]),
35
- );
23
+ export type ValidateBlockRequestBlocks = string | ValidateBlockRequestBlocksCase1List;
24
+ export const ValidateBlockRequestBlocks = /*@__PURE__*/ S.Unknown.pipe(T.UnionCases([[], []]));
36
25
 
37
26
  export interface ValidateBlockRequest {
38
27
  /** A JSON-encoded array of [structured blocks](/reference/block-kit/blocks). Provide exactly one of `blocks`, `view`, or `message`. */
@@ -48,9 +37,7 @@ export const ValidateBlockRequest = /*@__PURE__*/ S.suspend(() =>
48
37
  message: S.optional(S.String),
49
38
  view: S.optional(S.String),
50
39
  }).pipe(T.Http({ method: "POST", uri: "/blocks.validate", code: 200 })),
51
- ).annotate({
52
- identifier: "ValidateBlockRequest",
53
- }) as any as S.Schema<ValidateBlockRequest>;
40
+ ).annotate({ identifier: "ValidateBlockRequest" }) as any as S.Schema<ValidateBlockRequest>;
54
41
 
55
42
  export interface ValidateBlockResponse {
56
43
  /** Always `true` (a failed call raises a typed error instead). */
@@ -60,9 +47,7 @@ export const ValidateBlockResponse = /*@__PURE__*/ S.suspend(() =>
60
47
  S.Struct({
61
48
  ok: S.Boolean,
62
49
  }),
63
- ).annotate({
64
- identifier: "ValidateBlockResponse",
65
- }) as any as S.Schema<ValidateBlockResponse>;
50
+ ).annotate({ identifier: "ValidateBlockResponse" }) as any as S.Schema<ValidateBlockResponse>;
66
51
 
67
52
  export type ValidateBlockError = SlackOpError;
68
53
  /** Validates blocks, messages, and views Block Kit JSON payloads. Method-specific errors (the `error` slug on the SlackError): - `invalid_arguments` — The request arguments are invalid. Ensure you provide exactly one of `blocks`, `view`, or `message`, and that the value is valid JSON. Consult `response_metadata.messages` for details. - `invalid_blocks` — The blocks array failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `invalid_view` — The view payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `invalid_message` — The message payload failed validation. The `errors` field contains a list of issues, each with a JSON pointer path to the invalid element, the constraint that failed, and the expected value. - `ratelimited` — Too many requests. Reduce your request rate and retry after a brief wait. See https://docs.slack.dev/reference/methods/blocks.validate */