@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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
import { Definitions } from './definition.ts'
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/reminders.add': {
|
|
5
|
+
POST: { 'remindersAdd': true },
|
|
6
|
+
},
|
|
7
|
+
'/reminders.complete': {
|
|
8
|
+
POST: { 'remindersComplete': true },
|
|
9
|
+
},
|
|
10
|
+
'/reminders.delete': {
|
|
11
|
+
POST: { 'remindersDelete': true },
|
|
12
|
+
},
|
|
13
|
+
'/reminders.info': {
|
|
14
|
+
GET: { 'remindersInfo': false },
|
|
15
|
+
},
|
|
16
|
+
'/reminders.list': {
|
|
17
|
+
GET: { 'remindersList': false },
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export namespace Reminders {
|
|
22
|
+
export namespace Params {
|
|
23
|
+
export interface Add {
|
|
24
|
+
text: string
|
|
25
|
+
time: string
|
|
26
|
+
user?: string
|
|
27
|
+
}
|
|
28
|
+
export interface Complete {
|
|
29
|
+
reminder?: string
|
|
30
|
+
}
|
|
31
|
+
export interface Delete {
|
|
32
|
+
reminder?: string
|
|
33
|
+
}
|
|
34
|
+
export interface Info {
|
|
35
|
+
reminder?: string
|
|
36
|
+
}
|
|
37
|
+
export interface List {
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare module './internal' {
|
|
43
|
+
interface Internal {
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Creates a reminder.
|
|
47
|
+
* @see https://api.slack.com/methods/reminders.add
|
|
48
|
+
*/
|
|
49
|
+
remindersAdd(token: TokenInput, params: Reminders.Params.Add): Promise<{
|
|
50
|
+
ok: boolean
|
|
51
|
+
reminder: Definitions.Reminder
|
|
52
|
+
}>
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Marks a reminder as complete.
|
|
56
|
+
* @see https://api.slack.com/methods/reminders.complete
|
|
57
|
+
*/
|
|
58
|
+
remindersComplete(token: TokenInput, params: Reminders.Params.Complete): Promise<{
|
|
59
|
+
ok: boolean
|
|
60
|
+
}>
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a reminder.
|
|
64
|
+
* @see https://api.slack.com/methods/reminders.delete
|
|
65
|
+
*/
|
|
66
|
+
remindersDelete(token: TokenInput, params: Reminders.Params.Delete): Promise<{
|
|
67
|
+
ok: boolean
|
|
68
|
+
}>
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Gets information about a reminder.
|
|
72
|
+
* @see https://api.slack.com/methods/reminders.info
|
|
73
|
+
*/
|
|
74
|
+
remindersInfo(token: TokenInput, params: Reminders.Params.Info): Promise<{
|
|
75
|
+
ok: boolean
|
|
76
|
+
reminder: Definitions.Reminder
|
|
77
|
+
}>
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Lists all reminders created by or for a given user.
|
|
81
|
+
* @see https://api.slack.com/methods/reminders.list
|
|
82
|
+
*/
|
|
83
|
+
remindersList(token: TokenInput): Promise<{
|
|
84
|
+
ok: boolean
|
|
85
|
+
reminders: Definitions.Reminder[]
|
|
86
|
+
}>
|
|
87
|
+
}
|
|
88
|
+
}
|
package/src/types/rtm.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/rtm.connect': {
|
|
5
|
+
GET: { 'rtmConnect': false },
|
|
6
|
+
},
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export namespace Rtm {
|
|
10
|
+
export namespace Params {
|
|
11
|
+
export interface Connect {
|
|
12
|
+
batch_presence_aware?: boolean
|
|
13
|
+
presence_sub?: boolean
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare module './internal' {
|
|
19
|
+
interface Internal {
|
|
20
|
+
/**
|
|
21
|
+
* Starts a Real Time Messaging session.
|
|
22
|
+
* @see https://api.slack.com/methods/rtm.connect
|
|
23
|
+
*/
|
|
24
|
+
rtmConnect(token: TokenInput, params: Rtm.Params.Connect): Promise<{
|
|
25
|
+
ok: boolean
|
|
26
|
+
self: {
|
|
27
|
+
id: string
|
|
28
|
+
name: string
|
|
29
|
+
}
|
|
30
|
+
team: {
|
|
31
|
+
domain: string
|
|
32
|
+
id: string
|
|
33
|
+
name: string
|
|
34
|
+
}
|
|
35
|
+
url: string
|
|
36
|
+
}>
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/search.messages': {
|
|
5
|
+
GET: { 'searchMessages': false },
|
|
6
|
+
},
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export namespace Search {
|
|
10
|
+
export namespace Params {
|
|
11
|
+
export interface Messages {
|
|
12
|
+
count?: number
|
|
13
|
+
highlight?: boolean
|
|
14
|
+
page?: number
|
|
15
|
+
query: string
|
|
16
|
+
sort?: string
|
|
17
|
+
sort_dir?: string
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare module './internal' {
|
|
23
|
+
interface Internal {
|
|
24
|
+
/**
|
|
25
|
+
* Searches for messages matching a query.
|
|
26
|
+
* @see https://api.slack.com/methods/search.messages
|
|
27
|
+
*/
|
|
28
|
+
searchMessages(token: TokenInput, params: Search.Params.Messages): Promise<{
|
|
29
|
+
ok: boolean
|
|
30
|
+
}>
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
import { Definitions } from './definition.ts'
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/stars.add': {
|
|
5
|
+
POST: { 'starsAdd': true },
|
|
6
|
+
},
|
|
7
|
+
'/stars.list': {
|
|
8
|
+
GET: { 'starsList': false },
|
|
9
|
+
},
|
|
10
|
+
'/stars.remove': {
|
|
11
|
+
POST: { 'starsRemove': true },
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export namespace Stars {
|
|
16
|
+
export namespace Params {
|
|
17
|
+
export interface Add {
|
|
18
|
+
channel?: string
|
|
19
|
+
file?: string
|
|
20
|
+
file_comment?: string
|
|
21
|
+
timestamp?: string
|
|
22
|
+
}
|
|
23
|
+
export interface List {
|
|
24
|
+
count?: string
|
|
25
|
+
page?: string
|
|
26
|
+
cursor?: string
|
|
27
|
+
limit?: number
|
|
28
|
+
}
|
|
29
|
+
export interface Remove {
|
|
30
|
+
channel?: string
|
|
31
|
+
file?: string
|
|
32
|
+
file_comment?: string
|
|
33
|
+
timestamp?: string
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare module './internal' {
|
|
39
|
+
interface Internal {
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Adds a star to an item.
|
|
43
|
+
* @see https://api.slack.com/methods/stars.add
|
|
44
|
+
*/
|
|
45
|
+
starsAdd(token: TokenInput, params: Stars.Params.Add): Promise<{
|
|
46
|
+
ok: boolean
|
|
47
|
+
}>
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Lists stars for a user.
|
|
51
|
+
* @see https://api.slack.com/methods/stars.list
|
|
52
|
+
*/
|
|
53
|
+
starsList(token: TokenInput, params: Stars.Params.List): Promise<{
|
|
54
|
+
items: {
|
|
55
|
+
channel: string
|
|
56
|
+
date_create: number
|
|
57
|
+
message: Definitions.Message
|
|
58
|
+
type: string
|
|
59
|
+
}[]
|
|
60
|
+
ok: boolean
|
|
61
|
+
paging?: Definitions.Paging
|
|
62
|
+
}>
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Removes a star from an item.
|
|
66
|
+
* @see https://api.slack.com/methods/stars.remove
|
|
67
|
+
*/
|
|
68
|
+
starsRemove(token: TokenInput, params: Stars.Params.Remove): Promise<{
|
|
69
|
+
ok: boolean
|
|
70
|
+
}>
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
import { Definitions } from './definition.ts'
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/team.accessLogs': {
|
|
5
|
+
GET: { 'teamAccessLogs': false },
|
|
6
|
+
},
|
|
7
|
+
'/team.billableInfo': {
|
|
8
|
+
GET: { 'teamBillableInfo': false },
|
|
9
|
+
},
|
|
10
|
+
'/team.info': {
|
|
11
|
+
GET: { 'teamInfo': false },
|
|
12
|
+
},
|
|
13
|
+
'/team.integrationLogs': {
|
|
14
|
+
GET: { 'teamIntegrationLogs': false },
|
|
15
|
+
},
|
|
16
|
+
'/team.profile.get': {
|
|
17
|
+
GET: { 'teamProfileGet': false },
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export namespace Team {
|
|
22
|
+
export namespace Params {
|
|
23
|
+
export interface AccessLogs {
|
|
24
|
+
before?: string
|
|
25
|
+
count?: string
|
|
26
|
+
page?: string
|
|
27
|
+
}
|
|
28
|
+
export interface BillableInfo {
|
|
29
|
+
user?: string
|
|
30
|
+
}
|
|
31
|
+
export interface Info {
|
|
32
|
+
team?: string
|
|
33
|
+
}
|
|
34
|
+
export interface IntegrationLogs {
|
|
35
|
+
app_id?: string
|
|
36
|
+
change_type?: string
|
|
37
|
+
count?: string
|
|
38
|
+
page?: string
|
|
39
|
+
service_id?: string
|
|
40
|
+
user?: string
|
|
41
|
+
}
|
|
42
|
+
export interface ProfileGet {
|
|
43
|
+
visibility?: string
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare module './internal' {
|
|
49
|
+
interface Internal {
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Gets the access logs for the current team.
|
|
53
|
+
* @see https://api.slack.com/methods/team.accessLogs
|
|
54
|
+
*/
|
|
55
|
+
teamAccessLogs(token: TokenInput, params: Team.Params.AccessLogs): Promise<{
|
|
56
|
+
logins: {
|
|
57
|
+
count: number
|
|
58
|
+
country: unknown
|
|
59
|
+
date_first: number
|
|
60
|
+
date_last: number
|
|
61
|
+
ip: unknown
|
|
62
|
+
isp: unknown
|
|
63
|
+
region: unknown
|
|
64
|
+
user_agent: string
|
|
65
|
+
user_id: string
|
|
66
|
+
username: string
|
|
67
|
+
}[]
|
|
68
|
+
ok: boolean
|
|
69
|
+
paging: Definitions.Paging
|
|
70
|
+
}>
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets billable users information for the current team.
|
|
74
|
+
* @see https://api.slack.com/methods/team.billableInfo
|
|
75
|
+
*/
|
|
76
|
+
teamBillableInfo(token: TokenInput, params: Team.Params.BillableInfo): Promise<{
|
|
77
|
+
ok: boolean
|
|
78
|
+
}>
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Gets information about the current team.
|
|
82
|
+
* @see https://api.slack.com/methods/team.info
|
|
83
|
+
*/
|
|
84
|
+
teamInfo(token: TokenInput, params: Team.Params.Info): Promise<{
|
|
85
|
+
ok: boolean
|
|
86
|
+
team: Definitions.Team
|
|
87
|
+
}>
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Gets the integration logs for the current team.
|
|
91
|
+
* @see https://api.slack.com/methods/team.integrationLogs
|
|
92
|
+
*/
|
|
93
|
+
teamIntegrationLogs(token: TokenInput, params: Team.Params.IntegrationLogs): Promise<{
|
|
94
|
+
logs: {
|
|
95
|
+
admin_app_id: string
|
|
96
|
+
app_id: string
|
|
97
|
+
app_type: string
|
|
98
|
+
change_type: string
|
|
99
|
+
channel: string
|
|
100
|
+
date: string
|
|
101
|
+
scope: string
|
|
102
|
+
service_id: string
|
|
103
|
+
service_type: string
|
|
104
|
+
user_id: string
|
|
105
|
+
user_name: string
|
|
106
|
+
}[]
|
|
107
|
+
ok: boolean
|
|
108
|
+
paging: Definitions.Paging
|
|
109
|
+
}>
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Retrieve a team's profile.
|
|
113
|
+
* @see https://api.slack.com/methods/team.profile.get
|
|
114
|
+
*/
|
|
115
|
+
teamProfileGet(token: TokenInput, params: Team.Params.ProfileGet): Promise<{
|
|
116
|
+
ok: boolean
|
|
117
|
+
profile: {
|
|
118
|
+
fields: Definitions.TeamProfileField[]
|
|
119
|
+
}
|
|
120
|
+
}>
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
import { Definitions } from './definition.ts'
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/usergroups.create': {
|
|
5
|
+
POST: { 'usergroupsCreate': true },
|
|
6
|
+
},
|
|
7
|
+
'/usergroups.disable': {
|
|
8
|
+
POST: { 'usergroupsDisable': true },
|
|
9
|
+
},
|
|
10
|
+
'/usergroups.enable': {
|
|
11
|
+
POST: { 'usergroupsEnable': true },
|
|
12
|
+
},
|
|
13
|
+
'/usergroups.list': {
|
|
14
|
+
GET: { 'usergroupsList': false },
|
|
15
|
+
},
|
|
16
|
+
'/usergroups.update': {
|
|
17
|
+
POST: { 'usergroupsUpdate': true },
|
|
18
|
+
},
|
|
19
|
+
'/usergroups.users.list': {
|
|
20
|
+
GET: { 'usergroupsUsersList': false },
|
|
21
|
+
},
|
|
22
|
+
'/usergroups.users.update': {
|
|
23
|
+
POST: { 'usergroupsUsersUpdate': true },
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export namespace Usergroups {
|
|
28
|
+
export namespace Params {
|
|
29
|
+
export interface Create {
|
|
30
|
+
channels?: string
|
|
31
|
+
description?: string
|
|
32
|
+
handle?: string
|
|
33
|
+
include_count?: boolean
|
|
34
|
+
name: string
|
|
35
|
+
}
|
|
36
|
+
export interface Disable {
|
|
37
|
+
include_count?: boolean
|
|
38
|
+
usergroup: string
|
|
39
|
+
}
|
|
40
|
+
export interface Enable {
|
|
41
|
+
include_count?: boolean
|
|
42
|
+
usergroup: string
|
|
43
|
+
}
|
|
44
|
+
export interface List {
|
|
45
|
+
include_users?: boolean
|
|
46
|
+
include_count?: boolean
|
|
47
|
+
include_disabled?: boolean
|
|
48
|
+
}
|
|
49
|
+
export interface Update {
|
|
50
|
+
handle?: string
|
|
51
|
+
description?: string
|
|
52
|
+
channels?: string
|
|
53
|
+
include_count?: boolean
|
|
54
|
+
usergroup: string
|
|
55
|
+
name?: string
|
|
56
|
+
}
|
|
57
|
+
export interface UsersList {
|
|
58
|
+
include_disabled?: boolean
|
|
59
|
+
usergroup: string
|
|
60
|
+
}
|
|
61
|
+
export interface UsersUpdate {
|
|
62
|
+
include_count?: boolean
|
|
63
|
+
usergroup: string
|
|
64
|
+
users: string
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare module './internal' {
|
|
70
|
+
interface Internal {
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Create a User Group
|
|
74
|
+
* @see https://api.slack.com/methods/usergroups.create
|
|
75
|
+
*/
|
|
76
|
+
usergroupsCreate(token: TokenInput, params: Usergroups.Params.Create): Promise<{
|
|
77
|
+
ok: boolean
|
|
78
|
+
usergroup: Definitions.Subteam
|
|
79
|
+
}>
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Disable an existing User Group
|
|
83
|
+
* @see https://api.slack.com/methods/usergroups.disable
|
|
84
|
+
*/
|
|
85
|
+
usergroupsDisable(token: TokenInput, params: Usergroups.Params.Disable): Promise<{
|
|
86
|
+
ok: boolean
|
|
87
|
+
usergroup: Definitions.Subteam
|
|
88
|
+
}>
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Enable a User Group
|
|
92
|
+
* @see https://api.slack.com/methods/usergroups.enable
|
|
93
|
+
*/
|
|
94
|
+
usergroupsEnable(token: TokenInput, params: Usergroups.Params.Enable): Promise<{
|
|
95
|
+
ok: boolean
|
|
96
|
+
usergroup: Definitions.Subteam
|
|
97
|
+
}>
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* List all User Groups for a team
|
|
101
|
+
* @see https://api.slack.com/methods/usergroups.list
|
|
102
|
+
*/
|
|
103
|
+
usergroupsList(token: TokenInput, params: Usergroups.Params.List): Promise<{
|
|
104
|
+
ok: boolean
|
|
105
|
+
usergroups: Definitions.Subteam[]
|
|
106
|
+
}>
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Update an existing User Group
|
|
110
|
+
* @see https://api.slack.com/methods/usergroups.update
|
|
111
|
+
*/
|
|
112
|
+
usergroupsUpdate(token: TokenInput, params: Usergroups.Params.Update): Promise<{
|
|
113
|
+
ok: boolean
|
|
114
|
+
usergroup: Definitions.Subteam
|
|
115
|
+
}>
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* List all users in a User Group
|
|
119
|
+
* @see https://api.slack.com/methods/usergroups.users.list
|
|
120
|
+
*/
|
|
121
|
+
usergroupsUsersList(token: TokenInput, params: Usergroups.Params.UsersList): Promise<{
|
|
122
|
+
ok: boolean
|
|
123
|
+
users: string[]
|
|
124
|
+
}>
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Update the list of users for a User Group
|
|
128
|
+
* @see https://api.slack.com/methods/usergroups.users.update
|
|
129
|
+
*/
|
|
130
|
+
usergroupsUsersUpdate(token: TokenInput, params: Usergroups.Params.UsersUpdate): Promise<{
|
|
131
|
+
ok: boolean
|
|
132
|
+
usergroup: Definitions.Subteam
|
|
133
|
+
}>
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { Internal } from './internal.ts'
|
|
2
|
+
import { Definitions } from './definition.ts'
|
|
3
|
+
Internal.define({
|
|
4
|
+
'/users.conversations': {
|
|
5
|
+
GET: { 'usersConversations': false },
|
|
6
|
+
},
|
|
7
|
+
'/users.deletePhoto': {
|
|
8
|
+
POST: { 'usersDeletePhoto': false },
|
|
9
|
+
},
|
|
10
|
+
'/users.getPresence': {
|
|
11
|
+
GET: { 'usersGetPresence': false },
|
|
12
|
+
},
|
|
13
|
+
'/users.identity': {
|
|
14
|
+
GET: { 'usersIdentity': false },
|
|
15
|
+
},
|
|
16
|
+
'/users.info': {
|
|
17
|
+
GET: { 'usersInfo': false },
|
|
18
|
+
},
|
|
19
|
+
'/users.list': {
|
|
20
|
+
GET: { 'usersList': false },
|
|
21
|
+
},
|
|
22
|
+
'/users.lookupByEmail': {
|
|
23
|
+
GET: { 'usersLookupByEmail': false },
|
|
24
|
+
},
|
|
25
|
+
'/users.profile.get': {
|
|
26
|
+
GET: { 'usersProfileGet': false },
|
|
27
|
+
},
|
|
28
|
+
'/users.profile.set': {
|
|
29
|
+
POST: { 'usersProfileSet': true },
|
|
30
|
+
},
|
|
31
|
+
'/users.setActive': {
|
|
32
|
+
POST: { 'usersSetActive': true },
|
|
33
|
+
},
|
|
34
|
+
'/users.setPhoto': {
|
|
35
|
+
POST: { 'usersSetPhoto': false },
|
|
36
|
+
},
|
|
37
|
+
'/users.setPresence': {
|
|
38
|
+
POST: { 'usersSetPresence': true },
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
export namespace Users {
|
|
43
|
+
export namespace Params {
|
|
44
|
+
export interface Conversations {
|
|
45
|
+
user?: string
|
|
46
|
+
types?: string
|
|
47
|
+
exclude_archived?: boolean
|
|
48
|
+
limit?: number
|
|
49
|
+
cursor?: string
|
|
50
|
+
}
|
|
51
|
+
export interface DeletePhoto {
|
|
52
|
+
}
|
|
53
|
+
export interface GetPresence {
|
|
54
|
+
user?: string
|
|
55
|
+
}
|
|
56
|
+
export interface Identity {
|
|
57
|
+
}
|
|
58
|
+
export interface Info {
|
|
59
|
+
include_locale?: boolean
|
|
60
|
+
user?: string
|
|
61
|
+
}
|
|
62
|
+
export interface List {
|
|
63
|
+
limit?: number
|
|
64
|
+
cursor?: string
|
|
65
|
+
include_locale?: boolean
|
|
66
|
+
}
|
|
67
|
+
export interface LookupByEmail {
|
|
68
|
+
email: string
|
|
69
|
+
}
|
|
70
|
+
export interface ProfileGet {
|
|
71
|
+
include_labels?: boolean
|
|
72
|
+
user?: string
|
|
73
|
+
}
|
|
74
|
+
export interface ProfileSet {
|
|
75
|
+
name?: string
|
|
76
|
+
profile?: string
|
|
77
|
+
user?: string
|
|
78
|
+
value?: string
|
|
79
|
+
}
|
|
80
|
+
export interface SetActive {
|
|
81
|
+
}
|
|
82
|
+
export interface SetPhoto {
|
|
83
|
+
crop_w?: string
|
|
84
|
+
crop_x?: string
|
|
85
|
+
crop_y?: string
|
|
86
|
+
image?: string
|
|
87
|
+
}
|
|
88
|
+
export interface SetPresence {
|
|
89
|
+
presence: string
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare module './internal' {
|
|
95
|
+
interface Internal {
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* List conversations the calling user may access.
|
|
99
|
+
* @see https://api.slack.com/methods/users.conversations
|
|
100
|
+
*/
|
|
101
|
+
usersConversations(token: TokenInput, params: Users.Params.Conversations): Promise<{
|
|
102
|
+
channels: Definitions.Conversation[]
|
|
103
|
+
ok: boolean
|
|
104
|
+
response_metadata?: {
|
|
105
|
+
next_cursor: string
|
|
106
|
+
}
|
|
107
|
+
}>
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Delete the user profile photo
|
|
111
|
+
* @see https://api.slack.com/methods/users.deletePhoto
|
|
112
|
+
*/
|
|
113
|
+
usersDeletePhoto(token: TokenInput): Promise<{
|
|
114
|
+
ok: boolean
|
|
115
|
+
}>
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Gets user presence information.
|
|
119
|
+
* @see https://api.slack.com/methods/users.getPresence
|
|
120
|
+
*/
|
|
121
|
+
usersGetPresence(token: TokenInput, params: Users.Params.GetPresence): Promise<{
|
|
122
|
+
auto_away?: boolean
|
|
123
|
+
connection_count?: number
|
|
124
|
+
last_activity?: number
|
|
125
|
+
manual_away?: boolean
|
|
126
|
+
ok: boolean
|
|
127
|
+
online?: boolean
|
|
128
|
+
presence: string
|
|
129
|
+
}>
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Get a user's identity.
|
|
133
|
+
* @see https://api.slack.com/methods/users.identity
|
|
134
|
+
*/
|
|
135
|
+
usersIdentity(token: TokenInput): Promise<unknown>
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Gets information about a user.
|
|
139
|
+
* @see https://api.slack.com/methods/users.info
|
|
140
|
+
*/
|
|
141
|
+
usersInfo(token: TokenInput, params: Users.Params.Info): Promise<{
|
|
142
|
+
ok: boolean
|
|
143
|
+
user: Definitions.User
|
|
144
|
+
}>
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Lists all users in a Slack team.
|
|
148
|
+
* @see https://api.slack.com/methods/users.list
|
|
149
|
+
*/
|
|
150
|
+
usersList(token: TokenInput, params: Users.Params.List): Promise<{
|
|
151
|
+
cache_ts: number
|
|
152
|
+
members: Definitions.User[]
|
|
153
|
+
ok: boolean
|
|
154
|
+
response_metadata?: Definitions.ResponseMetadata
|
|
155
|
+
}>
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Find a user with an email address.
|
|
159
|
+
* @see https://api.slack.com/methods/users.lookupByEmail
|
|
160
|
+
*/
|
|
161
|
+
usersLookupByEmail(token: TokenInput, params: Users.Params.LookupByEmail): Promise<{
|
|
162
|
+
ok: boolean
|
|
163
|
+
user: Definitions.User
|
|
164
|
+
}>
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Retrieves a user's profile information.
|
|
168
|
+
* @see https://api.slack.com/methods/users.profile.get
|
|
169
|
+
*/
|
|
170
|
+
usersProfileGet(token: TokenInput, params: Users.Params.ProfileGet): Promise<{
|
|
171
|
+
ok: boolean
|
|
172
|
+
profile: Definitions.UserProfile
|
|
173
|
+
}>
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Set the profile information for a user.
|
|
177
|
+
* @see https://api.slack.com/methods/users.profile.set
|
|
178
|
+
*/
|
|
179
|
+
usersProfileSet(token: TokenInput, params: Users.Params.ProfileSet): Promise<{
|
|
180
|
+
email_pending?: string
|
|
181
|
+
ok: boolean
|
|
182
|
+
profile: Definitions.UserProfile
|
|
183
|
+
username: string
|
|
184
|
+
}>
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Marked a user as active. Deprecated and non-functional.
|
|
188
|
+
* @see https://api.slack.com/methods/users.setActive
|
|
189
|
+
*/
|
|
190
|
+
usersSetActive(token: TokenInput): Promise<{
|
|
191
|
+
ok: boolean
|
|
192
|
+
}>
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Set the user profile photo
|
|
196
|
+
* @see https://api.slack.com/methods/users.setPhoto
|
|
197
|
+
*/
|
|
198
|
+
usersSetPhoto(token: TokenInput, params: Users.Params.SetPhoto): Promise<{
|
|
199
|
+
ok: boolean
|
|
200
|
+
profile: {
|
|
201
|
+
avatar_hash: string
|
|
202
|
+
image_1024: string
|
|
203
|
+
image_192: string
|
|
204
|
+
image_24: string
|
|
205
|
+
image_32: string
|
|
206
|
+
image_48: string
|
|
207
|
+
image_512: string
|
|
208
|
+
image_72: string
|
|
209
|
+
image_original: string
|
|
210
|
+
}
|
|
211
|
+
}>
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Manually sets user presence.
|
|
215
|
+
* @see https://api.slack.com/methods/users.setPresence
|
|
216
|
+
*/
|
|
217
|
+
usersSetPresence(token: TokenInput, params: Users.Params.SetPresence): Promise<{
|
|
218
|
+
ok: boolean
|
|
219
|
+
}>
|
|
220
|
+
}
|
|
221
|
+
}
|