@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,685 @@
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 { slackPaginate } from "../pagination.ts";
11
+ import { SlackError, SlackRateLimited } from "../errors.ts";
12
+ import * as Retry from "../retry.ts";
13
+
14
+ export type { SlackOpError, SlackOpContext };
15
+
16
+ export interface DeletePhotoRequest {}
17
+ export const DeletePhotoRequest = /*@__PURE__*/ S.suspend(() =>
18
+ S.Struct({}).pipe(
19
+ T.Http({ method: "GET", uri: "/users.deletePhoto", code: 200 }),
20
+ ),
21
+ ).annotate({
22
+ identifier: "DeletePhotoRequest",
23
+ }) as any as S.Schema<DeletePhotoRequest>;
24
+
25
+ export interface DeletePhotoResponse {
26
+ /** Always `true` (a failed call raises a typed error instead). */
27
+ ok: boolean;
28
+ }
29
+ export const DeletePhotoResponse = /*@__PURE__*/ S.suspend(() =>
30
+ S.Struct({
31
+ ok: S.Boolean,
32
+ }),
33
+ ).annotate({
34
+ identifier: "DeletePhotoResponse",
35
+ }) as any as S.Schema<DeletePhotoResponse>;
36
+
37
+ export interface GetPresenceRequest {
38
+ /** User to get presence info on. Defaults to the authed user. */
39
+ user?: string;
40
+ }
41
+ export const GetPresenceRequest = /*@__PURE__*/ S.suspend(() =>
42
+ S.Struct({
43
+ user: S.optional(S.String.pipe(T.Query())),
44
+ }).pipe(T.Http({ method: "GET", uri: "/users.getPresence", code: 200 })),
45
+ ).annotate({
46
+ identifier: "GetPresenceRequest",
47
+ }) as any as S.Schema<GetPresenceRequest>;
48
+
49
+ export interface GetPresenceResponse {
50
+ /** Always `true` (a failed call raises a typed error instead). */
51
+ ok: boolean;
52
+ last_activity?: number;
53
+ manual_away?: boolean;
54
+ presence: string;
55
+ online?: boolean;
56
+ connection_count?: number;
57
+ auto_away?: boolean;
58
+ }
59
+ export const GetPresenceResponse = /*@__PURE__*/ S.suspend(() =>
60
+ S.Struct({
61
+ ok: S.Boolean,
62
+ last_activity: S.optional(S.Number),
63
+ manual_away: S.optional(S.Boolean),
64
+ presence: S.String,
65
+ online: S.optional(S.Boolean),
66
+ connection_count: S.optional(S.Number),
67
+ auto_away: S.optional(S.Boolean),
68
+ }),
69
+ ).annotate({
70
+ identifier: "GetPresenceResponse",
71
+ }) as any as S.Schema<GetPresenceResponse>;
72
+
73
+ export interface GetProfileRequest {
74
+ /** Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended. */
75
+ include_labels?: boolean;
76
+ /** User to retrieve profile info for */
77
+ user?: string;
78
+ }
79
+ export const GetProfileRequest = /*@__PURE__*/ S.suspend(() =>
80
+ S.Struct({
81
+ include_labels: S.optional(S.Boolean.pipe(T.Query())),
82
+ user: S.optional(S.String.pipe(T.Query())),
83
+ }).pipe(T.Http({ method: "GET", uri: "/users.profile.get", code: 200 })),
84
+ ).annotate({
85
+ identifier: "GetProfileRequest",
86
+ }) as any as S.Schema<GetProfileRequest>;
87
+
88
+ export interface GetProfileResponse {
89
+ /** Always `true` (a failed call raises a typed error instead). */
90
+ ok: boolean;
91
+ profile: unknown;
92
+ }
93
+ export const GetProfileResponse = /*@__PURE__*/ S.suspend(() =>
94
+ S.Struct({
95
+ ok: S.Boolean,
96
+ profile: S.Unknown,
97
+ }),
98
+ ).annotate({
99
+ identifier: "GetProfileResponse",
100
+ }) as any as S.Schema<GetProfileResponse>;
101
+
102
+ export interface ListUsersRequest {
103
+ /** Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more detail. */
104
+ cursor?: string;
105
+ /** Set this to `true` to receive the locale for users. Defaults to `false` */
106
+ include_locale?: boolean;
107
+ /** The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no `limit` value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience `limit_required` or HTTP 500 errors. */
108
+ limit?: number;
109
+ /** encoded team id to list users in, required if org token is used */
110
+ team_id?: string;
111
+ }
112
+ export const ListUsersRequest = /*@__PURE__*/ S.suspend(() =>
113
+ S.Struct({
114
+ cursor: S.optional(S.String.pipe(T.Query())),
115
+ include_locale: S.optional(S.Boolean.pipe(T.Query())),
116
+ limit: S.optional(S.Number.pipe(T.Query())),
117
+ team_id: S.optional(S.String.pipe(T.Query())),
118
+ }).pipe(T.Http({ method: "GET", uri: "/users.list", code: 200 })),
119
+ ).annotate({
120
+ identifier: "ListUsersRequest",
121
+ }) as any as S.Schema<ListUsersRequest>;
122
+
123
+ export type ListUsersResponseMembersList = Array<unknown>;
124
+ export const ListUsersResponseMembersList = /*@__PURE__*/ S.Array(
125
+ S.Unknown,
126
+ ) as any as S.Schema<ListUsersResponseMembersList>;
127
+
128
+ /** Pagination metadata. An empty `next_cursor` means the last page. */
129
+ export interface ListUsersResponseResponseMetadata {
130
+ /** Cursor for the next page — pass as `cursor` on the next call. */
131
+ next_cursor?: string;
132
+ }
133
+ export const ListUsersResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
134
+ S.Struct({
135
+ next_cursor: S.optional(S.String),
136
+ }),
137
+ ).annotate({
138
+ identifier: "ListUsersResponseResponseMetadata",
139
+ }) as any as S.Schema<ListUsersResponseResponseMetadata>;
140
+
141
+ export interface ListUsersResponse {
142
+ /** Always `true` (a failed call raises a typed error instead). */
143
+ ok: boolean;
144
+ members: ListUsersResponseMembersList;
145
+ cache_ts: number;
146
+ /** Pagination metadata. An empty `next_cursor` means the last page. */
147
+ response_metadata?: ListUsersResponseResponseMetadata;
148
+ offset?: string;
149
+ }
150
+ export const ListUsersResponse = /*@__PURE__*/ S.suspend(() =>
151
+ S.Struct({
152
+ ok: S.Boolean,
153
+ members: ListUsersResponseMembersList,
154
+ cache_ts: S.Number,
155
+ response_metadata: S.optional(ListUsersResponseResponseMetadata),
156
+ offset: S.optional(S.String),
157
+ }),
158
+ ).annotate({
159
+ identifier: "ListUsersResponse",
160
+ }) as any as S.Schema<ListUsersResponse>;
161
+
162
+ export interface LookupByEmailRequest {
163
+ /** An email address belonging to a user in the workspace */
164
+ email: string;
165
+ }
166
+ export const LookupByEmailRequest = /*@__PURE__*/ S.suspend(() =>
167
+ S.Struct({
168
+ email: S.String.pipe(T.Query()),
169
+ }).pipe(T.Http({ method: "GET", uri: "/users.lookupByEmail", code: 200 })),
170
+ ).annotate({
171
+ identifier: "LookupByEmailRequest",
172
+ }) as any as S.Schema<LookupByEmailRequest>;
173
+
174
+ export interface LookupByEmailResponse {
175
+ /** Always `true` (a failed call raises a typed error instead). */
176
+ ok: boolean;
177
+ user: unknown;
178
+ }
179
+ export const LookupByEmailResponse = /*@__PURE__*/ S.suspend(() =>
180
+ S.Struct({
181
+ ok: S.Boolean,
182
+ user: S.Unknown,
183
+ }),
184
+ ).annotate({
185
+ identifier: "LookupByEmailResponse",
186
+ }) as any as S.Schema<LookupByEmailResponse>;
187
+
188
+ export interface LookupDiscoverableContactRequest {
189
+ email: string;
190
+ }
191
+ export const LookupDiscoverableContactRequest = /*@__PURE__*/ S.suspend(() =>
192
+ S.Struct({
193
+ email: S.String,
194
+ }).pipe(
195
+ T.Http({
196
+ method: "POST",
197
+ uri: "/users.discoverableContacts.lookup",
198
+ code: 200,
199
+ }),
200
+ ),
201
+ ).annotate({
202
+ identifier: "LookupDiscoverableContactRequest",
203
+ }) as any as S.Schema<LookupDiscoverableContactRequest>;
204
+
205
+ export interface LookupDiscoverableContactResponse {
206
+ /** Always `true` (a failed call raises a typed error instead). */
207
+ ok: boolean;
208
+ is_discoverable: boolean;
209
+ }
210
+ export const LookupDiscoverableContactResponse = /*@__PURE__*/ S.suspend(() =>
211
+ S.Struct({
212
+ ok: S.Boolean,
213
+ is_discoverable: S.Boolean,
214
+ }),
215
+ ).annotate({
216
+ identifier: "LookupDiscoverableContactResponse",
217
+ }) as any as S.Schema<LookupDiscoverableContactResponse>;
218
+
219
+ export interface SetActiveRequest {}
220
+ export const SetActiveRequest = /*@__PURE__*/ S.suspend(() =>
221
+ S.Struct({}).pipe(
222
+ T.Http({ method: "POST", uri: "/users.setActive", code: 200 }),
223
+ ),
224
+ ).annotate({
225
+ identifier: "SetActiveRequest",
226
+ }) as any as S.Schema<SetActiveRequest>;
227
+
228
+ export interface SetActiveResponse {
229
+ /** Always `true` (a failed call raises a typed error instead). */
230
+ ok: boolean;
231
+ }
232
+ export const SetActiveResponse = /*@__PURE__*/ S.suspend(() =>
233
+ S.Struct({
234
+ ok: S.Boolean,
235
+ }),
236
+ ).annotate({
237
+ identifier: "SetActiveResponse",
238
+ }) as any as S.Schema<SetActiveResponse>;
239
+
240
+ export interface SetPhotoRequest {
241
+ /** Width/height of crop box (always square) */
242
+ crop_w?: string;
243
+ /** X coordinate of top-left corner of crop box */
244
+ crop_x?: string;
245
+ /** Y coordinate of top-left corner of crop box */
246
+ crop_y?: string;
247
+ /** File contents via `multipart/form-data`. */
248
+ image?: unknown;
249
+ }
250
+ export const SetPhotoRequest = /*@__PURE__*/ S.suspend(() =>
251
+ S.Struct({
252
+ crop_w: S.optional(S.String),
253
+ crop_x: S.optional(S.String),
254
+ crop_y: S.optional(S.String),
255
+ image: S.optional(S.Unknown),
256
+ }).pipe(
257
+ T.Http({
258
+ method: "POST",
259
+ uri: "/users.setPhoto",
260
+ code: 200,
261
+ contentType: "form-urlencoded",
262
+ }),
263
+ ),
264
+ ).annotate({
265
+ identifier: "SetPhotoRequest",
266
+ }) as any as S.Schema<SetPhotoRequest>;
267
+
268
+ export type SetPhotoResponseProfileMap = { [key: string]: unknown | undefined };
269
+ export const SetPhotoResponseProfileMap = /*@__PURE__*/ S.Record(
270
+ S.String,
271
+ S.Unknown,
272
+ ) as any as S.Schema<SetPhotoResponseProfileMap>;
273
+
274
+ export interface SetPhotoResponse {
275
+ /** Always `true` (a failed call raises a typed error instead). */
276
+ ok: boolean;
277
+ profile: SetPhotoResponseProfileMap;
278
+ }
279
+ export const SetPhotoResponse = /*@__PURE__*/ S.suspend(() =>
280
+ S.Struct({
281
+ ok: S.Boolean,
282
+ profile: SetPhotoResponseProfileMap,
283
+ }),
284
+ ).annotate({
285
+ identifier: "SetPhotoResponse",
286
+ }) as any as S.Schema<SetPhotoResponse>;
287
+
288
+ /** Either `auto` or `away` */
289
+ export type SetPresenceRequestPresence = "auto" | "away";
290
+ export const SetPresenceRequestPresence = /*@__PURE__*/ S.String;
291
+
292
+ export interface SetPresenceRequest {
293
+ /** Either `auto` or `away` */
294
+ presence: SetPresenceRequestPresence | (string & {});
295
+ }
296
+ export const SetPresenceRequest = /*@__PURE__*/ S.suspend(() =>
297
+ S.Struct({
298
+ presence: SetPresenceRequestPresence,
299
+ }).pipe(T.Http({ method: "POST", uri: "/users.setPresence", code: 200 })),
300
+ ).annotate({
301
+ identifier: "SetPresenceRequest",
302
+ }) as any as S.Schema<SetPresenceRequest>;
303
+
304
+ export interface SetPresenceResponse {
305
+ /** Always `true` (a failed call raises a typed error instead). */
306
+ ok: boolean;
307
+ }
308
+ export const SetPresenceResponse = /*@__PURE__*/ S.suspend(() =>
309
+ S.Struct({
310
+ ok: S.Boolean,
311
+ }),
312
+ ).annotate({
313
+ identifier: "SetPresenceResponse",
314
+ }) as any as S.Schema<SetPresenceResponse>;
315
+
316
+ export interface SetProfileRequest {
317
+ /** Name of a single key to set. Usable only if `profile` is not passed. */
318
+ name?: string;
319
+ /** Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters. */
320
+ profile?: string;
321
+ /** ID of user to change. This argument may only be specified by admins on paid teams. */
322
+ user?: string;
323
+ /** Value to set a single key to. Usable only if `profile` is not passed. */
324
+ value?: string;
325
+ }
326
+ export const SetProfileRequest = /*@__PURE__*/ S.suspend(() =>
327
+ S.Struct({
328
+ name: S.optional(S.String),
329
+ profile: S.optional(S.String),
330
+ user: S.optional(S.String),
331
+ value: S.optional(S.String),
332
+ }).pipe(T.Http({ method: "POST", uri: "/users.profile.set", code: 200 })),
333
+ ).annotate({
334
+ identifier: "SetProfileRequest",
335
+ }) as any as S.Schema<SetProfileRequest>;
336
+
337
+ export interface SetProfileResponse {
338
+ /** Always `true` (a failed call raises a typed error instead). */
339
+ ok: boolean;
340
+ username: string;
341
+ profile: unknown;
342
+ email_pending?: string;
343
+ }
344
+ export const SetProfileResponse = /*@__PURE__*/ S.suspend(() =>
345
+ S.Struct({
346
+ ok: S.Boolean,
347
+ username: S.String,
348
+ profile: S.Unknown,
349
+ email_pending: S.optional(S.String),
350
+ }),
351
+ ).annotate({
352
+ identifier: "SetProfileResponse",
353
+ }) as any as S.Schema<SetProfileResponse>;
354
+
355
+ export interface UsersConversationsRequest {
356
+ /** Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more detail. */
357
+ cursor?: string;
358
+ /** Set to `true` to exclude archived channels from the list */
359
+ exclude_archived?: boolean;
360
+ /** Set to `true` to exclude muted channels from the list */
361
+ exclude_muted?: boolean;
362
+ /** The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer with a max value of 999. */
363
+ limit?: number;
364
+ /** encoded team id to list conversations in, required if org token is used */
365
+ team_id?: string;
366
+ /** Mix and match channel types by providing a comma-separated list of any combination of `public_channel`, `private_channel`, `mpim`, `im` */
367
+ types?: string;
368
+ /** Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership. */
369
+ user?: string;
370
+ }
371
+ export const UsersConversationsRequest = /*@__PURE__*/ S.suspend(() =>
372
+ S.Struct({
373
+ cursor: S.optional(S.String.pipe(T.Query())),
374
+ exclude_archived: S.optional(S.Boolean.pipe(T.Query())),
375
+ exclude_muted: S.optional(S.Boolean.pipe(T.Query())),
376
+ limit: S.optional(S.Number.pipe(T.Query())),
377
+ team_id: S.optional(S.String.pipe(T.Query())),
378
+ types: S.optional(S.String.pipe(T.Query())),
379
+ user: S.optional(S.String.pipe(T.Query())),
380
+ }).pipe(T.Http({ method: "GET", uri: "/users.conversations", code: 200 })),
381
+ ).annotate({
382
+ identifier: "UsersConversationsRequest",
383
+ }) as any as S.Schema<UsersConversationsRequest>;
384
+
385
+ export type UsersConversationsResponseChannelsList = Array<unknown>;
386
+ export const UsersConversationsResponseChannelsList = /*@__PURE__*/ S.Array(
387
+ S.Unknown,
388
+ ) as any as S.Schema<UsersConversationsResponseChannelsList>;
389
+
390
+ /** Pagination metadata. An empty `next_cursor` means the last page. */
391
+ export type UsersConversationsResponseResponseMetadata =
392
+ ListUsersResponseResponseMetadata;
393
+ export const UsersConversationsResponseResponseMetadata =
394
+ ListUsersResponseResponseMetadata;
395
+
396
+ export interface UsersConversationsResponse {
397
+ /** Always `true` (a failed call raises a typed error instead). */
398
+ ok: boolean;
399
+ channels: UsersConversationsResponseChannelsList;
400
+ /** Pagination metadata. An empty `next_cursor` means the last page. */
401
+ response_metadata?: ListUsersResponseResponseMetadata;
402
+ }
403
+ export const UsersConversationsResponse = /*@__PURE__*/ S.suspend(() =>
404
+ S.Struct({
405
+ ok: S.Boolean,
406
+ channels: UsersConversationsResponseChannelsList,
407
+ response_metadata: S.optional(ListUsersResponseResponseMetadata),
408
+ }),
409
+ ).annotate({
410
+ identifier: "UsersConversationsResponse",
411
+ }) as any as S.Schema<UsersConversationsResponse>;
412
+
413
+ export interface UsersIdentityRequest {}
414
+ export const UsersIdentityRequest = /*@__PURE__*/ S.suspend(() =>
415
+ S.Struct({}).pipe(
416
+ T.Http({ method: "GET", uri: "/users.identity", code: 200 }),
417
+ ),
418
+ ).annotate({
419
+ identifier: "UsersIdentityRequest",
420
+ }) as any as S.Schema<UsersIdentityRequest>;
421
+
422
+ export interface UsersIdentityResponse {
423
+ /** Always `true` (a failed call raises a typed error instead). */
424
+ ok: boolean;
425
+ }
426
+ export const UsersIdentityResponse = /*@__PURE__*/ S.suspend(() =>
427
+ S.Struct({
428
+ ok: S.Boolean,
429
+ }),
430
+ ).annotate({
431
+ identifier: "UsersIdentityResponse",
432
+ }) as any as S.Schema<UsersIdentityResponse>;
433
+
434
+ export interface UsersInfoRequest {
435
+ /** Set this to `true` to receive the locale for this user. Defaults to `false` */
436
+ include_locale?: boolean;
437
+ /** User to get info on */
438
+ user: string;
439
+ }
440
+ export const UsersInfoRequest = /*@__PURE__*/ S.suspend(() =>
441
+ S.Struct({
442
+ include_locale: S.optional(S.Boolean.pipe(T.Query())),
443
+ user: S.String.pipe(T.Query()),
444
+ }).pipe(T.Http({ method: "GET", uri: "/users.info", code: 200 })),
445
+ ).annotate({
446
+ identifier: "UsersInfoRequest",
447
+ }) as any as S.Schema<UsersInfoRequest>;
448
+
449
+ export type UsersInfoResponseUsersList = Array<unknown>;
450
+ export const UsersInfoResponseUsersList = /*@__PURE__*/ S.Array(
451
+ S.Unknown,
452
+ ) as any as S.Schema<UsersInfoResponseUsersList>;
453
+
454
+ export interface UsersInfoResponse {
455
+ /** Always `true` (a failed call raises a typed error instead). */
456
+ ok: boolean;
457
+ user?: unknown;
458
+ users?: UsersInfoResponseUsersList;
459
+ }
460
+ export const UsersInfoResponse = /*@__PURE__*/ S.suspend(() =>
461
+ S.Struct({
462
+ ok: S.Boolean,
463
+ user: S.optional(S.Unknown),
464
+ users: S.optional(UsersInfoResponseUsersList),
465
+ }),
466
+ ).annotate({
467
+ identifier: "UsersInfoResponse",
468
+ }) as any as S.Schema<UsersInfoResponse>;
469
+
470
+ export type DeletePhotoError = SlackOpError;
471
+ /** Delete the user profile photo Required scopes — user: `users.profile:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `internal_error` — An unexpected error occurred. See https://docs.slack.dev/reference/methods/users.deletePhoto */
472
+ export const deletePhoto: API.OperationMethod<
473
+ DeletePhotoRequest,
474
+ DeletePhotoResponse,
475
+ DeletePhotoError,
476
+ SlackOpContext
477
+ > = /*@__PURE__*/ API.make(() => ({
478
+ input: DeletePhotoRequest,
479
+ output: DeletePhotoResponse,
480
+ errors: [SlackError, SlackRateLimited],
481
+ protocol: SlackProtocol,
482
+ retry: Retry.Retry,
483
+ }));
484
+
485
+ export type GetPresenceError = SlackOpError;
486
+ /** Gets user presence information. Required scopes — bot: `users:read`; user: `users:read` Rate limit tier: 3 See https://docs.slack.dev/reference/methods/users.getPresence */
487
+ export const getPresence: API.OperationMethod<
488
+ GetPresenceRequest,
489
+ GetPresenceResponse,
490
+ GetPresenceError,
491
+ SlackOpContext
492
+ > = /*@__PURE__*/ API.make(() => ({
493
+ input: GetPresenceRequest,
494
+ output: GetPresenceResponse,
495
+ errors: [SlackError, SlackRateLimited],
496
+ protocol: SlackProtocol,
497
+ retry: Retry.Retry,
498
+ }));
499
+
500
+ export type GetProfileError = SlackOpError;
501
+ /** Retrieve a user's profile information, including their custom status. Required scopes — bot: `users.profile:read`; user: `users.profile:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `user_not_found` — Value passed for `user` was invalid. - `token_revoked` — The token being used is not valid. - `ratelimited` — You are attempting to call this method too frequently. See https://docs.slack.dev/reference/methods/users.profile.get */
502
+ export const getProfile: API.OperationMethod<
503
+ GetProfileRequest,
504
+ GetProfileResponse,
505
+ GetProfileError,
506
+ SlackOpContext
507
+ > = /*@__PURE__*/ API.make(() => ({
508
+ input: GetProfileRequest,
509
+ output: GetProfileResponse,
510
+ errors: [SlackError, SlackRateLimited],
511
+ protocol: SlackProtocol,
512
+ retry: Retry.Retry,
513
+ }));
514
+
515
+ export type ListUsersError = SlackOpError;
516
+ /** Lists all users in a Slack team. Required scopes — bot: `users:read`; user: `users:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` — Value passed for `cursor` was not valid or is no longer valid. - `limit_required` — For large teams a limit is required. - `missing_argument` — A required argument is missing. See https://docs.slack.dev/reference/methods/users.list */
517
+ export const listUsers: API.PaginatedOperationMethod<
518
+ ListUsersRequest,
519
+ ListUsersResponse,
520
+ ListUsersError,
521
+ SlackOpContext,
522
+ unknown
523
+ > = /*@__PURE__*/ API.makePaginated(
524
+ () => ({
525
+ input: ListUsersRequest,
526
+ output: ListUsersResponse,
527
+ errors: [SlackError, SlackRateLimited],
528
+ protocol: SlackProtocol,
529
+ retry: Retry.Retry,
530
+ pagination: {
531
+ mode: "cursor",
532
+ inputToken: "cursor",
533
+ outputToken: "response_metadata.next_cursor",
534
+ items: "members",
535
+ pageSize: "limit",
536
+ } as const,
537
+ }),
538
+ slackPaginate,
539
+ ) as any;
540
+
541
+ export type LookupByEmailError = SlackOpError;
542
+ /** Find a user with an email address. Required scopes — bot: `users:read.email`; user: `users:read.email` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `enterprise_is_restricted` — This method was called with an inappropriate enterprise-level token. - `users_not_found` — Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/users.lookupByEmail */
543
+ export const lookupByEmail: API.OperationMethod<
544
+ LookupByEmailRequest,
545
+ LookupByEmailResponse,
546
+ LookupByEmailError,
547
+ SlackOpContext
548
+ > = /*@__PURE__*/ API.make(() => ({
549
+ input: LookupByEmailRequest,
550
+ output: LookupByEmailResponse,
551
+ errors: [SlackError, SlackRateLimited],
552
+ protocol: SlackProtocol,
553
+ retry: Retry.Retry,
554
+ }));
555
+
556
+ export type LookupDiscoverableContactError = SlackOpError;
557
+ /** Look up an email address to see if someone is discoverable on Slack Required scopes — bot: `conversations.connect:manage`, `team:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_allowed` — user is not allowed to call this API - `ratelimited` — too many attempts - `invalid_arguments` — Invalid arguments (including exceeding character count) - `restricted_action` — user is restricted from calling this API - `not_an_enterprise` — The token does not belong to an enterprise. See https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup */
558
+ export const lookupDiscoverableContact: API.OperationMethod<
559
+ LookupDiscoverableContactRequest,
560
+ LookupDiscoverableContactResponse,
561
+ LookupDiscoverableContactError,
562
+ SlackOpContext
563
+ > = /*@__PURE__*/ API.make(() => ({
564
+ input: LookupDiscoverableContactRequest,
565
+ output: LookupDiscoverableContactResponse,
566
+ errors: [SlackError, SlackRateLimited],
567
+ protocol: SlackProtocol,
568
+ retry: Retry.Retry,
569
+ }));
570
+
571
+ export type SetActiveError = SlackOpError;
572
+ /** Marked a user as active. Deprecated and non-functional. Required scopes — bot: `users:write`; user: `users:write` Rate limit tier: 2 See https://docs.slack.dev/reference/methods/users.setActive */
573
+ export const setActive: API.OperationMethod<
574
+ SetActiveRequest,
575
+ SetActiveResponse,
576
+ SetActiveError,
577
+ SlackOpContext
578
+ > = /*@__PURE__*/ API.make(() => ({
579
+ input: SetActiveRequest,
580
+ output: SetActiveResponse,
581
+ errors: [SlackError, SlackRateLimited],
582
+ protocol: SlackProtocol,
583
+ retry: Retry.Retry,
584
+ }));
585
+
586
+ export type SetPhotoError = SlackOpError;
587
+ /** Set the user profile photo Required scopes — user: `users.profile:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_image` — The uploaded image could not be processed - try passing a JPEG, GIF or PNG - `internal_error` — An unexpected error occurred. - `too_large` — The uploaded image had excessive dimensions - `too_many_frames` — An animated GIF with too many frames was uploaded See https://docs.slack.dev/reference/methods/users.setPhoto */
588
+ export const setPhoto: API.OperationMethod<
589
+ SetPhotoRequest,
590
+ SetPhotoResponse,
591
+ SetPhotoError,
592
+ SlackOpContext
593
+ > = /*@__PURE__*/ API.make(() => ({
594
+ input: SetPhotoRequest,
595
+ output: SetPhotoResponse,
596
+ errors: [SlackError, SlackRateLimited],
597
+ protocol: SlackProtocol,
598
+ retry: Retry.Retry,
599
+ }));
600
+
601
+ export type SetPresenceError = SlackOpError;
602
+ /** Manually sets user presence. Required scopes — bot: `users:write`; user: `users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_presence` — Value passed for `presence` was invalid. See https://docs.slack.dev/reference/methods/users.setPresence */
603
+ export const setPresence: API.OperationMethod<
604
+ SetPresenceRequest,
605
+ SetPresenceResponse,
606
+ SetPresenceError,
607
+ SlackOpContext
608
+ > = /*@__PURE__*/ API.make(() => ({
609
+ input: SetPresenceRequest,
610
+ output: SetPresenceResponse,
611
+ errors: [SlackError, SlackRateLimited],
612
+ protocol: SlackProtocol,
613
+ retry: Retry.Retry,
614
+ }));
615
+
616
+ export type SetProfileError = SlackOpError;
617
+ /** Set a user's profile information, including custom status. Required scopes — user: `users.profile:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cannot_update_admin_user` — Only a primary owner can update the profile of an admin. - `email_taken` — email taken - `invalid_profile` — Profile object passed in is not valid JSON (make sure it is URL encoded!). - `must_clear_both_status_text_and_status_emoji` — Clearing the status requires setting both `status_text` and `status_emoji` to ''. - `name_not_allowed` — name cannot contain URL. - `not_admin` — Only admins can update the profile of another user. Some fields, like `email` may only be updated by an admin. - `not_app_admin` — Only team owners and selected members can update the profile of a bot user. - `partial_profile_set_failed` — Failed to set user profile. - `profile_set_failed` — Failed to set user profile. - `reserved_name` — First or last name are reserved. - `sudo_required` — Request requires sudo session. - `too_long` — You attempted to set a custom status but it was longer than the maximum allowed, 100. - `permission_denied` — Permission denied. - `username_same` — Username is the same as the current username. - `invalid_emoji_not_allowed` — Invalid emoji not allowed. - `invalid_ooo_message` — Invalid Out of Office message. - `invalid_starts_with_at` — Name cannot start with @. See https://docs.slack.dev/reference/methods/users.profile.set */
618
+ export const setProfile: API.OperationMethod<
619
+ SetProfileRequest,
620
+ SetProfileResponse,
621
+ SetProfileError,
622
+ SlackOpContext
623
+ > = /*@__PURE__*/ API.make(() => ({
624
+ input: SetProfileRequest,
625
+ output: SetProfileResponse,
626
+ errors: [SlackError, SlackRateLimited],
627
+ protocol: SlackProtocol,
628
+ retry: Retry.Retry,
629
+ }));
630
+
631
+ export type UsersConversationsError = SlackOpError;
632
+ /** List conversations the calling user is a member of. Required scopes — bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` — Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` — Value passed for `limit` is not understood. - `invalid_types` — Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. - `method_not_supported_for_channel_type` — This type of conversation cannot be used with this method. - `missing_argument` — A required argument is missing. - `missing_scope` — The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/users.conversations */
633
+ export const usersConversations: API.PaginatedOperationMethod<
634
+ UsersConversationsRequest,
635
+ UsersConversationsResponse,
636
+ UsersConversationsError,
637
+ SlackOpContext,
638
+ unknown
639
+ > = /*@__PURE__*/ API.makePaginated(
640
+ () => ({
641
+ input: UsersConversationsRequest,
642
+ output: UsersConversationsResponse,
643
+ errors: [SlackError, SlackRateLimited],
644
+ protocol: SlackProtocol,
645
+ retry: Retry.Retry,
646
+ pagination: {
647
+ mode: "cursor",
648
+ inputToken: "cursor",
649
+ outputToken: "response_metadata.next_cursor",
650
+ items: "channels",
651
+ pageSize: "limit",
652
+ } as const,
653
+ }),
654
+ slackPaginate,
655
+ ) as any;
656
+
657
+ export type UsersIdentityError = SlackOpError;
658
+ /** Get a user's identity. Required scopes — user: `identity:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` — Internal error - `invalid_user_id` — Invalid user id provided - `email_not_verified` — user email has not been verified See https://docs.slack.dev/reference/methods/users.identity */
659
+ export const usersIdentity: API.OperationMethod<
660
+ UsersIdentityRequest,
661
+ UsersIdentityResponse,
662
+ UsersIdentityError,
663
+ SlackOpContext
664
+ > = /*@__PURE__*/ API.make(() => ({
665
+ input: UsersIdentityRequest,
666
+ output: UsersIdentityResponse,
667
+ errors: [SlackError, SlackRateLimited],
668
+ protocol: SlackProtocol,
669
+ retry: Retry.Retry,
670
+ }));
671
+
672
+ export type UsersInfoError = SlackOpError;
673
+ /** Gets information about a user. Required scopes — bot: `users:read`; user: `users:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `too_many_users` — Too many users. - `user_not_found` — Value passed for `user` was invalid. - `user_not_visible` — The requested user is not visible to the calling user See https://docs.slack.dev/reference/methods/users.info */
674
+ export const usersInfo: API.OperationMethod<
675
+ UsersInfoRequest,
676
+ UsersInfoResponse,
677
+ UsersInfoError,
678
+ SlackOpContext
679
+ > = /*@__PURE__*/ API.make(() => ({
680
+ input: UsersInfoRequest,
681
+ output: UsersInfoResponse,
682
+ errors: [SlackError, SlackRateLimited],
683
+ protocol: SlackProtocol,
684
+ retry: Retry.Retry,
685
+ }));