@im-more/dsh-slack 0.0.0-stage → 0.1.0

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 (226) hide show
  1. package/LICENSE +21 -0
  2. package/cordis.patch.yml +13 -0
  3. package/lib/index.js +2659 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/types/bot.d.ts +66 -0
  6. package/lib/types/bot.d.ts.map +1 -0
  7. package/lib/types/bot.js +165 -0
  8. package/lib/types/bot.js.map +1 -0
  9. package/lib/types/config.d.ts +49 -0
  10. package/lib/types/config.d.ts.map +1 -0
  11. package/lib/types/config.js +54 -0
  12. package/lib/types/config.js.map +1 -0
  13. package/lib/types/decode.d.ts +126 -0
  14. package/lib/types/decode.d.ts.map +1 -0
  15. package/lib/types/decode.js +396 -0
  16. package/lib/types/decode.js.map +1 -0
  17. package/lib/types/errors.d.ts +61 -0
  18. package/lib/types/errors.d.ts.map +1 -0
  19. package/lib/types/errors.js +196 -0
  20. package/lib/types/errors.js.map +1 -0
  21. package/lib/types/identity.d.ts +27 -0
  22. package/lib/types/identity.d.ts.map +1 -0
  23. package/lib/types/identity.js +35 -0
  24. package/lib/types/identity.js.map +1 -0
  25. package/lib/types/index.d.ts +14 -0
  26. package/lib/types/index.d.ts.map +1 -0
  27. package/lib/types/index.js +14 -0
  28. package/lib/types/index.js.map +1 -0
  29. package/lib/types/modes/mrkdwn.d.ts +17 -0
  30. package/lib/types/modes/mrkdwn.d.ts.map +1 -0
  31. package/lib/types/modes/mrkdwn.js +123 -0
  32. package/lib/types/modes/mrkdwn.js.map +1 -0
  33. package/lib/types/modes/shared.d.ts +164 -0
  34. package/lib/types/modes/shared.d.ts.map +1 -0
  35. package/lib/types/modes/shared.js +411 -0
  36. package/lib/types/modes/shared.js.map +1 -0
  37. package/lib/types/mrkdwn.d.ts +41 -0
  38. package/lib/types/mrkdwn.d.ts.map +1 -0
  39. package/lib/types/mrkdwn.js +137 -0
  40. package/lib/types/mrkdwn.js.map +1 -0
  41. package/lib/types/request.d.ts +225 -0
  42. package/lib/types/request.d.ts.map +1 -0
  43. package/lib/types/request.js +330 -0
  44. package/lib/types/request.js.map +1 -0
  45. package/lib/types/send.d.ts +74 -0
  46. package/lib/types/send.d.ts.map +1 -0
  47. package/lib/types/send.js +200 -0
  48. package/lib/types/send.js.map +1 -0
  49. package/lib/types/transport/socket.d.ts +58 -0
  50. package/lib/types/transport/socket.d.ts.map +1 -0
  51. package/lib/types/transport/socket.js +297 -0
  52. package/lib/types/transport/socket.js.map +1 -0
  53. package/lib/types/transport/webhook.d.ts +48 -0
  54. package/lib/types/transport/webhook.d.ts.map +1 -0
  55. package/lib/types/transport/webhook.js +210 -0
  56. package/lib/types/transport/webhook.js.map +1 -0
  57. package/lib/types/types/admin.d.ts +682 -0
  58. package/lib/types/types/admin.d.ts.map +1 -0
  59. package/lib/types/types/admin.js +172 -0
  60. package/lib/types/types/admin.js.map +1 -0
  61. package/lib/types/types/api.d.ts +20 -0
  62. package/lib/types/types/api.d.ts.map +1 -0
  63. package/lib/types/types/api.js +7 -0
  64. package/lib/types/types/api.js.map +1 -0
  65. package/lib/types/types/apps.d.ts +138 -0
  66. package/lib/types/types/apps.d.ts.map +1 -0
  67. package/lib/types/types/apps.js +28 -0
  68. package/lib/types/types/apps.js.map +1 -0
  69. package/lib/types/types/auth.d.ts +36 -0
  70. package/lib/types/types/auth.d.ts.map +1 -0
  71. package/lib/types/types/auth.js +10 -0
  72. package/lib/types/types/auth.js.map +1 -0
  73. package/lib/types/types/bots.d.ts +32 -0
  74. package/lib/types/types/bots.d.ts.map +1 -0
  75. package/lib/types/types/bots.js +7 -0
  76. package/lib/types/types/bots.js.map +1 -0
  77. package/lib/types/types/calls.d.ts +82 -0
  78. package/lib/types/types/calls.d.ts.map +1 -0
  79. package/lib/types/types/calls.js +22 -0
  80. package/lib/types/types/calls.js.map +1 -0
  81. package/lib/types/types/chat.d.ts +208 -0
  82. package/lib/types/types/chat.d.ts.map +1 -0
  83. package/lib/types/types/chat.js +34 -0
  84. package/lib/types/types/chat.js.map +1 -0
  85. package/lib/types/types/conversations.d.ts +266 -0
  86. package/lib/types/types/conversations.d.ts.map +1 -0
  87. package/lib/types/types/conversations.js +58 -0
  88. package/lib/types/types/conversations.js.map +1 -0
  89. package/lib/types/types/definition.d.ts +505 -0
  90. package/lib/types/types/definition.d.ts.map +1 -0
  91. package/lib/types/types/definition.js +2 -0
  92. package/lib/types/types/definition.js.map +1 -0
  93. package/lib/types/types/dialog.d.ts +20 -0
  94. package/lib/types/types/dialog.d.ts.map +1 -0
  95. package/lib/types/types/dialog.js +7 -0
  96. package/lib/types/types/dialog.js.map +1 -0
  97. package/lib/types/types/dnd.d.ts +70 -0
  98. package/lib/types/types/dnd.d.ts.map +1 -0
  99. package/lib/types/types/dnd.js +19 -0
  100. package/lib/types/types/dnd.js.map +1 -0
  101. package/lib/types/types/emoji.d.ts +18 -0
  102. package/lib/types/types/emoji.d.ts.map +1 -0
  103. package/lib/types/types/emoji.js +7 -0
  104. package/lib/types/types/emoji.js.map +1 -0
  105. package/lib/types/types/events/base-events.d.ts +235 -0
  106. package/lib/types/types/events/base-events.d.ts.map +1 -0
  107. package/lib/types/types/events/base-events.js +3 -0
  108. package/lib/types/types/events/base-events.js.map +1 -0
  109. package/lib/types/types/events/index.d.ts +97 -0
  110. package/lib/types/types/events/index.d.ts.map +1 -0
  111. package/lib/types/types/events/index.js +3 -0
  112. package/lib/types/types/events/index.js.map +1 -0
  113. package/lib/types/types/events/message-events.d.ts +215 -0
  114. package/lib/types/types/events/message-events.d.ts.map +1 -0
  115. package/lib/types/types/events/message-events.js +3 -0
  116. package/lib/types/types/events/message-events.js.map +1 -0
  117. package/lib/types/types/files.d.ts +189 -0
  118. package/lib/types/types/files.d.ts.map +1 -0
  119. package/lib/types/types/files.js +43 -0
  120. package/lib/types/types/files.js.map +1 -0
  121. package/lib/types/types/index.d.ts +82 -0
  122. package/lib/types/types/index.d.ts.map +1 -0
  123. package/lib/types/types/index.js +29 -0
  124. package/lib/types/types/index.js.map +1 -0
  125. package/lib/types/types/internal.d.ts +17 -0
  126. package/lib/types/types/internal.d.ts.map +1 -0
  127. package/lib/types/types/internal.js +60 -0
  128. package/lib/types/types/internal.js.map +1 -0
  129. package/lib/types/types/migration.d.ts +25 -0
  130. package/lib/types/types/migration.d.ts.map +1 -0
  131. package/lib/types/types/migration.js +7 -0
  132. package/lib/types/types/migration.js.map +1 -0
  133. package/lib/types/types/oauth.d.ts +50 -0
  134. package/lib/types/types/oauth.d.ts.map +1 -0
  135. package/lib/types/types/oauth.js +13 -0
  136. package/lib/types/types/oauth.js.map +1 -0
  137. package/lib/types/types/pins.d.ts +39 -0
  138. package/lib/types/types/pins.d.ts.map +1 -0
  139. package/lib/types/types/pins.js +13 -0
  140. package/lib/types/types/pins.js.map +1 -0
  141. package/lib/types/types/reactions.d.ts +75 -0
  142. package/lib/types/types/reactions.d.ts.map +1 -0
  143. package/lib/types/types/reactions.js +16 -0
  144. package/lib/types/types/reactions.js.map +1 -0
  145. package/lib/types/types/reminders.d.ts +64 -0
  146. package/lib/types/types/reminders.d.ts.map +1 -0
  147. package/lib/types/types/reminders.js +19 -0
  148. package/lib/types/types/reminders.js.map +1 -0
  149. package/lib/types/types/rtm.d.ts +30 -0
  150. package/lib/types/types/rtm.d.ts.map +1 -0
  151. package/lib/types/types/rtm.js +7 -0
  152. package/lib/types/types/rtm.js.map +1 -0
  153. package/lib/types/types/search.d.ts +24 -0
  154. package/lib/types/types/search.d.ts.map +1 -0
  155. package/lib/types/types/search.js +7 -0
  156. package/lib/types/types/search.js.map +1 -0
  157. package/lib/types/types/stars.d.ts +56 -0
  158. package/lib/types/types/stars.d.ts.map +1 -0
  159. package/lib/types/types/stars.js +13 -0
  160. package/lib/types/types/stars.js.map +1 -0
  161. package/lib/types/types/team.d.ts +98 -0
  162. package/lib/types/types/team.d.ts.map +1 -0
  163. package/lib/types/types/team.js +19 -0
  164. package/lib/types/types/team.js.map +1 -0
  165. package/lib/types/types/usergroups.d.ts +103 -0
  166. package/lib/types/types/usergroups.d.ts.map +1 -0
  167. package/lib/types/types/usergroups.js +25 -0
  168. package/lib/types/types/usergroups.js.map +1 -0
  169. package/lib/types/types/users.d.ts +169 -0
  170. package/lib/types/types/users.d.ts.map +1 -0
  171. package/lib/types/types/users.js +40 -0
  172. package/lib/types/types/users.js.map +1 -0
  173. package/lib/types/types/views.d.ts +56 -0
  174. package/lib/types/types/views.d.ts.map +1 -0
  175. package/lib/types/types/views.js +16 -0
  176. package/lib/types/types/views.js.map +1 -0
  177. package/lib/types/types/workflows.d.ts +45 -0
  178. package/lib/types/types/workflows.d.ts.map +1 -0
  179. package/lib/types/types/workflows.js +13 -0
  180. package/lib/types/types/workflows.js.map +1 -0
  181. package/package.json +65 -3
  182. package/src/bot.ts +273 -0
  183. package/src/config.ts +92 -0
  184. package/src/decode.ts +489 -0
  185. package/src/errors.ts +230 -0
  186. package/src/identity.ts +59 -0
  187. package/src/index.ts +64 -0
  188. package/src/modes/mrkdwn.ts +159 -0
  189. package/src/modes/shared.ts +515 -0
  190. package/src/mrkdwn.ts +146 -0
  191. package/src/request.ts +449 -0
  192. package/src/send.ts +300 -0
  193. package/src/transport/socket.ts +393 -0
  194. package/src/transport/webhook.ts +269 -0
  195. package/src/types/admin.ts +910 -0
  196. package/src/types/api.ts +28 -0
  197. package/src/types/apps.ts +175 -0
  198. package/src/types/auth.ts +49 -0
  199. package/src/types/bots.ts +40 -0
  200. package/src/types/calls.ts +110 -0
  201. package/src/types/chat.ts +255 -0
  202. package/src/types/conversations.ts +342 -0
  203. package/src/types/definition.ts +530 -0
  204. package/src/types/dialog.ts +28 -0
  205. package/src/types/dnd.ts +94 -0
  206. package/src/types/emoji.ts +26 -0
  207. package/src/types/events/base-events.ts +281 -0
  208. package/src/types/events/index.ts +125 -0
  209. package/src/types/events/message-events.ts +253 -0
  210. package/src/types/files.ts +245 -0
  211. package/src/types/index.ts +84 -0
  212. package/src/types/internal.ts +60 -0
  213. package/src/types/migration.ts +34 -0
  214. package/src/types/oauth.ts +66 -0
  215. package/src/types/pins.ts +55 -0
  216. package/src/types/reactions.ts +95 -0
  217. package/src/types/reminders.ts +88 -0
  218. package/src/types/rtm.ts +38 -0
  219. package/src/types/search.ts +32 -0
  220. package/src/types/stars.ts +72 -0
  221. package/src/types/team.ts +122 -0
  222. package/src/types/usergroups.ts +135 -0
  223. package/src/types/users.ts +221 -0
  224. package/src/types/views.ts +76 -0
  225. package/src/types/workflows.ts +61 -0
  226. package/README.md +0 -3
@@ -0,0 +1,342 @@
1
+ import { Internal } from './internal.ts'
2
+ import { Definitions } from './definition.ts'
3
+ Internal.define({
4
+ '/conversations.archive': {
5
+ POST: { 'conversationsArchive': true },
6
+ },
7
+ '/conversations.close': {
8
+ POST: { 'conversationsClose': true },
9
+ },
10
+ '/conversations.create': {
11
+ POST: { 'conversationsCreate': true },
12
+ },
13
+ '/conversations.history': {
14
+ GET: { 'conversationsHistory': true },
15
+ },
16
+ '/conversations.info': {
17
+ GET: { 'conversationsInfo': false },
18
+ },
19
+ '/conversations.invite': {
20
+ POST: { 'conversationsInvite': true },
21
+ },
22
+ '/conversations.join': {
23
+ POST: { 'conversationsJoin': true },
24
+ },
25
+ '/conversations.kick': {
26
+ POST: { 'conversationsKick': true },
27
+ },
28
+ '/conversations.leave': {
29
+ POST: { 'conversationsLeave': true },
30
+ },
31
+ '/conversations.list': {
32
+ GET: { 'conversationsList': false },
33
+ },
34
+ '/conversations.mark': {
35
+ POST: { 'conversationsMark': true },
36
+ },
37
+ '/conversations.members': {
38
+ GET: { 'conversationsMembers': false },
39
+ },
40
+ '/conversations.open': {
41
+ POST: { 'conversationsOpen': true },
42
+ },
43
+ '/conversations.rename': {
44
+ POST: { 'conversationsRename': true },
45
+ },
46
+ '/conversations.replies': {
47
+ GET: { 'conversationsReplies': false },
48
+ },
49
+ '/conversations.setPurpose': {
50
+ POST: { 'conversationsSetPurpose': true },
51
+ },
52
+ '/conversations.setTopic': {
53
+ POST: { 'conversationsSetTopic': true },
54
+ },
55
+ '/conversations.unarchive': {
56
+ POST: { 'conversationsUnarchive': true },
57
+ },
58
+ })
59
+
60
+ export namespace Conversations {
61
+ export namespace Params {
62
+ export interface Archive {
63
+ channel?: string
64
+ }
65
+ export interface Close {
66
+ channel?: string
67
+ }
68
+ export interface Create {
69
+ name?: string
70
+ is_private?: boolean
71
+ }
72
+ export interface History {
73
+ channel?: string
74
+ latest?: number
75
+ oldest?: number
76
+ inclusive?: boolean
77
+ limit?: number
78
+ cursor?: string
79
+ }
80
+ export interface Info {
81
+ channel?: string
82
+ include_locale?: boolean
83
+ include_num_members?: boolean
84
+ }
85
+ export interface Invite {
86
+ channel?: string
87
+ users?: string
88
+ }
89
+ export interface Join {
90
+ channel?: string
91
+ }
92
+ export interface Kick {
93
+ channel?: string
94
+ user?: string
95
+ }
96
+ export interface Leave {
97
+ channel?: string
98
+ }
99
+ export interface List {
100
+ exclude_archived?: boolean
101
+ types?: string
102
+ limit?: number
103
+ cursor?: string
104
+ }
105
+ export interface Mark {
106
+ channel?: string
107
+ ts?: number
108
+ }
109
+ export interface Members {
110
+ channel?: string
111
+ limit?: number
112
+ cursor?: string
113
+ }
114
+ export interface Open {
115
+ channel?: string
116
+ users?: string
117
+ return_im?: boolean
118
+ }
119
+ export interface Rename {
120
+ channel?: string
121
+ name?: string
122
+ }
123
+ export interface Replies {
124
+ channel?: string
125
+ ts?: number
126
+ latest?: number
127
+ oldest?: number
128
+ inclusive?: boolean
129
+ limit?: number
130
+ cursor?: string
131
+ }
132
+ export interface SetPurpose {
133
+ channel?: string
134
+ purpose?: string
135
+ }
136
+ export interface SetTopic {
137
+ channel?: string
138
+ topic?: string
139
+ }
140
+ export interface Unarchive {
141
+ channel?: string
142
+ }
143
+ }
144
+ }
145
+
146
+ declare module './internal' {
147
+ interface Internal {
148
+
149
+ /**
150
+ * Archives a conversation.
151
+ * @see https://api.slack.com/methods/conversations.archive
152
+ */
153
+ conversationsArchive(token: TokenInput, params: Conversations.Params.Archive): Promise<{
154
+ ok: boolean
155
+ }>
156
+
157
+ /**
158
+ * Closes a direct message or multi-person direct message.
159
+ * @see https://api.slack.com/methods/conversations.close
160
+ */
161
+ conversationsClose(token: TokenInput, params: Conversations.Params.Close): Promise<{
162
+ already_closed?: boolean
163
+ no_op?: boolean
164
+ ok: boolean
165
+ }>
166
+
167
+ /**
168
+ * Initiates a public or private channel-based conversation
169
+ * @see https://api.slack.com/methods/conversations.create
170
+ */
171
+ conversationsCreate(token: TokenInput, params: Conversations.Params.Create): Promise<{
172
+ channel: Definitions.Conversation
173
+ ok: boolean
174
+ }>
175
+
176
+ /**
177
+ * Fetches a conversation's history of messages and events.
178
+ * @see https://api.slack.com/methods/conversations.history
179
+ */
180
+ conversationsHistory(token: TokenInput, params: Conversations.Params.History): Promise<{
181
+ channel_actions_count: number
182
+ channel_actions_ts: number
183
+ has_more: boolean
184
+ messages: Definitions.Message[]
185
+ ok: boolean
186
+ pin_count: number
187
+ }>
188
+
189
+ /**
190
+ * Retrieve information about a conversation.
191
+ * @see https://api.slack.com/methods/conversations.info
192
+ */
193
+ conversationsInfo(token: TokenInput, params: Conversations.Params.Info): Promise<{
194
+ channel: Definitions.Conversation
195
+ ok: boolean
196
+ }>
197
+
198
+ /**
199
+ * Invites users to a channel.
200
+ * @see https://api.slack.com/methods/conversations.invite
201
+ */
202
+ conversationsInvite(token: TokenInput, params: Conversations.Params.Invite): Promise<{
203
+ channel: Definitions.Conversation
204
+ ok: boolean
205
+ }>
206
+
207
+ /**
208
+ * Joins an existing conversation.
209
+ * @see https://api.slack.com/methods/conversations.join
210
+ */
211
+ conversationsJoin(token: TokenInput, params: Conversations.Params.Join): Promise<{
212
+ channel: Definitions.Conversation
213
+ ok: boolean
214
+ response_metadata?: {
215
+ warnings: string[]
216
+ }
217
+ warning?: string
218
+ }>
219
+
220
+ /**
221
+ * Removes a user from a conversation.
222
+ * @see https://api.slack.com/methods/conversations.kick
223
+ */
224
+ conversationsKick(token: TokenInput, params: Conversations.Params.Kick): Promise<{
225
+ ok: boolean
226
+ }>
227
+
228
+ /**
229
+ * Leaves a conversation.
230
+ * @see https://api.slack.com/methods/conversations.leave
231
+ */
232
+ conversationsLeave(token: TokenInput, params: Conversations.Params.Leave): Promise<{
233
+ not_in_channel?: boolean
234
+ ok: boolean
235
+ }>
236
+
237
+ /**
238
+ * Lists all channels in a Slack team.
239
+ * @see https://api.slack.com/methods/conversations.list
240
+ */
241
+ conversationsList(token: TokenInput, params: Conversations.Params.List): Promise<{
242
+ channels: Definitions.Conversation[]
243
+ ok: boolean
244
+ response_metadata?: {
245
+ next_cursor: string
246
+ }
247
+ }>
248
+
249
+ /**
250
+ * Sets the read cursor in a channel.
251
+ * @see https://api.slack.com/methods/conversations.mark
252
+ */
253
+ conversationsMark(token: TokenInput, params: Conversations.Params.Mark): Promise<{
254
+ ok: boolean
255
+ }>
256
+
257
+ /**
258
+ * Retrieve members of a conversation.
259
+ * @see https://api.slack.com/methods/conversations.members
260
+ */
261
+ conversationsMembers(token: TokenInput, params: Conversations.Params.Members): Promise<{
262
+ members: string[]
263
+ ok: boolean
264
+ response_metadata: {
265
+ next_cursor: string
266
+ }
267
+ }>
268
+
269
+ /**
270
+ * Opens or resumes a direct message or multi-person direct message.
271
+ * @see https://api.slack.com/methods/conversations.open
272
+ */
273
+ conversationsOpen(token: TokenInput, params: Conversations.Params.Open): Promise<{
274
+ already_open?: boolean
275
+ channel: Definitions.Conversation
276
+ no_op?: boolean
277
+ ok: boolean
278
+ }>
279
+
280
+ /**
281
+ * Renames a conversation.
282
+ * @see https://api.slack.com/methods/conversations.rename
283
+ */
284
+ conversationsRename(token: TokenInput, params: Conversations.Params.Rename): Promise<{
285
+ channel: Definitions.Conversation
286
+ ok: boolean
287
+ }>
288
+
289
+ /**
290
+ * Retrieve a thread of messages posted to a conversation
291
+ * @see https://api.slack.com/methods/conversations.replies
292
+ */
293
+ conversationsReplies(token: TokenInput, params: Conversations.Params.Replies): Promise<{
294
+ has_more?: boolean
295
+ messages: {
296
+ last_read: string
297
+ latest_reply: string
298
+ reply_count: number
299
+ reply_users: string[]
300
+ reply_users_count: number
301
+ source_team: string
302
+ subscribed: boolean
303
+ team: string
304
+ text: string
305
+ thread_ts: string
306
+ ts: string
307
+ type: string
308
+ unread_count: number
309
+ user: string
310
+ user_profile: Definitions.UserProfileShort
311
+ user_team: string
312
+ }[]
313
+ ok: boolean
314
+ }>
315
+
316
+ /**
317
+ * Sets the purpose for a conversation.
318
+ * @see https://api.slack.com/methods/conversations.setPurpose
319
+ */
320
+ conversationsSetPurpose(token: TokenInput, params: Conversations.Params.SetPurpose): Promise<{
321
+ channel: Definitions.Conversation
322
+ ok: boolean
323
+ }>
324
+
325
+ /**
326
+ * Sets the topic for a conversation.
327
+ * @see https://api.slack.com/methods/conversations.setTopic
328
+ */
329
+ conversationsSetTopic(token: TokenInput, params: Conversations.Params.SetTopic): Promise<{
330
+ channel: Definitions.Conversation
331
+ ok: boolean
332
+ }>
333
+
334
+ /**
335
+ * Reverses conversation archival.
336
+ * @see https://api.slack.com/methods/conversations.unarchive
337
+ */
338
+ conversationsUnarchive(token: TokenInput, params: Conversations.Params.Unarchive): Promise<{
339
+ ok: boolean
340
+ }>
341
+ }
342
+ }