@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.
- package/LICENSE +21 -0
- package/cordis.patch.yml +13 -0
- package/lib/index.js +2659 -0
- package/lib/index.js.map +1 -0
- package/lib/types/bot.d.ts +66 -0
- package/lib/types/bot.d.ts.map +1 -0
- package/lib/types/bot.js +165 -0
- package/lib/types/bot.js.map +1 -0
- package/lib/types/config.d.ts +49 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +54 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/decode.d.ts +126 -0
- package/lib/types/decode.d.ts.map +1 -0
- package/lib/types/decode.js +396 -0
- package/lib/types/decode.js.map +1 -0
- package/lib/types/errors.d.ts +61 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/errors.js +196 -0
- package/lib/types/errors.js.map +1 -0
- package/lib/types/identity.d.ts +27 -0
- package/lib/types/identity.d.ts.map +1 -0
- package/lib/types/identity.js +35 -0
- package/lib/types/identity.js.map +1 -0
- package/lib/types/index.d.ts +14 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +14 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/modes/mrkdwn.d.ts +17 -0
- package/lib/types/modes/mrkdwn.d.ts.map +1 -0
- package/lib/types/modes/mrkdwn.js +123 -0
- package/lib/types/modes/mrkdwn.js.map +1 -0
- package/lib/types/modes/shared.d.ts +164 -0
- package/lib/types/modes/shared.d.ts.map +1 -0
- package/lib/types/modes/shared.js +411 -0
- package/lib/types/modes/shared.js.map +1 -0
- package/lib/types/mrkdwn.d.ts +41 -0
- package/lib/types/mrkdwn.d.ts.map +1 -0
- package/lib/types/mrkdwn.js +137 -0
- package/lib/types/mrkdwn.js.map +1 -0
- package/lib/types/request.d.ts +225 -0
- package/lib/types/request.d.ts.map +1 -0
- package/lib/types/request.js +330 -0
- package/lib/types/request.js.map +1 -0
- package/lib/types/send.d.ts +74 -0
- package/lib/types/send.d.ts.map +1 -0
- package/lib/types/send.js +200 -0
- package/lib/types/send.js.map +1 -0
- package/lib/types/transport/socket.d.ts +58 -0
- package/lib/types/transport/socket.d.ts.map +1 -0
- package/lib/types/transport/socket.js +297 -0
- package/lib/types/transport/socket.js.map +1 -0
- package/lib/types/transport/webhook.d.ts +48 -0
- package/lib/types/transport/webhook.d.ts.map +1 -0
- package/lib/types/transport/webhook.js +210 -0
- package/lib/types/transport/webhook.js.map +1 -0
- package/lib/types/types/admin.d.ts +682 -0
- package/lib/types/types/admin.d.ts.map +1 -0
- package/lib/types/types/admin.js +172 -0
- package/lib/types/types/admin.js.map +1 -0
- package/lib/types/types/api.d.ts +20 -0
- package/lib/types/types/api.d.ts.map +1 -0
- package/lib/types/types/api.js +7 -0
- package/lib/types/types/api.js.map +1 -0
- package/lib/types/types/apps.d.ts +138 -0
- package/lib/types/types/apps.d.ts.map +1 -0
- package/lib/types/types/apps.js +28 -0
- package/lib/types/types/apps.js.map +1 -0
- package/lib/types/types/auth.d.ts +36 -0
- package/lib/types/types/auth.d.ts.map +1 -0
- package/lib/types/types/auth.js +10 -0
- package/lib/types/types/auth.js.map +1 -0
- package/lib/types/types/bots.d.ts +32 -0
- package/lib/types/types/bots.d.ts.map +1 -0
- package/lib/types/types/bots.js +7 -0
- package/lib/types/types/bots.js.map +1 -0
- package/lib/types/types/calls.d.ts +82 -0
- package/lib/types/types/calls.d.ts.map +1 -0
- package/lib/types/types/calls.js +22 -0
- package/lib/types/types/calls.js.map +1 -0
- package/lib/types/types/chat.d.ts +208 -0
- package/lib/types/types/chat.d.ts.map +1 -0
- package/lib/types/types/chat.js +34 -0
- package/lib/types/types/chat.js.map +1 -0
- package/lib/types/types/conversations.d.ts +266 -0
- package/lib/types/types/conversations.d.ts.map +1 -0
- package/lib/types/types/conversations.js +58 -0
- package/lib/types/types/conversations.js.map +1 -0
- package/lib/types/types/definition.d.ts +505 -0
- package/lib/types/types/definition.d.ts.map +1 -0
- package/lib/types/types/definition.js +2 -0
- package/lib/types/types/definition.js.map +1 -0
- package/lib/types/types/dialog.d.ts +20 -0
- package/lib/types/types/dialog.d.ts.map +1 -0
- package/lib/types/types/dialog.js +7 -0
- package/lib/types/types/dialog.js.map +1 -0
- package/lib/types/types/dnd.d.ts +70 -0
- package/lib/types/types/dnd.d.ts.map +1 -0
- package/lib/types/types/dnd.js +19 -0
- package/lib/types/types/dnd.js.map +1 -0
- package/lib/types/types/emoji.d.ts +18 -0
- package/lib/types/types/emoji.d.ts.map +1 -0
- package/lib/types/types/emoji.js +7 -0
- package/lib/types/types/emoji.js.map +1 -0
- package/lib/types/types/events/base-events.d.ts +235 -0
- package/lib/types/types/events/base-events.d.ts.map +1 -0
- package/lib/types/types/events/base-events.js +3 -0
- package/lib/types/types/events/base-events.js.map +1 -0
- package/lib/types/types/events/index.d.ts +97 -0
- package/lib/types/types/events/index.d.ts.map +1 -0
- package/lib/types/types/events/index.js +3 -0
- package/lib/types/types/events/index.js.map +1 -0
- package/lib/types/types/events/message-events.d.ts +215 -0
- package/lib/types/types/events/message-events.d.ts.map +1 -0
- package/lib/types/types/events/message-events.js +3 -0
- package/lib/types/types/events/message-events.js.map +1 -0
- package/lib/types/types/files.d.ts +189 -0
- package/lib/types/types/files.d.ts.map +1 -0
- package/lib/types/types/files.js +43 -0
- package/lib/types/types/files.js.map +1 -0
- package/lib/types/types/index.d.ts +82 -0
- package/lib/types/types/index.d.ts.map +1 -0
- package/lib/types/types/index.js +29 -0
- package/lib/types/types/index.js.map +1 -0
- package/lib/types/types/internal.d.ts +17 -0
- package/lib/types/types/internal.d.ts.map +1 -0
- package/lib/types/types/internal.js +60 -0
- package/lib/types/types/internal.js.map +1 -0
- package/lib/types/types/migration.d.ts +25 -0
- package/lib/types/types/migration.d.ts.map +1 -0
- package/lib/types/types/migration.js +7 -0
- package/lib/types/types/migration.js.map +1 -0
- package/lib/types/types/oauth.d.ts +50 -0
- package/lib/types/types/oauth.d.ts.map +1 -0
- package/lib/types/types/oauth.js +13 -0
- package/lib/types/types/oauth.js.map +1 -0
- package/lib/types/types/pins.d.ts +39 -0
- package/lib/types/types/pins.d.ts.map +1 -0
- package/lib/types/types/pins.js +13 -0
- package/lib/types/types/pins.js.map +1 -0
- package/lib/types/types/reactions.d.ts +75 -0
- package/lib/types/types/reactions.d.ts.map +1 -0
- package/lib/types/types/reactions.js +16 -0
- package/lib/types/types/reactions.js.map +1 -0
- package/lib/types/types/reminders.d.ts +64 -0
- package/lib/types/types/reminders.d.ts.map +1 -0
- package/lib/types/types/reminders.js +19 -0
- package/lib/types/types/reminders.js.map +1 -0
- package/lib/types/types/rtm.d.ts +30 -0
- package/lib/types/types/rtm.d.ts.map +1 -0
- package/lib/types/types/rtm.js +7 -0
- package/lib/types/types/rtm.js.map +1 -0
- package/lib/types/types/search.d.ts +24 -0
- package/lib/types/types/search.d.ts.map +1 -0
- package/lib/types/types/search.js +7 -0
- package/lib/types/types/search.js.map +1 -0
- package/lib/types/types/stars.d.ts +56 -0
- package/lib/types/types/stars.d.ts.map +1 -0
- package/lib/types/types/stars.js +13 -0
- package/lib/types/types/stars.js.map +1 -0
- package/lib/types/types/team.d.ts +98 -0
- package/lib/types/types/team.d.ts.map +1 -0
- package/lib/types/types/team.js +19 -0
- package/lib/types/types/team.js.map +1 -0
- package/lib/types/types/usergroups.d.ts +103 -0
- package/lib/types/types/usergroups.d.ts.map +1 -0
- package/lib/types/types/usergroups.js +25 -0
- package/lib/types/types/usergroups.js.map +1 -0
- package/lib/types/types/users.d.ts +169 -0
- package/lib/types/types/users.d.ts.map +1 -0
- package/lib/types/types/users.js +40 -0
- package/lib/types/types/users.js.map +1 -0
- package/lib/types/types/views.d.ts +56 -0
- package/lib/types/types/views.d.ts.map +1 -0
- package/lib/types/types/views.js +16 -0
- package/lib/types/types/views.js.map +1 -0
- package/lib/types/types/workflows.d.ts +45 -0
- package/lib/types/types/workflows.d.ts.map +1 -0
- package/lib/types/types/workflows.js +13 -0
- package/lib/types/types/workflows.js.map +1 -0
- package/package.json +65 -3
- package/src/bot.ts +273 -0
- package/src/config.ts +92 -0
- package/src/decode.ts +489 -0
- package/src/errors.ts +230 -0
- package/src/identity.ts +59 -0
- package/src/index.ts +64 -0
- package/src/modes/mrkdwn.ts +159 -0
- package/src/modes/shared.ts +515 -0
- package/src/mrkdwn.ts +146 -0
- package/src/request.ts +449 -0
- package/src/send.ts +300 -0
- package/src/transport/socket.ts +393 -0
- package/src/transport/webhook.ts +269 -0
- package/src/types/admin.ts +910 -0
- package/src/types/api.ts +28 -0
- package/src/types/apps.ts +175 -0
- package/src/types/auth.ts +49 -0
- package/src/types/bots.ts +40 -0
- package/src/types/calls.ts +110 -0
- package/src/types/chat.ts +255 -0
- package/src/types/conversations.ts +342 -0
- package/src/types/definition.ts +530 -0
- package/src/types/dialog.ts +28 -0
- package/src/types/dnd.ts +94 -0
- package/src/types/emoji.ts +26 -0
- package/src/types/events/base-events.ts +281 -0
- package/src/types/events/index.ts +125 -0
- package/src/types/events/message-events.ts +253 -0
- package/src/types/files.ts +245 -0
- package/src/types/index.ts +84 -0
- package/src/types/internal.ts +60 -0
- package/src/types/migration.ts +34 -0
- package/src/types/oauth.ts +66 -0
- package/src/types/pins.ts +55 -0
- package/src/types/reactions.ts +95 -0
- package/src/types/reminders.ts +88 -0
- package/src/types/rtm.ts +38 -0
- package/src/types/search.ts +32 -0
- package/src/types/stars.ts +72 -0
- package/src/types/team.ts +122 -0
- package/src/types/usergroups.ts +135 -0
- package/src/types/users.ts +221 -0
- package/src/types/views.ts +76 -0
- package/src/types/workflows.ts +61 -0
- package/README.md +0 -3
package/src/types/api.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/api.test': {
|
|
5
|
+
GET: { 'apiTest': true },
|
|
6
|
+
},
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export namespace Api {
|
|
10
|
+
export namespace Params {
|
|
11
|
+
export interface Test {
|
|
12
|
+
error?: string
|
|
13
|
+
foo?: string
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare module './internal' {
|
|
19
|
+
interface Internal {
|
|
20
|
+
/**
|
|
21
|
+
* Checks API calling code.
|
|
22
|
+
* @see https://api.slack.com/methods/api.test
|
|
23
|
+
*/
|
|
24
|
+
apiTest(token: TokenInput, params: Api.Params.Test): Promise<{
|
|
25
|
+
ok: boolean
|
|
26
|
+
}>
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
import { Definitions } from './definition.ts'
|
|
3
|
+
|
|
4
|
+
Internal.define({
|
|
5
|
+
'/apps.event.authorizations.list': {
|
|
6
|
+
GET: { 'appsEventAuthorizationsList': true },
|
|
7
|
+
},
|
|
8
|
+
'/apps.permissions.info': {
|
|
9
|
+
GET: { 'appsPermissionsInfo': false },
|
|
10
|
+
},
|
|
11
|
+
'/apps.permissions.request': {
|
|
12
|
+
GET: { 'appsPermissionsRequest': false },
|
|
13
|
+
},
|
|
14
|
+
'/apps.permissions.resources.list': {
|
|
15
|
+
GET: { 'appsPermissionsResourcesList': false },
|
|
16
|
+
},
|
|
17
|
+
'/apps.permissions.scopes.list': {
|
|
18
|
+
GET: { 'appsPermissionsScopesList': false },
|
|
19
|
+
},
|
|
20
|
+
'/apps.permissions.users.list': {
|
|
21
|
+
GET: { 'appsPermissionsUsersList': false },
|
|
22
|
+
},
|
|
23
|
+
'/apps.permissions.users.request': {
|
|
24
|
+
GET: { 'appsPermissionsUsersRequest': false },
|
|
25
|
+
},
|
|
26
|
+
'/apps.uninstall': {
|
|
27
|
+
GET: { 'appsUninstall': false },
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export namespace Apps {
|
|
32
|
+
export namespace Params {
|
|
33
|
+
export interface EventAuthorizationsList {
|
|
34
|
+
event_context: string
|
|
35
|
+
cursor?: string
|
|
36
|
+
limit?: number
|
|
37
|
+
}
|
|
38
|
+
export interface PermissionsInfo {
|
|
39
|
+
}
|
|
40
|
+
export interface PermissionsRequest {
|
|
41
|
+
scopes: string
|
|
42
|
+
trigger_id: string
|
|
43
|
+
}
|
|
44
|
+
export interface PermissionsResourcesList {
|
|
45
|
+
cursor?: string
|
|
46
|
+
limit?: number
|
|
47
|
+
}
|
|
48
|
+
export interface PermissionsScopesList {
|
|
49
|
+
}
|
|
50
|
+
export interface PermissionsUsersList {
|
|
51
|
+
cursor?: string
|
|
52
|
+
limit?: number
|
|
53
|
+
}
|
|
54
|
+
export interface PermissionsUsersRequest {
|
|
55
|
+
scopes: string
|
|
56
|
+
trigger_id: string
|
|
57
|
+
user: string
|
|
58
|
+
}
|
|
59
|
+
export interface Uninstall {
|
|
60
|
+
client_id?: string
|
|
61
|
+
client_secret?: string
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare module './internal' {
|
|
67
|
+
interface Internal {
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.
|
|
71
|
+
* @see https://api.slack.com/methods/apps.event.authorizations.list
|
|
72
|
+
*/
|
|
73
|
+
appsEventAuthorizationsList(token: TokenInput, params: Apps.Params.EventAuthorizationsList): Promise<{
|
|
74
|
+
ok: boolean
|
|
75
|
+
}>
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns list of permissions this app has on a team.
|
|
79
|
+
* @see https://api.slack.com/methods/apps.permissions.info
|
|
80
|
+
*/
|
|
81
|
+
appsPermissionsInfo(token: TokenInput): Promise<{
|
|
82
|
+
info: {
|
|
83
|
+
app_home: {
|
|
84
|
+
resources: Definitions.Resources
|
|
85
|
+
scopes: Definitions.Scopes
|
|
86
|
+
}
|
|
87
|
+
channel: {
|
|
88
|
+
resources: Definitions.Resources
|
|
89
|
+
scopes: Definitions.Scopes
|
|
90
|
+
}
|
|
91
|
+
group: {
|
|
92
|
+
resources: Definitions.Resources
|
|
93
|
+
scopes: Definitions.Scopes
|
|
94
|
+
}
|
|
95
|
+
im: {
|
|
96
|
+
resources: Definitions.Resources
|
|
97
|
+
scopes: Definitions.Scopes
|
|
98
|
+
}
|
|
99
|
+
mpim: {
|
|
100
|
+
resources: Definitions.Resources
|
|
101
|
+
scopes: Definitions.Scopes
|
|
102
|
+
}
|
|
103
|
+
team: {
|
|
104
|
+
resources: Definitions.Resources
|
|
105
|
+
scopes: Definitions.Scopes
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
ok: boolean
|
|
109
|
+
}>
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Allows an app to request additional scopes
|
|
113
|
+
* @see https://api.slack.com/methods/apps.permissions.request
|
|
114
|
+
*/
|
|
115
|
+
appsPermissionsRequest(token: TokenInput, params: Apps.Params.PermissionsRequest): Promise<{
|
|
116
|
+
ok: boolean
|
|
117
|
+
}>
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns list of resource grants this app has on a team.
|
|
121
|
+
* @see https://api.slack.com/methods/apps.permissions.resources.list
|
|
122
|
+
*/
|
|
123
|
+
appsPermissionsResourcesList(token: TokenInput, params: Apps.Params.PermissionsResourcesList): Promise<{
|
|
124
|
+
ok: boolean
|
|
125
|
+
resources: {
|
|
126
|
+
id: string
|
|
127
|
+
type: string
|
|
128
|
+
}[]
|
|
129
|
+
response_metadata?: {
|
|
130
|
+
next_cursor: string
|
|
131
|
+
}
|
|
132
|
+
}>
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Returns list of scopes this app has on a team.
|
|
136
|
+
* @see https://api.slack.com/methods/apps.permissions.scopes.list
|
|
137
|
+
*/
|
|
138
|
+
appsPermissionsScopesList(token: TokenInput): Promise<{
|
|
139
|
+
ok: boolean
|
|
140
|
+
scopes: {
|
|
141
|
+
app_home: Definitions.Scopes
|
|
142
|
+
channel: Definitions.Scopes
|
|
143
|
+
group: Definitions.Scopes
|
|
144
|
+
im: Definitions.Scopes
|
|
145
|
+
mpim: Definitions.Scopes
|
|
146
|
+
team: Definitions.Scopes
|
|
147
|
+
user: Definitions.Scopes
|
|
148
|
+
}
|
|
149
|
+
}>
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Returns list of user grants and corresponding scopes this app has on a team.
|
|
153
|
+
* @see https://api.slack.com/methods/apps.permissions.users.list
|
|
154
|
+
*/
|
|
155
|
+
appsPermissionsUsersList(token: TokenInput, params: Apps.Params.PermissionsUsersList): Promise<{
|
|
156
|
+
ok: boolean
|
|
157
|
+
}>
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Enables an app to trigger a permissions modal to grant an app access to a user access scope.
|
|
161
|
+
* @see https://api.slack.com/methods/apps.permissions.users.request
|
|
162
|
+
*/
|
|
163
|
+
appsPermissionsUsersRequest(token: TokenInput, params: Apps.Params.PermissionsUsersRequest): Promise<{
|
|
164
|
+
ok: boolean
|
|
165
|
+
}>
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Uninstalls your app from a workspace.
|
|
169
|
+
* @see https://api.slack.com/methods/apps.uninstall
|
|
170
|
+
*/
|
|
171
|
+
appsUninstall(token: TokenInput, params: Apps.Params.Uninstall): Promise<{
|
|
172
|
+
ok: boolean
|
|
173
|
+
}>
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/auth.revoke': {
|
|
5
|
+
GET: { 'authRevoke': false },
|
|
6
|
+
},
|
|
7
|
+
'/auth.test': {
|
|
8
|
+
GET: { 'authTest': true },
|
|
9
|
+
},
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export namespace Auth {
|
|
13
|
+
export namespace Params {
|
|
14
|
+
export interface Revoke {
|
|
15
|
+
test?: boolean
|
|
16
|
+
}
|
|
17
|
+
export interface Test {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module './internal' {
|
|
23
|
+
interface Internal {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Revokes a token.
|
|
27
|
+
* @see https://api.slack.com/methods/auth.revoke
|
|
28
|
+
*/
|
|
29
|
+
authRevoke(token: TokenInput, params: Auth.Params.Revoke): Promise<{
|
|
30
|
+
ok: boolean
|
|
31
|
+
revoked: boolean
|
|
32
|
+
}>
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Checks authentication & identity.
|
|
36
|
+
* @see https://api.slack.com/methods/auth.test
|
|
37
|
+
*/
|
|
38
|
+
authTest(token: TokenInput): Promise<{
|
|
39
|
+
bot_id?: string
|
|
40
|
+
is_enterprise_install?: boolean
|
|
41
|
+
ok: boolean
|
|
42
|
+
team: string
|
|
43
|
+
team_id: string
|
|
44
|
+
url: string
|
|
45
|
+
user: string
|
|
46
|
+
user_id: string
|
|
47
|
+
}>
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/bots.info': {
|
|
5
|
+
GET: { 'botsInfo': false },
|
|
6
|
+
},
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export namespace Bots {
|
|
10
|
+
export namespace Params {
|
|
11
|
+
export interface Info {
|
|
12
|
+
bot?: string
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module './internal' {
|
|
18
|
+
interface Internal {
|
|
19
|
+
/**
|
|
20
|
+
* Gets information about a bot user.
|
|
21
|
+
* @see https://api.slack.com/methods/bots.info
|
|
22
|
+
*/
|
|
23
|
+
botsInfo(token: TokenInput, params: Bots.Params.Info): Promise<{
|
|
24
|
+
bot: {
|
|
25
|
+
app_id: string
|
|
26
|
+
deleted: boolean
|
|
27
|
+
icons: {
|
|
28
|
+
image_36: string
|
|
29
|
+
image_48: string
|
|
30
|
+
image_72: string
|
|
31
|
+
}
|
|
32
|
+
id: string
|
|
33
|
+
name: string
|
|
34
|
+
updated: number
|
|
35
|
+
user_id: string
|
|
36
|
+
}
|
|
37
|
+
ok: boolean
|
|
38
|
+
}>
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/calls.add': {
|
|
5
|
+
POST: { 'callsAdd': true },
|
|
6
|
+
},
|
|
7
|
+
'/calls.end': {
|
|
8
|
+
POST: { 'callsEnd': true },
|
|
9
|
+
},
|
|
10
|
+
'/calls.info': {
|
|
11
|
+
GET: { 'callsInfo': true },
|
|
12
|
+
},
|
|
13
|
+
'/calls.participants.add': {
|
|
14
|
+
POST: { 'callsParticipantsAdd': true },
|
|
15
|
+
},
|
|
16
|
+
'/calls.participants.remove': {
|
|
17
|
+
POST: { 'callsParticipantsRemove': true },
|
|
18
|
+
},
|
|
19
|
+
'/calls.update': {
|
|
20
|
+
POST: { 'callsUpdate': true },
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export namespace Calls {
|
|
25
|
+
export namespace Params {
|
|
26
|
+
export interface Add {
|
|
27
|
+
external_unique_id: string
|
|
28
|
+
external_display_id?: string
|
|
29
|
+
join_url: string
|
|
30
|
+
desktop_app_join_url?: string
|
|
31
|
+
date_start?: number
|
|
32
|
+
title?: string
|
|
33
|
+
created_by?: string
|
|
34
|
+
users?: string
|
|
35
|
+
}
|
|
36
|
+
export interface End {
|
|
37
|
+
id: string
|
|
38
|
+
duration?: number
|
|
39
|
+
}
|
|
40
|
+
export interface Info {
|
|
41
|
+
id: string
|
|
42
|
+
}
|
|
43
|
+
export interface ParticipantsAdd {
|
|
44
|
+
id: string
|
|
45
|
+
users: string
|
|
46
|
+
}
|
|
47
|
+
export interface ParticipantsRemove {
|
|
48
|
+
id: string
|
|
49
|
+
users: string
|
|
50
|
+
}
|
|
51
|
+
export interface Update {
|
|
52
|
+
id: string
|
|
53
|
+
title?: string
|
|
54
|
+
join_url?: string
|
|
55
|
+
desktop_app_join_url?: string
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare module './internal' {
|
|
61
|
+
interface Internal {
|
|
62
|
+
/**
|
|
63
|
+
* Registers a new Call.
|
|
64
|
+
* @see https://api.slack.com/methods/calls.add
|
|
65
|
+
*/
|
|
66
|
+
callsAdd(token: TokenInput, params: Calls.Params.Add): Promise<{
|
|
67
|
+
ok: boolean
|
|
68
|
+
}>
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Ends a Call.
|
|
72
|
+
* @see https://api.slack.com/methods/calls.end
|
|
73
|
+
*/
|
|
74
|
+
callsEnd(token: TokenInput, params: Calls.Params.End): Promise<{
|
|
75
|
+
ok: boolean
|
|
76
|
+
}>
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Returns information about a Call.
|
|
80
|
+
* @see https://api.slack.com/methods/calls.info
|
|
81
|
+
*/
|
|
82
|
+
callsInfo(token: TokenInput, params: Calls.Params.Info): Promise<{
|
|
83
|
+
ok: boolean
|
|
84
|
+
}>
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Registers new participants added to a Call.
|
|
88
|
+
* @see https://api.slack.com/methods/calls.participants.add
|
|
89
|
+
*/
|
|
90
|
+
callsParticipantsAdd(token: TokenInput, params: Calls.Params.ParticipantsAdd): Promise<{
|
|
91
|
+
ok: boolean
|
|
92
|
+
}>
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Registers participants removed from a Call.
|
|
96
|
+
* @see https://api.slack.com/methods/calls.participants.remove
|
|
97
|
+
*/
|
|
98
|
+
callsParticipantsRemove(token: TokenInput, params: Calls.Params.ParticipantsRemove): Promise<{
|
|
99
|
+
ok: boolean
|
|
100
|
+
}>
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Updates information about a Call.
|
|
104
|
+
* @see https://api.slack.com/methods/calls.update
|
|
105
|
+
*/
|
|
106
|
+
callsUpdate(token: TokenInput, params: Calls.Params.Update): Promise<{
|
|
107
|
+
ok: boolean
|
|
108
|
+
}>
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
import { Definitions } from './definition.ts'
|
|
3
|
+
|
|
4
|
+
Internal.define({
|
|
5
|
+
'/chat.delete': {
|
|
6
|
+
POST: { 'chatDelete': true },
|
|
7
|
+
},
|
|
8
|
+
'/chat.deleteScheduledMessage': {
|
|
9
|
+
POST: { 'chatDeleteScheduledMessage': true },
|
|
10
|
+
},
|
|
11
|
+
'/chat.getPermalink': {
|
|
12
|
+
GET: { 'chatGetPermalink': false },
|
|
13
|
+
},
|
|
14
|
+
'/chat.meMessage': {
|
|
15
|
+
POST: { 'chatMeMessage': true },
|
|
16
|
+
},
|
|
17
|
+
'/chat.postEphemeral': {
|
|
18
|
+
POST: { 'chatPostEphemeral': true },
|
|
19
|
+
},
|
|
20
|
+
'/chat.postMessage': {
|
|
21
|
+
POST: { 'chatPostMessage': true },
|
|
22
|
+
},
|
|
23
|
+
'/chat.scheduleMessage': {
|
|
24
|
+
POST: { 'chatScheduleMessage': true },
|
|
25
|
+
},
|
|
26
|
+
'/chat.scheduledMessages.list': {
|
|
27
|
+
GET: { 'chatScheduledMessagesList': true },
|
|
28
|
+
},
|
|
29
|
+
'/chat.unfurl': {
|
|
30
|
+
POST: { 'chatUnfurl': true },
|
|
31
|
+
},
|
|
32
|
+
'/chat.update': {
|
|
33
|
+
POST: { 'chatUpdate': true },
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
export namespace Chat {
|
|
38
|
+
export namespace Params {
|
|
39
|
+
export interface Delete {
|
|
40
|
+
ts?: number
|
|
41
|
+
channel?: string
|
|
42
|
+
as_user?: boolean
|
|
43
|
+
}
|
|
44
|
+
export interface DeleteScheduledMessage {
|
|
45
|
+
as_user?: boolean
|
|
46
|
+
channel: string
|
|
47
|
+
scheduled_message_id: string
|
|
48
|
+
}
|
|
49
|
+
export interface GetPermalink {
|
|
50
|
+
channel: string
|
|
51
|
+
message_ts: string
|
|
52
|
+
}
|
|
53
|
+
export interface MeMessage {
|
|
54
|
+
channel?: string
|
|
55
|
+
text?: string
|
|
56
|
+
}
|
|
57
|
+
export interface PostEphemeral {
|
|
58
|
+
as_user?: boolean
|
|
59
|
+
attachments?: string
|
|
60
|
+
blocks?: string
|
|
61
|
+
channel: string
|
|
62
|
+
icon_emoji?: string
|
|
63
|
+
icon_url?: string
|
|
64
|
+
link_names?: boolean
|
|
65
|
+
parse?: string
|
|
66
|
+
text?: string
|
|
67
|
+
thread_ts?: string
|
|
68
|
+
user: string
|
|
69
|
+
username?: string
|
|
70
|
+
}
|
|
71
|
+
export interface PostMessage {
|
|
72
|
+
as_user?: string
|
|
73
|
+
attachments?: string
|
|
74
|
+
blocks?: string
|
|
75
|
+
channel: string
|
|
76
|
+
icon_emoji?: string
|
|
77
|
+
icon_url?: string
|
|
78
|
+
link_names?: boolean
|
|
79
|
+
mrkdwn?: boolean
|
|
80
|
+
parse?: string
|
|
81
|
+
reply_broadcast?: boolean
|
|
82
|
+
text?: string
|
|
83
|
+
thread_ts?: string
|
|
84
|
+
unfurl_links?: boolean
|
|
85
|
+
unfurl_media?: boolean
|
|
86
|
+
username?: string
|
|
87
|
+
}
|
|
88
|
+
export interface ScheduleMessage {
|
|
89
|
+
channel?: string
|
|
90
|
+
text?: string
|
|
91
|
+
post_at?: string
|
|
92
|
+
parse?: string
|
|
93
|
+
as_user?: boolean
|
|
94
|
+
link_names?: boolean
|
|
95
|
+
attachments?: string
|
|
96
|
+
blocks?: string
|
|
97
|
+
unfurl_links?: boolean
|
|
98
|
+
unfurl_media?: boolean
|
|
99
|
+
thread_ts?: number
|
|
100
|
+
reply_broadcast?: boolean
|
|
101
|
+
}
|
|
102
|
+
export interface ScheduledMessagesList {
|
|
103
|
+
channel?: string
|
|
104
|
+
latest?: number
|
|
105
|
+
oldest?: number
|
|
106
|
+
limit?: number
|
|
107
|
+
cursor?: string
|
|
108
|
+
}
|
|
109
|
+
export interface Unfurl {
|
|
110
|
+
channel: string
|
|
111
|
+
ts: string
|
|
112
|
+
unfurls?: string
|
|
113
|
+
user_auth_message?: string
|
|
114
|
+
user_auth_required?: boolean
|
|
115
|
+
user_auth_url?: string
|
|
116
|
+
}
|
|
117
|
+
export interface Update {
|
|
118
|
+
as_user?: string
|
|
119
|
+
attachments?: string
|
|
120
|
+
blocks?: string
|
|
121
|
+
channel: string
|
|
122
|
+
link_names?: string
|
|
123
|
+
parse?: string
|
|
124
|
+
text?: string
|
|
125
|
+
ts: string
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare module './internal' {
|
|
131
|
+
interface Internal {
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Deletes a message.
|
|
135
|
+
* @see https://api.slack.com/methods/chat.delete
|
|
136
|
+
*/
|
|
137
|
+
chatDelete(token: TokenInput, params: Chat.Params.Delete): Promise<{
|
|
138
|
+
channel: string
|
|
139
|
+
ok: boolean
|
|
140
|
+
ts: string
|
|
141
|
+
}>
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Deletes a pending scheduled message from the queue.
|
|
145
|
+
* @see https://api.slack.com/methods/chat.deleteScheduledMessage
|
|
146
|
+
*/
|
|
147
|
+
chatDeleteScheduledMessage(token: TokenInput, params: Chat.Params.DeleteScheduledMessage): Promise<{
|
|
148
|
+
ok: boolean
|
|
149
|
+
}>
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Retrieve a permalink URL for a specific extant message
|
|
153
|
+
* @see https://api.slack.com/methods/chat.getPermalink
|
|
154
|
+
*/
|
|
155
|
+
chatGetPermalink(token: TokenInput, params: Chat.Params.GetPermalink): Promise<{
|
|
156
|
+
channel: string
|
|
157
|
+
ok: boolean
|
|
158
|
+
permalink: string
|
|
159
|
+
}>
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Share a me message into a channel.
|
|
163
|
+
* @see https://api.slack.com/methods/chat.meMessage
|
|
164
|
+
*/
|
|
165
|
+
chatMeMessage(token: TokenInput, params: Chat.Params.MeMessage): Promise<{
|
|
166
|
+
channel?: string
|
|
167
|
+
ok: boolean
|
|
168
|
+
ts?: string
|
|
169
|
+
}>
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Sends an ephemeral message to a user in a channel.
|
|
173
|
+
* @see https://api.slack.com/methods/chat.postEphemeral
|
|
174
|
+
*/
|
|
175
|
+
chatPostEphemeral(token: TokenInput, params: Chat.Params.PostEphemeral): Promise<{
|
|
176
|
+
message_ts: string
|
|
177
|
+
ok: boolean
|
|
178
|
+
}>
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Sends a message to a channel.
|
|
182
|
+
* @see https://api.slack.com/methods/chat.postMessage
|
|
183
|
+
*/
|
|
184
|
+
chatPostMessage(token: TokenInput, params: Chat.Params.PostMessage): Promise<{
|
|
185
|
+
channel: string
|
|
186
|
+
message: Definitions.Message
|
|
187
|
+
ok: boolean
|
|
188
|
+
ts: string
|
|
189
|
+
}>
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Schedules a message to be sent to a channel.
|
|
193
|
+
* @see https://api.slack.com/methods/chat.scheduleMessage
|
|
194
|
+
*/
|
|
195
|
+
chatScheduleMessage(token: TokenInput, params: Chat.Params.ScheduleMessage): Promise<{
|
|
196
|
+
channel: string
|
|
197
|
+
message: {
|
|
198
|
+
bot_id: string
|
|
199
|
+
bot_profile: Definitions.BotProfile
|
|
200
|
+
team: string
|
|
201
|
+
text: string
|
|
202
|
+
type: string
|
|
203
|
+
user: string
|
|
204
|
+
username: string
|
|
205
|
+
}
|
|
206
|
+
ok: boolean
|
|
207
|
+
post_at: number
|
|
208
|
+
scheduled_message_id: string
|
|
209
|
+
}>
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Returns a list of scheduled messages.
|
|
213
|
+
* @see https://api.slack.com/methods/chat.scheduledMessages.list
|
|
214
|
+
*/
|
|
215
|
+
chatScheduledMessagesList(token: TokenInput, params: Chat.Params.ScheduledMessagesList): Promise<{
|
|
216
|
+
ok: boolean
|
|
217
|
+
response_metadata: {
|
|
218
|
+
next_cursor: string
|
|
219
|
+
}
|
|
220
|
+
scheduled_messages: {
|
|
221
|
+
channel_id: string
|
|
222
|
+
date_created: number
|
|
223
|
+
id: string
|
|
224
|
+
post_at: number
|
|
225
|
+
text: string
|
|
226
|
+
}[]
|
|
227
|
+
}>
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Provide custom unfurl behavior for user-posted URLs
|
|
231
|
+
* @see https://api.slack.com/methods/chat.unfurl
|
|
232
|
+
*/
|
|
233
|
+
chatUnfurl(token: TokenInput, params: Chat.Params.Unfurl): Promise<{
|
|
234
|
+
ok: boolean
|
|
235
|
+
}>
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Updates a message.
|
|
239
|
+
* @see https://api.slack.com/methods/chat.update
|
|
240
|
+
*/
|
|
241
|
+
chatUpdate(token: TokenInput, params: Chat.Params.Update): Promise<{
|
|
242
|
+
channel: string
|
|
243
|
+
message: {
|
|
244
|
+
attachments: {
|
|
245
|
+
}[]
|
|
246
|
+
blocks: {
|
|
247
|
+
}
|
|
248
|
+
text: string
|
|
249
|
+
}
|
|
250
|
+
ok: boolean
|
|
251
|
+
text: string
|
|
252
|
+
ts: string
|
|
253
|
+
}>
|
|
254
|
+
}
|
|
255
|
+
}
|