@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 @@
|
|
|
1
|
+
{"version":3,"file":"emoji.d.ts","sourceRoot":"","sources":["../../../src/types/emoji.ts"],"names":[],"mappings":"AAQA,yBAAiB,KAAK,CAAC;IACrB,UAAiB,MAAM,CAAC;QACtB,UAAiB,IAAI;SACpB;KACF;CACF;AAED,OAAO,QAAQ,YAAY,CAAC;IAC1B,UAAU,QAAQ;QAChB;;;WAGG;QACH,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC;YACpC,EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;KACH;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emoji.js","sourceRoot":"","sources":["../../../src/types/emoji.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,QAAQ,CAAC,MAAM,CAAC;IACd,aAAa,EAAE;QACb,GAAG,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;KAC5B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { MessageEvent as AllMessageEvents } from './message-events.ts';
|
|
2
|
+
import { SlackUser } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* All known event types in Slack's Events API
|
|
5
|
+
* Please refer to https://api.slack.com/events for more details
|
|
6
|
+
*
|
|
7
|
+
* This is a discriminated union. The discriminant is the `type` property.
|
|
8
|
+
*/
|
|
9
|
+
export type SlackEvent = ChannelArchiveEvent | ChannelCreatedEvent | ChannelDeletedEvent | ChannelIDChangedEvent | ChannelLeftEvent | ChannelRenameEvent | EmojiChangedEvent | FileChangeEvent | InviteRequestedEvent | MemberJoinedChannelEvent | MemberLeftChannelEvent | MessageEvent | ReactionAddedEvent | ReactionRemovedEvent | UserChangeEvent | UserProfileChangedEvent | UserStatusChangedEvent | HelloEvent;
|
|
10
|
+
export type EventTypePattern = string | RegExp;
|
|
11
|
+
export interface HelloEvent {
|
|
12
|
+
type: 'hello';
|
|
13
|
+
}
|
|
14
|
+
export interface BasicSlackEvent<Type extends string = string> {
|
|
15
|
+
type: Type;
|
|
16
|
+
}
|
|
17
|
+
export interface ChannelArchiveEvent {
|
|
18
|
+
type: 'channel_archive';
|
|
19
|
+
channel: string;
|
|
20
|
+
user: string;
|
|
21
|
+
is_moved?: number;
|
|
22
|
+
event_ts: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ChannelCreatedEvent {
|
|
25
|
+
type: 'channel_created';
|
|
26
|
+
channel: {
|
|
27
|
+
id: string;
|
|
28
|
+
is_channel: boolean;
|
|
29
|
+
name: string;
|
|
30
|
+
name_normalized: string;
|
|
31
|
+
created: number;
|
|
32
|
+
creator: string;
|
|
33
|
+
is_shared: boolean;
|
|
34
|
+
is_org_shared: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface ChannelDeletedEvent {
|
|
38
|
+
type: 'channel_deleted';
|
|
39
|
+
channel: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ChannelIDChangedEvent {
|
|
42
|
+
type: 'channel_id_changed';
|
|
43
|
+
old_channel_id: string;
|
|
44
|
+
new_channel_id: string;
|
|
45
|
+
event_ts: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ChannelLeftEvent {
|
|
48
|
+
type: 'channel_left';
|
|
49
|
+
channel: string;
|
|
50
|
+
actor_id: string;
|
|
51
|
+
event_ts: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ChannelRenameEvent {
|
|
54
|
+
type: 'channel_rename';
|
|
55
|
+
channel: {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
name_normalized: string;
|
|
59
|
+
created: number;
|
|
60
|
+
is_channel: boolean;
|
|
61
|
+
is_mpim: boolean;
|
|
62
|
+
};
|
|
63
|
+
event_ts: string;
|
|
64
|
+
}
|
|
65
|
+
export interface EmojiChangedEvent {
|
|
66
|
+
type: 'emoji_changed';
|
|
67
|
+
subtype: 'add' | 'remove' | 'rename';
|
|
68
|
+
names?: string[];
|
|
69
|
+
name?: string;
|
|
70
|
+
value?: string;
|
|
71
|
+
old_name?: string;
|
|
72
|
+
new_name?: string;
|
|
73
|
+
event_ts: string;
|
|
74
|
+
}
|
|
75
|
+
export interface FileChangeEvent {
|
|
76
|
+
type: 'file_change';
|
|
77
|
+
file_id: string;
|
|
78
|
+
file: {
|
|
79
|
+
id: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export interface InviteRequestedEvent {
|
|
83
|
+
type: 'invite_requested';
|
|
84
|
+
invite_request: {
|
|
85
|
+
id: string;
|
|
86
|
+
email: string;
|
|
87
|
+
date_created: number;
|
|
88
|
+
requester_ids: string[];
|
|
89
|
+
channel_ids: string[];
|
|
90
|
+
invite_type: 'restricted' | 'ultra_restricted' | 'full_member';
|
|
91
|
+
real_name: string;
|
|
92
|
+
date_expire: number;
|
|
93
|
+
request_reason: string;
|
|
94
|
+
team: {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
domain: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export interface MemberJoinedChannelEvent {
|
|
102
|
+
type: 'member_joined_channel';
|
|
103
|
+
user: string;
|
|
104
|
+
channel: string;
|
|
105
|
+
channel_type: string;
|
|
106
|
+
team: string;
|
|
107
|
+
inviter?: string;
|
|
108
|
+
event_ts: string;
|
|
109
|
+
}
|
|
110
|
+
export interface MemberLeftChannelEvent {
|
|
111
|
+
type: 'member_left_channel';
|
|
112
|
+
user: string;
|
|
113
|
+
channel: string;
|
|
114
|
+
channel_type: string;
|
|
115
|
+
team: string;
|
|
116
|
+
event_ts: string;
|
|
117
|
+
}
|
|
118
|
+
export type MessageEvent = AllMessageEvents;
|
|
119
|
+
export interface ReactionMessageItem {
|
|
120
|
+
type: 'message';
|
|
121
|
+
channel: string;
|
|
122
|
+
ts: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ReactionAddedEvent {
|
|
125
|
+
type: 'reaction_added';
|
|
126
|
+
user: string;
|
|
127
|
+
reaction: string;
|
|
128
|
+
item_user: string;
|
|
129
|
+
item: ReactionMessageItem;
|
|
130
|
+
event_ts: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ReactionRemovedEvent {
|
|
133
|
+
type: 'reaction_removed';
|
|
134
|
+
user: string;
|
|
135
|
+
reaction: string;
|
|
136
|
+
item_user: string;
|
|
137
|
+
item: ReactionMessageItem;
|
|
138
|
+
event_ts: string;
|
|
139
|
+
}
|
|
140
|
+
export interface StatusEmojiDisplayInfo {
|
|
141
|
+
emoji_name?: string;
|
|
142
|
+
display_alias?: string;
|
|
143
|
+
display_url?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface UserChangeEvent {
|
|
146
|
+
type: 'user_change';
|
|
147
|
+
user: SlackUser;
|
|
148
|
+
cache_ts: number;
|
|
149
|
+
event_ts: string;
|
|
150
|
+
}
|
|
151
|
+
export interface UserProfileChangedEvent {
|
|
152
|
+
type: 'user_profile_changed';
|
|
153
|
+
user: {
|
|
154
|
+
id: string;
|
|
155
|
+
team_id: string;
|
|
156
|
+
name: string;
|
|
157
|
+
deleted: boolean;
|
|
158
|
+
color: string;
|
|
159
|
+
real_name: string;
|
|
160
|
+
tz: string;
|
|
161
|
+
tz_label: string;
|
|
162
|
+
tz_offset: number;
|
|
163
|
+
profile: {
|
|
164
|
+
title: string;
|
|
165
|
+
phone: string;
|
|
166
|
+
skype: string;
|
|
167
|
+
real_name: string;
|
|
168
|
+
real_name_normalized: string;
|
|
169
|
+
display_name: string;
|
|
170
|
+
display_name_normalized: string;
|
|
171
|
+
status_text: string;
|
|
172
|
+
status_text_canonical: string;
|
|
173
|
+
status_emoji: string;
|
|
174
|
+
status_emoji_display_info: StatusEmojiDisplayInfo[];
|
|
175
|
+
status_expiration: number;
|
|
176
|
+
avatar_hash: string;
|
|
177
|
+
huddle_state: string;
|
|
178
|
+
huddle_state_expiration_ts: number;
|
|
179
|
+
first_name: string;
|
|
180
|
+
last_name: string;
|
|
181
|
+
email?: string;
|
|
182
|
+
image_original?: string;
|
|
183
|
+
is_custom_image?: boolean;
|
|
184
|
+
image_24: string;
|
|
185
|
+
image_32: string;
|
|
186
|
+
image_48: string;
|
|
187
|
+
image_72: string;
|
|
188
|
+
image_192: string;
|
|
189
|
+
image_512: string;
|
|
190
|
+
image_1024?: string;
|
|
191
|
+
team: string;
|
|
192
|
+
fields: {
|
|
193
|
+
[key: string]: {
|
|
194
|
+
value: string;
|
|
195
|
+
alt: string;
|
|
196
|
+
};
|
|
197
|
+
} | [] | null;
|
|
198
|
+
};
|
|
199
|
+
is_admin: boolean;
|
|
200
|
+
is_owner: boolean;
|
|
201
|
+
is_primary_owner: boolean;
|
|
202
|
+
is_restricted: boolean;
|
|
203
|
+
is_ultra_restricted: boolean;
|
|
204
|
+
is_bot: boolean;
|
|
205
|
+
is_stranger?: boolean;
|
|
206
|
+
updated: number;
|
|
207
|
+
is_email_confirmed: boolean;
|
|
208
|
+
is_app_user: boolean;
|
|
209
|
+
is_invited_user?: boolean;
|
|
210
|
+
has_2fa?: boolean;
|
|
211
|
+
locale: string;
|
|
212
|
+
presence?: string;
|
|
213
|
+
enterprise_user?: {
|
|
214
|
+
id: string;
|
|
215
|
+
enterprise_id: string;
|
|
216
|
+
enterprise_name: string;
|
|
217
|
+
is_admin: boolean;
|
|
218
|
+
is_owner: boolean;
|
|
219
|
+
teams: string[];
|
|
220
|
+
};
|
|
221
|
+
two_factor_type?: string;
|
|
222
|
+
has_files?: boolean;
|
|
223
|
+
is_workflow_bot?: boolean;
|
|
224
|
+
who_can_share_contact_card: string;
|
|
225
|
+
};
|
|
226
|
+
cache_ts: number;
|
|
227
|
+
event_ts: string;
|
|
228
|
+
}
|
|
229
|
+
export interface UserStatusChangedEvent {
|
|
230
|
+
type: 'user_status_changed';
|
|
231
|
+
user: SlackUser;
|
|
232
|
+
cache_ts: number;
|
|
233
|
+
event_ts: string;
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=base-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-events.d.ts","sourceRoot":"","sources":["../../../../src/types/events/base-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAE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AE,OAAO,CAAA;YACjB,KAAK,EAAE,MAAM,EAAE,CAAA;SAChB,CAAA;QACD,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,eAAe,CAAC,EAAE,OAAO,CAAA;QACzB,0BAA0B,EAAE,MAAM,CAAA;KACnC,CAAA;IACD,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-events.js","sourceRoot":"","sources":["../../../../src/types/events/base-events.ts"],"names":[],"mappings":"AAAA,gFAAgF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { BasicSlackEvent, SlackEvent, UserProfileChangedEvent } from './base-events.ts';
|
|
2
|
+
import { Block } from '@slack/types';
|
|
3
|
+
export type StringIndexed = Record<string, any>;
|
|
4
|
+
export * from './base-events.ts';
|
|
5
|
+
export { GenericMessageEvent, BotMessageEvent, ChannelJoinMessageEvent, ChannelLeaveMessageEvent, ChannelNameMessageEvent, FileShareMessageEvent, MeMessageEvent, MessageChangedEvent, MessageDeletedEvent, File, } from './message-events.ts';
|
|
6
|
+
export type SocketEvent = HelloEvent | EventsApiEvent | UrlVerificationEvent | EnvelopedEvent;
|
|
7
|
+
export interface HelloEvent {
|
|
8
|
+
type: 'hello';
|
|
9
|
+
}
|
|
10
|
+
export interface EventsApiEvent {
|
|
11
|
+
type: 'events_api';
|
|
12
|
+
envelope_id: string;
|
|
13
|
+
payload: EnvelopedEvent;
|
|
14
|
+
}
|
|
15
|
+
export interface UrlVerificationEvent {
|
|
16
|
+
type: 'url_verification';
|
|
17
|
+
token: string;
|
|
18
|
+
challenge: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A Slack Events API event wrapped in the standard envelope.
|
|
22
|
+
*
|
|
23
|
+
* This describes the entire JSON-encoded body of a request from Slack's Events API.
|
|
24
|
+
*/
|
|
25
|
+
export interface EnvelopedEvent<Event extends BasicSlackEvent = SlackEvent> extends StringIndexed {
|
|
26
|
+
token: string;
|
|
27
|
+
team_id: string;
|
|
28
|
+
enterprise_id?: string;
|
|
29
|
+
api_app_id: string;
|
|
30
|
+
event: Event;
|
|
31
|
+
type: 'event_callback';
|
|
32
|
+
event_id: string;
|
|
33
|
+
event_time: number;
|
|
34
|
+
authed_users?: string[];
|
|
35
|
+
authed_teams?: string[];
|
|
36
|
+
is_ext_shared_channel?: boolean;
|
|
37
|
+
authorizations?: Authorization[];
|
|
38
|
+
}
|
|
39
|
+
interface Authorization {
|
|
40
|
+
enterprise_id: string | null;
|
|
41
|
+
team_id: string | null;
|
|
42
|
+
user_id: string;
|
|
43
|
+
is_bot: boolean;
|
|
44
|
+
is_enterprise_install?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface RichTextBlock extends Block {
|
|
47
|
+
type: 'rich_text';
|
|
48
|
+
elements: RichTextElement[];
|
|
49
|
+
}
|
|
50
|
+
/** https://api.slack.com/changelog/2019-09-what-they-see-is-what-you-get-and-more-and-less#the_riches */
|
|
51
|
+
export type RichTextElement = RichTextElement.TextSection | RichTextElement.TextList;
|
|
52
|
+
export type RichText = RichText.User | RichText.Text | RichText.Emoji | RichText.Link | RichText.Broadcast;
|
|
53
|
+
export declare namespace RichTextElement {
|
|
54
|
+
interface TextSection {
|
|
55
|
+
type: 'rich_text_section';
|
|
56
|
+
elements: RichText[];
|
|
57
|
+
}
|
|
58
|
+
interface TextList {
|
|
59
|
+
type: 'rich_text_list';
|
|
60
|
+
style: 'bullet' | 'ordered';
|
|
61
|
+
indent: number;
|
|
62
|
+
border: 0;
|
|
63
|
+
elements: TextSection[];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export declare namespace RichText {
|
|
67
|
+
interface User {
|
|
68
|
+
type: 'user';
|
|
69
|
+
user_id: string;
|
|
70
|
+
}
|
|
71
|
+
interface Text {
|
|
72
|
+
text: string;
|
|
73
|
+
type: 'text';
|
|
74
|
+
style?: {
|
|
75
|
+
bold?: boolean;
|
|
76
|
+
italic?: boolean;
|
|
77
|
+
strike?: boolean;
|
|
78
|
+
code?: boolean;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
interface Emoji {
|
|
82
|
+
type: 'emoji';
|
|
83
|
+
unicode: string;
|
|
84
|
+
name: string;
|
|
85
|
+
}
|
|
86
|
+
interface Link {
|
|
87
|
+
url: string;
|
|
88
|
+
type: 'link';
|
|
89
|
+
text: string;
|
|
90
|
+
}
|
|
91
|
+
interface Broadcast {
|
|
92
|
+
type: 'broadcast';
|
|
93
|
+
range: 'here' | 'channel' | 'everyone';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export type SlackUser = UserProfileChangedEvent['user'];
|
|
97
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/events/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAE/C,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,IAAI,GACL,MAAM,qBAAqB,CAAA;AAE5B,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,oB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AS,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/events/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAO1E,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { Block, KnownBlock, MessageAttachment } from '@slack/types';
|
|
2
|
+
export type MessageEvent = BotMessageEvent | ChannelJoinMessageEvent | ChannelLeaveMessageEvent | ChannelNameMessageEvent | FileShareMessageEvent | MeMessageEvent | MessageChangedEvent | MessageDeletedEvent;
|
|
3
|
+
export interface GenericMessageEvent {
|
|
4
|
+
type: 'message';
|
|
5
|
+
subtype: undefined;
|
|
6
|
+
event_ts: string;
|
|
7
|
+
team?: string;
|
|
8
|
+
channel: string;
|
|
9
|
+
user: string;
|
|
10
|
+
bot_id?: string;
|
|
11
|
+
app_id?: string;
|
|
12
|
+
username?: string;
|
|
13
|
+
bot_profile?: BotProfile;
|
|
14
|
+
text?: string;
|
|
15
|
+
ts: string;
|
|
16
|
+
thread_ts?: string;
|
|
17
|
+
channel_type: channelTypes;
|
|
18
|
+
attachments?: MessageAttachment[];
|
|
19
|
+
blocks?: (KnownBlock | Block)[];
|
|
20
|
+
files?: File[];
|
|
21
|
+
edited?: {
|
|
22
|
+
user: string;
|
|
23
|
+
ts: string;
|
|
24
|
+
};
|
|
25
|
+
client_msg_id?: string;
|
|
26
|
+
parent_user_id?: string;
|
|
27
|
+
is_starred?: boolean;
|
|
28
|
+
pinned_to?: string[];
|
|
29
|
+
reactions?: {
|
|
30
|
+
name: string;
|
|
31
|
+
count: number;
|
|
32
|
+
users: string[];
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
export interface BotMessageEvent {
|
|
36
|
+
type: 'message';
|
|
37
|
+
subtype: 'bot_message';
|
|
38
|
+
event_ts: string;
|
|
39
|
+
channel: string;
|
|
40
|
+
channel_type: channelTypes;
|
|
41
|
+
ts: string;
|
|
42
|
+
text: string;
|
|
43
|
+
bot_id: string;
|
|
44
|
+
username?: string;
|
|
45
|
+
icons?: {
|
|
46
|
+
[size: string]: string;
|
|
47
|
+
};
|
|
48
|
+
user?: string;
|
|
49
|
+
attachments?: MessageAttachment[];
|
|
50
|
+
blocks?: (KnownBlock | Block)[];
|
|
51
|
+
edited?: {
|
|
52
|
+
user: string;
|
|
53
|
+
ts: string;
|
|
54
|
+
};
|
|
55
|
+
thread_ts?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ChannelJoinMessageEvent {
|
|
58
|
+
type: 'message';
|
|
59
|
+
subtype: 'channel_join';
|
|
60
|
+
team: string;
|
|
61
|
+
user: string;
|
|
62
|
+
inviter: string;
|
|
63
|
+
channel: string;
|
|
64
|
+
channel_type: channelTypes;
|
|
65
|
+
text: string;
|
|
66
|
+
ts: string;
|
|
67
|
+
event_ts: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ChannelLeaveMessageEvent {
|
|
70
|
+
type: 'message';
|
|
71
|
+
subtype: 'channel_leave';
|
|
72
|
+
team: string;
|
|
73
|
+
user: string;
|
|
74
|
+
channel: string;
|
|
75
|
+
channel_type: channelTypes;
|
|
76
|
+
text: string;
|
|
77
|
+
ts: string;
|
|
78
|
+
event_ts: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ChannelNameMessageEvent {
|
|
81
|
+
type: 'message';
|
|
82
|
+
subtype: 'channel_name';
|
|
83
|
+
team: string;
|
|
84
|
+
user: string;
|
|
85
|
+
name: string;
|
|
86
|
+
old_name: string;
|
|
87
|
+
channel: string;
|
|
88
|
+
channel_type: channelTypes;
|
|
89
|
+
text: string;
|
|
90
|
+
ts: string;
|
|
91
|
+
event_ts: string;
|
|
92
|
+
}
|
|
93
|
+
export interface FileShareMessageEvent {
|
|
94
|
+
type: 'message';
|
|
95
|
+
subtype: 'file_share';
|
|
96
|
+
text: string;
|
|
97
|
+
attachments?: MessageAttachment[];
|
|
98
|
+
blocks?: (KnownBlock | Block)[];
|
|
99
|
+
files?: File[];
|
|
100
|
+
upload?: boolean;
|
|
101
|
+
display_as_bot?: boolean;
|
|
102
|
+
x_files?: string[];
|
|
103
|
+
user: string;
|
|
104
|
+
parent_user_id?: string;
|
|
105
|
+
ts: string;
|
|
106
|
+
thread_ts?: string;
|
|
107
|
+
channel: string;
|
|
108
|
+
channel_type: channelTypes;
|
|
109
|
+
event_ts: string;
|
|
110
|
+
}
|
|
111
|
+
export interface MeMessageEvent {
|
|
112
|
+
type: 'message';
|
|
113
|
+
subtype: 'me_message';
|
|
114
|
+
event_ts: string;
|
|
115
|
+
channel: string;
|
|
116
|
+
channel_type: channelTypes;
|
|
117
|
+
user: string;
|
|
118
|
+
text: string;
|
|
119
|
+
ts: string;
|
|
120
|
+
}
|
|
121
|
+
export interface MessageChangedEvent {
|
|
122
|
+
type: 'message';
|
|
123
|
+
subtype: 'message_changed';
|
|
124
|
+
event_ts: string;
|
|
125
|
+
hidden: true;
|
|
126
|
+
channel: string;
|
|
127
|
+
channel_type: channelTypes;
|
|
128
|
+
ts: string;
|
|
129
|
+
message: GenericMessageEvent;
|
|
130
|
+
previous_message: GenericMessageEvent;
|
|
131
|
+
}
|
|
132
|
+
export interface MessageDeletedEvent {
|
|
133
|
+
type: 'message';
|
|
134
|
+
subtype: 'message_deleted';
|
|
135
|
+
event_ts: string;
|
|
136
|
+
hidden: true;
|
|
137
|
+
channel: string;
|
|
138
|
+
channel_type: channelTypes;
|
|
139
|
+
ts: string;
|
|
140
|
+
deleted_ts: string;
|
|
141
|
+
previous_message: GenericMessageEvent;
|
|
142
|
+
}
|
|
143
|
+
export type channelTypes = 'channel' | 'group' | 'im' | 'mpim' | 'app_home';
|
|
144
|
+
interface BotProfile {
|
|
145
|
+
id: string;
|
|
146
|
+
name: string;
|
|
147
|
+
app_id: string;
|
|
148
|
+
team_id: string;
|
|
149
|
+
icons: {
|
|
150
|
+
[size: string]: string;
|
|
151
|
+
};
|
|
152
|
+
updated: number;
|
|
153
|
+
deleted: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface File {
|
|
156
|
+
id: string;
|
|
157
|
+
created: number;
|
|
158
|
+
name: string | null;
|
|
159
|
+
title: string | null;
|
|
160
|
+
mimetype: string;
|
|
161
|
+
filetype: string;
|
|
162
|
+
pretty_type: string;
|
|
163
|
+
user?: string;
|
|
164
|
+
editable: boolean;
|
|
165
|
+
size: number;
|
|
166
|
+
mode: 'hosted' | 'external' | 'snippet' | 'post';
|
|
167
|
+
is_external: boolean;
|
|
168
|
+
external_type: string | null;
|
|
169
|
+
is_public: boolean;
|
|
170
|
+
public_url_shared: boolean;
|
|
171
|
+
display_as_bot: boolean;
|
|
172
|
+
username: string | null;
|
|
173
|
+
url_private?: string;
|
|
174
|
+
url_private_download?: string;
|
|
175
|
+
thumb_64?: string;
|
|
176
|
+
thumb_80?: string;
|
|
177
|
+
thumb_160?: string;
|
|
178
|
+
thumb_360?: string;
|
|
179
|
+
thumb_360_w?: number;
|
|
180
|
+
thumb_360_h?: number;
|
|
181
|
+
thumb_360_gif?: string;
|
|
182
|
+
thumb_480?: string;
|
|
183
|
+
thumb_720?: string;
|
|
184
|
+
thumb_960?: string;
|
|
185
|
+
thumb_1024?: string;
|
|
186
|
+
permalink: string;
|
|
187
|
+
permalink_public?: string;
|
|
188
|
+
edit_link?: string;
|
|
189
|
+
image_exif_rotation?: number;
|
|
190
|
+
original_w?: number;
|
|
191
|
+
original_h?: number;
|
|
192
|
+
deanimate_gif?: string;
|
|
193
|
+
preview?: string;
|
|
194
|
+
preview_highlight?: string;
|
|
195
|
+
lines?: string;
|
|
196
|
+
lines_more?: string;
|
|
197
|
+
preview_is_truncated?: boolean;
|
|
198
|
+
has_rich_preview?: boolean;
|
|
199
|
+
shares?: {
|
|
200
|
+
[key: string]: any;
|
|
201
|
+
};
|
|
202
|
+
channels: string[] | null;
|
|
203
|
+
groups: string[] | null;
|
|
204
|
+
users?: string[];
|
|
205
|
+
pinned_to?: string[];
|
|
206
|
+
reactions?: {
|
|
207
|
+
[key: string]: any;
|
|
208
|
+
}[];
|
|
209
|
+
is_starred?: boolean;
|
|
210
|
+
num_stars?: number;
|
|
211
|
+
initial_comment?: string;
|
|
212
|
+
comments_count?: string;
|
|
213
|
+
}
|
|
214
|
+
export {};
|
|
215
|
+
//# sourceMappingURL=message-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-events.d.ts","sourceRoot":"","sources":["../../../../src/types/events/message-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEnE,MAAM,MAAM,YAAY,GAEpB,eAAe,GACf,uBAAuB,GACvB,wBAAwB,GACxB,uBAAuB,GACvB,qBAAqB,GACrB,cAAc,GACd,mBAAmB,GACnB,mBAAmB,CAAA;AAEvB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAA;IACf,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,UAAU,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,YAAY,CAAA;IAC1B,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACjC,MAAM,CAAC,EAAE,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,CAAA;IAC/B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IACd,MAAM,CAAC,EAAE;QACP,IAAI,E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AAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IAGtB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B,MAAM,CAAC,EAAE;QAEP,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACnB,CAAA;IACD,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACzB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,CAAC,EAAE;QAEV,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACnB,EAAE,CAAA;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-events.js","sourceRoot":"","sources":["../../../../src/types/events/message-events.ts"],"names":[],"mappings":"AAAA,mFAAmF"}
|