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

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 +3217 -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 +256 -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 +333 -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 +238 -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 +7722 -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 +642 -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 +834 -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 +605 -0
  212. package/src/traits.ts +45 -0
@@ -0,0 +1,240 @@
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 interface AddReminderRequest {
16
+ /** The content of the reminder */
17
+ text: string;
18
+ /** Can also take a type of integer. When this reminder should happen: the Unix timestamp (up to five years from now), the number of seconds until the reminder (if within 24 hours), or a natural language description (Ex. "in 15 minutes," or "every Thursday") */
19
+ time: string;
20
+ /** No longer supported - reminders cannot be set for other users. Previously, was the user who would receive the reminder. */
21
+ user?: string;
22
+ /** Encoded team id, required if org token is used */
23
+ team_id?: string;
24
+ /** Specify the repeating behavior of a reminder. Available options: `daily`, `weekly`, `monthly`, or `yearly`. If `weekly`, may further specify the days of the week. */
25
+ recurrence?: unknown;
26
+ }
27
+ export const AddReminderRequest = /*@__PURE__*/ S.suspend(() =>
28
+ S.Struct({
29
+ text: S.String,
30
+ time: S.String,
31
+ user: S.optional(S.String),
32
+ team_id: S.optional(S.String),
33
+ recurrence: S.optional(S.Unknown),
34
+ }).pipe(T.Http({ method: "POST", uri: "/reminders.add", code: 200 })),
35
+ ).annotate({
36
+ identifier: "AddReminderRequest",
37
+ }) as any as S.Schema<AddReminderRequest>;
38
+
39
+ export interface AddReminderResponse {
40
+ /** Always `true` (a failed call raises a typed error instead). */
41
+ ok: boolean;
42
+ reminder: unknown;
43
+ }
44
+ export const AddReminderResponse = /*@__PURE__*/ S.suspend(() =>
45
+ S.Struct({
46
+ ok: S.Boolean,
47
+ reminder: S.Unknown,
48
+ }),
49
+ ).annotate({
50
+ identifier: "AddReminderResponse",
51
+ }) as any as S.Schema<AddReminderResponse>;
52
+
53
+ export interface CompleteReminderRequest {
54
+ /** The ID of the reminder to be marked as complete */
55
+ reminder: string;
56
+ /** Encoded team id, required if org token is used */
57
+ team_id?: string;
58
+ }
59
+ export const CompleteReminderRequest = /*@__PURE__*/ S.suspend(() =>
60
+ S.Struct({
61
+ reminder: S.String,
62
+ team_id: S.optional(S.String),
63
+ }).pipe(T.Http({ method: "POST", uri: "/reminders.complete", code: 200 })),
64
+ ).annotate({
65
+ identifier: "CompleteReminderRequest",
66
+ }) as any as S.Schema<CompleteReminderRequest>;
67
+
68
+ export interface CompleteReminderResponse {
69
+ /** Always `true` (a failed call raises a typed error instead). */
70
+ ok: boolean;
71
+ }
72
+ export const CompleteReminderResponse = /*@__PURE__*/ S.suspend(() =>
73
+ S.Struct({
74
+ ok: S.Boolean,
75
+ }),
76
+ ).annotate({
77
+ identifier: "CompleteReminderResponse",
78
+ }) as any as S.Schema<CompleteReminderResponse>;
79
+
80
+ export interface DeleteReminderRequest {
81
+ /** The ID of the reminder */
82
+ reminder: string;
83
+ /** Encoded team id, required if org token is used */
84
+ team_id?: string;
85
+ }
86
+ export const DeleteReminderRequest = /*@__PURE__*/ S.suspend(() =>
87
+ S.Struct({
88
+ reminder: S.String,
89
+ team_id: S.optional(S.String),
90
+ }).pipe(T.Http({ method: "POST", uri: "/reminders.delete", code: 200 })),
91
+ ).annotate({
92
+ identifier: "DeleteReminderRequest",
93
+ }) as any as S.Schema<DeleteReminderRequest>;
94
+
95
+ export interface DeleteReminderResponse {
96
+ /** Always `true` (a failed call raises a typed error instead). */
97
+ ok: boolean;
98
+ }
99
+ export const DeleteReminderResponse = /*@__PURE__*/ S.suspend(() =>
100
+ S.Struct({
101
+ ok: S.Boolean,
102
+ }),
103
+ ).annotate({
104
+ identifier: "DeleteReminderResponse",
105
+ }) as any as S.Schema<DeleteReminderResponse>;
106
+
107
+ export interface ListRemindersRequest {
108
+ /** Encoded team id, required if org token is passed */
109
+ team_id?: string;
110
+ }
111
+ export const ListRemindersRequest = /*@__PURE__*/ S.suspend(() =>
112
+ S.Struct({
113
+ team_id: S.optional(S.String.pipe(T.Query())),
114
+ }).pipe(T.Http({ method: "GET", uri: "/reminders.list", code: 200 })),
115
+ ).annotate({
116
+ identifier: "ListRemindersRequest",
117
+ }) as any as S.Schema<ListRemindersRequest>;
118
+
119
+ export type ListRemindersResponseRemindersList = Array<unknown>;
120
+ export const ListRemindersResponseRemindersList = /*@__PURE__*/ S.Array(
121
+ S.Unknown,
122
+ ) as any as S.Schema<ListRemindersResponseRemindersList>;
123
+
124
+ export interface ListRemindersResponse {
125
+ /** Always `true` (a failed call raises a typed error instead). */
126
+ ok: boolean;
127
+ reminders?: ListRemindersResponseRemindersList;
128
+ }
129
+ export const ListRemindersResponse = /*@__PURE__*/ S.suspend(() =>
130
+ S.Struct({
131
+ ok: S.Boolean,
132
+ reminders: S.optional(ListRemindersResponseRemindersList),
133
+ }),
134
+ ).annotate({
135
+ identifier: "ListRemindersResponse",
136
+ }) as any as S.Schema<ListRemindersResponse>;
137
+
138
+ export interface RemindersInfoRequest {
139
+ /** The ID of the reminder */
140
+ reminder: string;
141
+ /** Encoded team id, required if org token is passed */
142
+ team_id?: string;
143
+ }
144
+ export const RemindersInfoRequest = /*@__PURE__*/ S.suspend(() =>
145
+ S.Struct({
146
+ reminder: S.String.pipe(T.Query()),
147
+ team_id: S.optional(S.String.pipe(T.Query())),
148
+ }).pipe(T.Http({ method: "GET", uri: "/reminders.info", code: 200 })),
149
+ ).annotate({
150
+ identifier: "RemindersInfoRequest",
151
+ }) as any as S.Schema<RemindersInfoRequest>;
152
+
153
+ export interface RemindersInfoResponse {
154
+ /** Always `true` (a failed call raises a typed error instead). */
155
+ ok: boolean;
156
+ reminder: unknown;
157
+ }
158
+ export const RemindersInfoResponse = /*@__PURE__*/ S.suspend(() =>
159
+ S.Struct({
160
+ ok: S.Boolean,
161
+ reminder: S.Unknown,
162
+ }),
163
+ ).annotate({
164
+ identifier: "RemindersInfoResponse",
165
+ }) as any as S.Schema<RemindersInfoResponse>;
166
+
167
+ export type AddReminderError = SlackOpError;
168
+ /** Creates a reminder. Required scopes — user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_add_bot` — Reminders can't be sent to bots. - `cannot_add_others` — Guests can't set reminders for other team members. - `cannot_add_others_recurring` — Recurring reminders can't be set for other team members. - `cannot_add_profile_only_user` — Reminders can't be sent to profile only users. - `cannot_add_slackbot` — Reminders can't be sent to Slackbot. - `cannot_parse` — The phrasing of the timing for this reminder is unclear. You must include a complete time description. Some examples that work: `1458678068`, `20`, `in 5 minutes`, `tomorrow`, `at 3:30pm`, `on Tuesday`, or `next week`. - `missing_argument` — An argument is missing. - `user_not_found` — That user can't be found. See https://docs.slack.dev/reference/methods/reminders.add */
169
+ export const addReminder: API.OperationMethod<
170
+ AddReminderRequest,
171
+ AddReminderResponse,
172
+ AddReminderError,
173
+ SlackOpContext
174
+ > = /*@__PURE__*/ API.make(() => ({
175
+ input: AddReminderRequest,
176
+ output: AddReminderResponse,
177
+ errors: [SlackError, SlackRateLimited],
178
+ protocol: SlackProtocol,
179
+ retry: Retry.Retry,
180
+ }));
181
+
182
+ export type CompleteReminderError = SlackOpError;
183
+ /** Marks a reminder as complete. Required scopes — user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_complete_others` — Reminders for other team members can't be marked complete. - `cannot_complete_recurring` — Recurring reminders can't be marked complete. - `missing_argument` — An argument is missing. - `not_found` — That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.complete */
184
+ export const completeReminder: API.OperationMethod<
185
+ CompleteReminderRequest,
186
+ CompleteReminderResponse,
187
+ CompleteReminderError,
188
+ SlackOpContext
189
+ > = /*@__PURE__*/ API.make(() => ({
190
+ input: CompleteReminderRequest,
191
+ output: CompleteReminderResponse,
192
+ errors: [SlackError, SlackRateLimited],
193
+ protocol: SlackProtocol,
194
+ retry: Retry.Retry,
195
+ }));
196
+
197
+ export type DeleteReminderError = SlackOpError;
198
+ /** Deletes a reminder. Required scopes — user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — An argument is missing. - `not_found` — That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.delete */
199
+ export const deleteReminder: API.OperationMethod<
200
+ DeleteReminderRequest,
201
+ DeleteReminderResponse,
202
+ DeleteReminderError,
203
+ SlackOpContext
204
+ > = /*@__PURE__*/ API.make(() => ({
205
+ input: DeleteReminderRequest,
206
+ output: DeleteReminderResponse,
207
+ errors: [SlackError, SlackRateLimited],
208
+ protocol: SlackProtocol,
209
+ retry: Retry.Retry,
210
+ }));
211
+
212
+ export type ListRemindersError = SlackOpError;
213
+ /** Lists all reminders created by or for a given user. Required scopes — user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — An argument is missing. See https://docs.slack.dev/reference/methods/reminders.list */
214
+ export const listReminders: API.OperationMethod<
215
+ ListRemindersRequest,
216
+ ListRemindersResponse,
217
+ ListRemindersError,
218
+ SlackOpContext
219
+ > = /*@__PURE__*/ API.make(() => ({
220
+ input: ListRemindersRequest,
221
+ output: ListRemindersResponse,
222
+ errors: [SlackError, SlackRateLimited],
223
+ protocol: SlackProtocol,
224
+ retry: Retry.Retry,
225
+ }));
226
+
227
+ export type RemindersInfoError = SlackOpError;
228
+ /** Gets information about a reminder. Required scopes — user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — An argument is missing. - `not_found` — That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.info */
229
+ export const remindersInfo: API.OperationMethod<
230
+ RemindersInfoRequest,
231
+ RemindersInfoResponse,
232
+ RemindersInfoError,
233
+ SlackOpContext
234
+ > = /*@__PURE__*/ API.make(() => ({
235
+ input: RemindersInfoRequest,
236
+ output: RemindersInfoResponse,
237
+ errors: [SlackError, SlackRateLimited],
238
+ protocol: SlackProtocol,
239
+ retry: Retry.Retry,
240
+ }));
@@ -0,0 +1,162 @@
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 interface ConnectRtmRequest {
16
+ /** Batch presence deliveries via subscription. Enabling changes the shape of `presence_change` events. See [batch presence](/apis/web-api/user-presence-and-status#batching). */
17
+ batch_presence_aware?: boolean;
18
+ /** Only deliver presence events when requested by subscription. See [presence subscriptions](/apis/web-api/user-presence-and-status#subscriptions). */
19
+ presence_sub?: boolean;
20
+ }
21
+ export const ConnectRtmRequest = /*@__PURE__*/ S.suspend(() =>
22
+ S.Struct({
23
+ batch_presence_aware: S.optional(S.Boolean.pipe(T.Query())),
24
+ presence_sub: S.optional(S.Boolean.pipe(T.Query())),
25
+ }).pipe(T.Http({ method: "GET", uri: "/rtm.connect", code: 200 })),
26
+ ).annotate({
27
+ identifier: "ConnectRtmRequest",
28
+ }) as any as S.Schema<ConnectRtmRequest>;
29
+
30
+ export interface ConnectRtmResponseSelf {
31
+ id: string;
32
+ name: string;
33
+ }
34
+ export const ConnectRtmResponseSelf = /*@__PURE__*/ S.suspend(() =>
35
+ S.Struct({
36
+ id: S.String,
37
+ name: S.String,
38
+ }),
39
+ ).annotate({
40
+ identifier: "ConnectRtmResponseSelf",
41
+ }) as any as S.Schema<ConnectRtmResponseSelf>;
42
+
43
+ export interface ConnectRtmResponseTeam {
44
+ domain: string;
45
+ id: string;
46
+ name: string;
47
+ enterprise_id?: string;
48
+ enterprise_name?: string;
49
+ }
50
+ export const ConnectRtmResponseTeam = /*@__PURE__*/ S.suspend(() =>
51
+ S.Struct({
52
+ domain: S.String,
53
+ id: S.String,
54
+ name: S.String,
55
+ enterprise_id: S.optional(S.String),
56
+ enterprise_name: S.optional(S.String),
57
+ }),
58
+ ).annotate({
59
+ identifier: "ConnectRtmResponseTeam",
60
+ }) as any as S.Schema<ConnectRtmResponseTeam>;
61
+
62
+ export interface ConnectRtmResponse {
63
+ /** Always `true` (a failed call raises a typed error instead). */
64
+ ok: boolean;
65
+ url: string;
66
+ self: ConnectRtmResponseSelf;
67
+ team: ConnectRtmResponseTeam;
68
+ }
69
+ export const ConnectRtmResponse = /*@__PURE__*/ S.suspend(() =>
70
+ S.Struct({
71
+ ok: S.Boolean,
72
+ url: S.String,
73
+ self: ConnectRtmResponseSelf,
74
+ team: ConnectRtmResponseTeam,
75
+ }),
76
+ ).annotate({
77
+ identifier: "ConnectRtmResponse",
78
+ }) as any as S.Schema<ConnectRtmResponse>;
79
+
80
+ export interface StartRtmRequest {
81
+ /** Return timestamp only for latest message object of each channel (improves performance). */
82
+ simple_latest?: boolean;
83
+ /** Skip unread counts for each channel (improves performance). */
84
+ no_unreads?: boolean;
85
+ /** Returns MPIMs to the client in the API response. */
86
+ mpim_aware?: boolean;
87
+ /** Only deliver presence events when requested by subscription. See [presence subscriptions](/apis/web-api/user-presence-and-status#subscriptions). */
88
+ presence_sub?: boolean;
89
+ /** Batch presence deliveries via subscription. Enabling changes the shape of `presence_change` events. See [batch presence](/apis/web-api/user-presence-and-status#batching). */
90
+ batch_presence_aware?: boolean;
91
+ /** Exclude latest timestamps for channels, groups, mpims, and ims. Automatically sets `no_unreads` to `1` */
92
+ no_latest?: boolean;
93
+ /** Set this to `true` to receive the locale for users and channels. Defaults to `false` */
94
+ include_locale?: boolean;
95
+ }
96
+ export const StartRtmRequest = /*@__PURE__*/ S.suspend(() =>
97
+ S.Struct({
98
+ simple_latest: S.optional(S.Boolean.pipe(T.Query())),
99
+ no_unreads: S.optional(S.Boolean.pipe(T.Query())),
100
+ mpim_aware: S.optional(S.Boolean.pipe(T.Query())),
101
+ presence_sub: S.optional(S.Boolean.pipe(T.Query())),
102
+ batch_presence_aware: S.optional(S.Boolean.pipe(T.Query())),
103
+ no_latest: S.optional(S.Boolean.pipe(T.Query())),
104
+ include_locale: S.optional(S.Boolean.pipe(T.Query())),
105
+ }).pipe(T.Http({ method: "GET", uri: "/rtm.start", code: 200 })),
106
+ ).annotate({
107
+ identifier: "StartRtmRequest",
108
+ }) as any as S.Schema<StartRtmRequest>;
109
+
110
+ export type StartRtmResponseSelf = ConnectRtmResponseSelf;
111
+ export const StartRtmResponseSelf = ConnectRtmResponseSelf;
112
+
113
+ export type StartRtmResponseTeam = ConnectRtmResponseTeam;
114
+ export const StartRtmResponseTeam = ConnectRtmResponseTeam;
115
+
116
+ export interface StartRtmResponse {
117
+ /** Always `true` (a failed call raises a typed error instead). */
118
+ ok: boolean;
119
+ url: string;
120
+ self: ConnectRtmResponseSelf;
121
+ team: ConnectRtmResponseTeam;
122
+ }
123
+ export const StartRtmResponse = /*@__PURE__*/ S.suspend(() =>
124
+ S.Struct({
125
+ ok: S.Boolean,
126
+ url: S.String,
127
+ self: ConnectRtmResponseSelf,
128
+ team: ConnectRtmResponseTeam,
129
+ }),
130
+ ).annotate({
131
+ identifier: "StartRtmResponse",
132
+ }) as any as S.Schema<StartRtmResponse>;
133
+
134
+ export type ConnectRtmError = SlackOpError;
135
+ /** Starts a Real Time Messaging session. Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `migration_in_progress` — Team is being migrated between servers. See [the `team_migration_started` event documentation](/reference/events/team_migration_started) for details. See https://docs.slack.dev/reference/methods/rtm.connect */
136
+ export const connectRtm: API.OperationMethod<
137
+ ConnectRtmRequest,
138
+ ConnectRtmResponse,
139
+ ConnectRtmError,
140
+ SlackOpContext
141
+ > = /*@__PURE__*/ API.make(() => ({
142
+ input: ConnectRtmRequest,
143
+ output: ConnectRtmResponse,
144
+ errors: [SlackError, SlackRateLimited],
145
+ protocol: SlackProtocol,
146
+ retry: Retry.Retry,
147
+ }));
148
+
149
+ export type StartRtmError = SlackOpError;
150
+ /** Deprecated: Starts a Real Time Messaging session. Use rtm.connect instead. Rate limit tier: 1 Method-specific errors (the `error` slug on the SlackError): - `method_deprecated` — `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. - `migration_in_progress` — Workspace is being migrated between servers. See [the `team_migration_started` event documentation](/reference/events/team_migration_started) for details. - `rtm_connect_required` — `rtm.start` is deprecated. Please use `rtm.connect` instead of `rtm.start`. Read https://docs.slack.dev/changelog/2021-10-rtm-start-to-stop for more info. See https://docs.slack.dev/reference/methods/rtm.start */
151
+ export const startRtm: API.OperationMethod<
152
+ StartRtmRequest,
153
+ StartRtmResponse,
154
+ StartRtmError,
155
+ SlackOpContext
156
+ > = /*@__PURE__*/ API.make(() => ({
157
+ input: StartRtmRequest,
158
+ output: StartRtmResponse,
159
+ errors: [SlackError, SlackRateLimited],
160
+ protocol: SlackProtocol,
161
+ retry: Retry.Retry,
162
+ }));