@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,189 @@
|
|
|
1
|
+
import { Definitions } from './definition.ts';
|
|
2
|
+
export declare namespace Files {
|
|
3
|
+
namespace Params {
|
|
4
|
+
interface CommentsDelete {
|
|
5
|
+
file?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
interface Delete {
|
|
9
|
+
file?: string;
|
|
10
|
+
}
|
|
11
|
+
interface Info {
|
|
12
|
+
file?: string;
|
|
13
|
+
count?: string;
|
|
14
|
+
page?: string;
|
|
15
|
+
limit?: number;
|
|
16
|
+
cursor?: string;
|
|
17
|
+
}
|
|
18
|
+
interface List {
|
|
19
|
+
user?: string;
|
|
20
|
+
channel?: string;
|
|
21
|
+
ts_from?: number;
|
|
22
|
+
ts_to?: number;
|
|
23
|
+
types?: string;
|
|
24
|
+
count?: string;
|
|
25
|
+
page?: string;
|
|
26
|
+
show_files_hidden_by_limit?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface RemoteAdd {
|
|
29
|
+
external_id?: string;
|
|
30
|
+
title?: string;
|
|
31
|
+
filetype?: string;
|
|
32
|
+
external_url?: string;
|
|
33
|
+
preview_image?: string;
|
|
34
|
+
indexable_file_contents?: string;
|
|
35
|
+
}
|
|
36
|
+
interface RemoteInfo {
|
|
37
|
+
file?: string;
|
|
38
|
+
external_id?: string;
|
|
39
|
+
}
|
|
40
|
+
interface RemoteList {
|
|
41
|
+
channel?: string;
|
|
42
|
+
ts_from?: number;
|
|
43
|
+
ts_to?: number;
|
|
44
|
+
limit?: number;
|
|
45
|
+
cursor?: string;
|
|
46
|
+
}
|
|
47
|
+
interface RemoteRemove {
|
|
48
|
+
file?: string;
|
|
49
|
+
external_id?: string;
|
|
50
|
+
}
|
|
51
|
+
interface RemoteShare {
|
|
52
|
+
file?: string;
|
|
53
|
+
external_id?: string;
|
|
54
|
+
channels?: string;
|
|
55
|
+
}
|
|
56
|
+
interface RemoteUpdate {
|
|
57
|
+
file?: string;
|
|
58
|
+
external_id?: string;
|
|
59
|
+
title?: string;
|
|
60
|
+
filetype?: string;
|
|
61
|
+
external_url?: string;
|
|
62
|
+
preview_image?: string;
|
|
63
|
+
indexable_file_contents?: string;
|
|
64
|
+
}
|
|
65
|
+
interface RevokePublicURL {
|
|
66
|
+
file?: string;
|
|
67
|
+
}
|
|
68
|
+
interface SharedPublicURL {
|
|
69
|
+
file?: string;
|
|
70
|
+
}
|
|
71
|
+
interface Upload {
|
|
72
|
+
file?: string;
|
|
73
|
+
content?: string;
|
|
74
|
+
filetype?: string;
|
|
75
|
+
filename?: string;
|
|
76
|
+
title?: string;
|
|
77
|
+
initial_comment?: string;
|
|
78
|
+
channels?: string;
|
|
79
|
+
thread_ts?: number;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
declare module './internal' {
|
|
84
|
+
interface Internal {
|
|
85
|
+
/**
|
|
86
|
+
* Deletes an existing comment on a file.
|
|
87
|
+
* @see https://api.slack.com/methods/files.comments.delete
|
|
88
|
+
*/
|
|
89
|
+
filesCommentsDelete(token: TokenInput, params: Files.Params.CommentsDelete): Promise<{
|
|
90
|
+
ok: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* Deletes a file.
|
|
94
|
+
* @see https://api.slack.com/methods/files.delete
|
|
95
|
+
*/
|
|
96
|
+
filesDelete(token: TokenInput, params: Files.Params.Delete): Promise<{
|
|
97
|
+
ok: boolean;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Gets information about a file.
|
|
101
|
+
* @see https://api.slack.com/methods/files.info
|
|
102
|
+
*/
|
|
103
|
+
filesInfo(token: TokenInput, params: Files.Params.Info): Promise<{
|
|
104
|
+
comments: Definitions.Comments;
|
|
105
|
+
content_html?: unknown;
|
|
106
|
+
editor?: string;
|
|
107
|
+
file: Definitions.File;
|
|
108
|
+
ok: boolean;
|
|
109
|
+
paging?: Definitions.Paging;
|
|
110
|
+
response_metadata?: Definitions.ResponseMetadata;
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* List for a team, in a channel, or from a user with applied filters.
|
|
114
|
+
* @see https://api.slack.com/methods/files.list
|
|
115
|
+
*/
|
|
116
|
+
filesList(token: TokenInput, params: Files.Params.List): Promise<{
|
|
117
|
+
files: Definitions.File[];
|
|
118
|
+
ok: boolean;
|
|
119
|
+
paging: Definitions.Paging;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Adds a file from a remote service
|
|
123
|
+
* @see https://api.slack.com/methods/files.remote.add
|
|
124
|
+
*/
|
|
125
|
+
filesRemoteAdd(token: TokenInput, params: Files.Params.RemoteAdd): Promise<{
|
|
126
|
+
ok: boolean;
|
|
127
|
+
}>;
|
|
128
|
+
/**
|
|
129
|
+
* Retrieve information about a remote file added to Slack
|
|
130
|
+
* @see https://api.slack.com/methods/files.remote.info
|
|
131
|
+
*/
|
|
132
|
+
filesRemoteInfo(token: TokenInput, params: Files.Params.RemoteInfo): Promise<{
|
|
133
|
+
ok: boolean;
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Retrieve information about a remote file added to Slack
|
|
137
|
+
* @see https://api.slack.com/methods/files.remote.list
|
|
138
|
+
*/
|
|
139
|
+
filesRemoteList(token: TokenInput, params: Files.Params.RemoteList): Promise<{
|
|
140
|
+
ok: boolean;
|
|
141
|
+
}>;
|
|
142
|
+
/**
|
|
143
|
+
* Remove a remote file.
|
|
144
|
+
* @see https://api.slack.com/methods/files.remote.remove
|
|
145
|
+
*/
|
|
146
|
+
filesRemoteRemove(token: TokenInput, params: Files.Params.RemoteRemove): Promise<{
|
|
147
|
+
ok: boolean;
|
|
148
|
+
}>;
|
|
149
|
+
/**
|
|
150
|
+
* Share a remote file into a channel.
|
|
151
|
+
* @see https://api.slack.com/methods/files.remote.share
|
|
152
|
+
*/
|
|
153
|
+
filesRemoteShare(token: TokenInput, params: Files.Params.RemoteShare): Promise<{
|
|
154
|
+
ok: boolean;
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* Updates an existing remote file.
|
|
158
|
+
* @see https://api.slack.com/methods/files.remote.update
|
|
159
|
+
*/
|
|
160
|
+
filesRemoteUpdate(token: TokenInput, params: Files.Params.RemoteUpdate): Promise<{
|
|
161
|
+
ok: boolean;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Revokes public/external sharing access for a file
|
|
165
|
+
* @see https://api.slack.com/methods/files.revokePublicURL
|
|
166
|
+
*/
|
|
167
|
+
filesRevokePublicURL(token: TokenInput, params: Files.Params.RevokePublicURL): Promise<{
|
|
168
|
+
file: Definitions.File;
|
|
169
|
+
ok: boolean;
|
|
170
|
+
}>;
|
|
171
|
+
/**
|
|
172
|
+
* Enables a file for public/external sharing.
|
|
173
|
+
* @see https://api.slack.com/methods/files.sharedPublicURL
|
|
174
|
+
*/
|
|
175
|
+
filesSharedPublicURL(token: TokenInput, params: Files.Params.SharedPublicURL): Promise<{
|
|
176
|
+
file: Definitions.File;
|
|
177
|
+
ok: boolean;
|
|
178
|
+
}>;
|
|
179
|
+
/**
|
|
180
|
+
* Uploads or creates a file.
|
|
181
|
+
* @see https://api.slack.com/methods/files.upload
|
|
182
|
+
*/
|
|
183
|
+
filesUpload(token: TokenInput, params: Files.Params.Upload): Promise<{
|
|
184
|
+
file: Definitions.File;
|
|
185
|
+
ok: boolean;
|
|
186
|
+
}>;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/types/files.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AA2C7C,yBAAiB,KAAK,CAAC;IACrB,UAAiB,MAAM,CAAC;QACtB,UAAiB,cAAc;YAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;YACb,EAAE,CAAC,EAAE,MAAM,CAAA;SACZ;QACD,UAAiB,MAAM;YACrB,IAAI,CAAC,EAAE,MAAM,CAAA;SACd;QACD,UAAiB,IAAI;YACnB,IAAI,CAAC,EAAE,MAAM,CAAA;YACb,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,IAAI,CAAC,EAAE,MAAM,CAAA;YACb,KAAK,CAAC,EAAE,MAAM,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EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;QAEF;;;WAGG;QACH,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/E,EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;QAEF;;;WAGG;QACH,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,GAAG,OAAO,CAAC;YACrF,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;YACtB,EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;QAEF;;;WAGG;QACH,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,GAAG,OAAO,CAAC;YACrF,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;YACtB,EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;QAEF;;;WAGG;QACH,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC;YACnE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAA;YACtB,EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;KACH;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Internal } from "./internal.js";
|
|
2
|
+
Internal.define({
|
|
3
|
+
'/files.comments.delete': {
|
|
4
|
+
POST: { 'filesCommentsDelete': true },
|
|
5
|
+
},
|
|
6
|
+
'/files.delete': {
|
|
7
|
+
POST: { 'filesDelete': true },
|
|
8
|
+
},
|
|
9
|
+
'/files.info': {
|
|
10
|
+
GET: { 'filesInfo': false },
|
|
11
|
+
},
|
|
12
|
+
'/files.list': {
|
|
13
|
+
GET: { 'filesList': false },
|
|
14
|
+
},
|
|
15
|
+
'/files.remote.add': {
|
|
16
|
+
POST: { 'filesRemoteAdd': false },
|
|
17
|
+
},
|
|
18
|
+
'/files.remote.info': {
|
|
19
|
+
GET: { 'filesRemoteInfo': false },
|
|
20
|
+
},
|
|
21
|
+
'/files.remote.list': {
|
|
22
|
+
GET: { 'filesRemoteList': false },
|
|
23
|
+
},
|
|
24
|
+
'/files.remote.remove': {
|
|
25
|
+
POST: { 'filesRemoteRemove': false },
|
|
26
|
+
},
|
|
27
|
+
'/files.remote.share': {
|
|
28
|
+
GET: { 'filesRemoteShare': false },
|
|
29
|
+
},
|
|
30
|
+
'/files.remote.update': {
|
|
31
|
+
POST: { 'filesRemoteUpdate': false },
|
|
32
|
+
},
|
|
33
|
+
'/files.revokePublicURL': {
|
|
34
|
+
POST: { 'filesRevokePublicURL': true },
|
|
35
|
+
},
|
|
36
|
+
'/files.sharedPublicURL': {
|
|
37
|
+
POST: { 'filesSharedPublicURL': true },
|
|
38
|
+
},
|
|
39
|
+
'/files.upload': {
|
|
40
|
+
POST: { 'filesUpload': false },
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/types/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,QAAQ,CAAC,MAAM,CAAC;IACd,wBAAwB,EAAE;QACxB,IAAI,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE;KACtC;IACD,eAAe,EAAE;QACf,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE;KAC9B;IACD,aAAa,EAAE;QACb,GAAG,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;KAC5B;IACD,aAAa,EAAE;QACb,GAAG,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;KAC5B;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE;KAClC;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE;KAClC;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE;KAClC;IACD,sBAAsB,EAAE;QACtB,IAAI,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE;KACrC;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE;KACnC;IACD,sBAAsB,EAAE;QACtB,IAAI,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE;KACrC;IACD,wBAAwB,EAAE;QACxB,IAAI,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE;KACvC;IACD,wBAAwB,EAAE;QACxB,IAAI,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE;KACvC;IACD,eAAe,EAAE;QACf,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;KAC/B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export interface SlackChannel {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
is_channel: boolean;
|
|
5
|
+
is_group: boolean;
|
|
6
|
+
is_im: boolean;
|
|
7
|
+
created: number;
|
|
8
|
+
creator: string;
|
|
9
|
+
is_archived: boolean;
|
|
10
|
+
is_general: boolean;
|
|
11
|
+
unlinked: number;
|
|
12
|
+
name_normalized: string;
|
|
13
|
+
is_read_only: boolean;
|
|
14
|
+
is_shared: boolean;
|
|
15
|
+
parent_conversation: null;
|
|
16
|
+
is_ext_shared: boolean;
|
|
17
|
+
is_org_shared: boolean;
|
|
18
|
+
pending_shared: any[];
|
|
19
|
+
is_pending_ext_shared: boolean;
|
|
20
|
+
is_member: boolean;
|
|
21
|
+
is_private: boolean;
|
|
22
|
+
is_mpim: boolean;
|
|
23
|
+
last_read: string;
|
|
24
|
+
topic: {
|
|
25
|
+
value: string;
|
|
26
|
+
creator: string;
|
|
27
|
+
last_set: number;
|
|
28
|
+
};
|
|
29
|
+
purpose: {
|
|
30
|
+
value: string;
|
|
31
|
+
creator: string;
|
|
32
|
+
last_set: number;
|
|
33
|
+
};
|
|
34
|
+
previous_names: string[];
|
|
35
|
+
locale: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SlackTeam {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
domain: string;
|
|
41
|
+
email_domain: string;
|
|
42
|
+
icon: {
|
|
43
|
+
image_34: string;
|
|
44
|
+
image_44: string;
|
|
45
|
+
image_68: string;
|
|
46
|
+
image_88: string;
|
|
47
|
+
image_102: string;
|
|
48
|
+
image_132: string;
|
|
49
|
+
image_default: boolean;
|
|
50
|
+
};
|
|
51
|
+
enterprise_id: string;
|
|
52
|
+
enterprise_name: string;
|
|
53
|
+
}
|
|
54
|
+
export * from './events/index.ts';
|
|
55
|
+
export * from './internal.ts';
|
|
56
|
+
export * from './definition.ts';
|
|
57
|
+
export * from './admin.ts';
|
|
58
|
+
export * from './api.ts';
|
|
59
|
+
export * from './apps.ts';
|
|
60
|
+
export * from './auth.ts';
|
|
61
|
+
export * from './bots.ts';
|
|
62
|
+
export * from './calls.ts';
|
|
63
|
+
export * from './chat.ts';
|
|
64
|
+
export * from './conversations.ts';
|
|
65
|
+
export * from './dialog.ts';
|
|
66
|
+
export * from './dnd.ts';
|
|
67
|
+
export * from './emoji.ts';
|
|
68
|
+
export * from './files.ts';
|
|
69
|
+
export * from './migration.ts';
|
|
70
|
+
export * from './oauth.ts';
|
|
71
|
+
export * from './pins.ts';
|
|
72
|
+
export * from './reactions.ts';
|
|
73
|
+
export * from './reminders.ts';
|
|
74
|
+
export * from './rtm.ts';
|
|
75
|
+
export * from './search.ts';
|
|
76
|
+
export * from './stars.ts';
|
|
77
|
+
export * from './team.ts';
|
|
78
|
+
export * from './usergroups.ts';
|
|
79
|
+
export * from './users.ts';
|
|
80
|
+
export * from './views.ts';
|
|
81
|
+
export * from './workflows.ts';
|
|
82
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,mBAAmB,EAAE,IAAI,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,aAAa,EAAE,OAAO,CAAA;IACtB,cAAc,EAAE,GAAG,EAAE,CAAA;IACrB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,aAAa,EAAE,OAAO,CAAA;KACvB,CAAA;IACD,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAE/B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./events/index.js";
|
|
2
|
+
export * from "./internal.js";
|
|
3
|
+
export * from "./definition.js";
|
|
4
|
+
export * from "./admin.js";
|
|
5
|
+
export * from "./api.js";
|
|
6
|
+
export * from "./apps.js";
|
|
7
|
+
export * from "./auth.js";
|
|
8
|
+
export * from "./bots.js";
|
|
9
|
+
export * from "./calls.js";
|
|
10
|
+
export * from "./chat.js";
|
|
11
|
+
export * from "./conversations.js";
|
|
12
|
+
export * from "./dialog.js";
|
|
13
|
+
export * from "./dnd.js";
|
|
14
|
+
export * from "./emoji.js";
|
|
15
|
+
export * from "./files.js";
|
|
16
|
+
export * from "./migration.js";
|
|
17
|
+
export * from "./oauth.js";
|
|
18
|
+
export * from "./pins.js";
|
|
19
|
+
export * from "./reactions.js";
|
|
20
|
+
export * from "./reminders.js";
|
|
21
|
+
export * from "./rtm.js";
|
|
22
|
+
export * from "./search.js";
|
|
23
|
+
export * from "./stars.js";
|
|
24
|
+
export * from "./team.js";
|
|
25
|
+
export * from "./usergroups.js";
|
|
26
|
+
export * from "./users.js";
|
|
27
|
+
export * from "./views.js";
|
|
28
|
+
export * from "./workflows.js";
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAuDA,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAE/B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Dict } from '@deepseek-ai/cordis-plugin-im-core';
|
|
2
|
+
import type { Http as HTTP } from '@deepseek-ai/cordis-plugin-http';
|
|
3
|
+
import type { SlackBot } from '../bot.ts';
|
|
4
|
+
type SupportPostJSON = boolean;
|
|
5
|
+
export declare enum Token {
|
|
6
|
+
BOT = 0,
|
|
7
|
+
APP = 1
|
|
8
|
+
}
|
|
9
|
+
export type TokenInput = string | Token;
|
|
10
|
+
export declare class Internal {
|
|
11
|
+
private bot;
|
|
12
|
+
private http;
|
|
13
|
+
constructor(bot: SlackBot, http: HTTP);
|
|
14
|
+
static define(routes: Dict<Partial<Record<string, Record<string, SupportPostJSON>>>>): void;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/types/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAA;AAC9D,OAAO,KAAK,EAAE,IAAI,IAAI,IAAI,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAKzC,KAAK,eAAe,GAAG,OAAO,CAAA;AAE9B,oBAAY,KAAK;IACf,GAAG,IAAI;IACP,GAAG,IAAI;CACR;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAA;AAGvC,qBAAa,QAAQ;IACP,OAAO,CAAC,GAAG;IAAY,OAAO,CAAC,IAAI;gBAA3B,GAAG,EAAE,QAAQ,EAAU,IAAI,EAAE,IAAI;IAGrD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAsCrF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { encodeForm } from "../request.js";
|
|
2
|
+
export var Token;
|
|
3
|
+
(function (Token) {
|
|
4
|
+
Token[Token["BOT"] = 0] = "BOT";
|
|
5
|
+
Token[Token["APP"] = 1] = "APP";
|
|
6
|
+
})(Token || (Token = {}));
|
|
7
|
+
// https://api.slack.com/web#basics
|
|
8
|
+
export class Internal {
|
|
9
|
+
bot;
|
|
10
|
+
http;
|
|
11
|
+
constructor(bot, http) {
|
|
12
|
+
this.bot = bot;
|
|
13
|
+
this.http = http;
|
|
14
|
+
}
|
|
15
|
+
// route: content-type
|
|
16
|
+
static define(routes) {
|
|
17
|
+
for (const path in routes) {
|
|
18
|
+
for (const key in routes[path]) {
|
|
19
|
+
const method = key;
|
|
20
|
+
for (const name of Object.keys(routes[path][method])) {
|
|
21
|
+
Reflect.set(Internal.prototype, name, async function (...args) {
|
|
22
|
+
const headers = {};
|
|
23
|
+
const config = { headers };
|
|
24
|
+
let token = '';
|
|
25
|
+
if (typeof args[0] === 'string') {
|
|
26
|
+
token = args[0];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
token = args[0] === Token.BOT ? this.bot.config.botToken : this.bot.config.token;
|
|
30
|
+
}
|
|
31
|
+
headers.Authorization = `Bearer ${token}`;
|
|
32
|
+
const supportJson = routes[path][method][name];
|
|
33
|
+
if (method === 'GET') {
|
|
34
|
+
config.params = args[1];
|
|
35
|
+
}
|
|
36
|
+
else if (supportJson && !(args[1] instanceof FormData)) {
|
|
37
|
+
headers['content-type'] = 'application/json; charset=utf-8';
|
|
38
|
+
config.data = JSON.stringify(args[1]);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
headers['content-type'] = 'application/x-www-form-urlencoded';
|
|
42
|
+
config.data = args[1] instanceof FormData ? args[1] : encodeForm(args[1] ?? {});
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
// The routes are absolute paths of the Slack API root, which the http service resolves as a base URL.
|
|
46
|
+
const response = await this.http(path.replace(/^\/+/, ''), { ...config, method });
|
|
47
|
+
return await response.json();
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (!this.http.isError(error) || !error.response)
|
|
51
|
+
throw error;
|
|
52
|
+
throw new Error(`[${error.response.status}] ${await error.response.text()}`);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/types/internal.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM1C,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,+BAAO,CAAA;IACP,+BAAO,CAAA;AACT,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAID,mCAAmC;AACnC,MAAM,OAAO,QAAQ;IACC;IAAuB;IAA3C,YAAoB,GAAa,EAAU,IAAU;QAAjC,QAAG,GAAH,GAAG,CAAU;QAAU,SAAI,GAAJ,IAAI,CAAM;IAAI,CAAC;IAE1D,sBAAsB;IACtB,MAAM,CAAC,MAAM,CAAC,MAAsE;QAClF,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAE,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAG,GAAa,CAAA;gBAC5B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CA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IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;wBACjF,CAAC;wBACD,IAAI,CAAC;4BACH,sGAAsG;4BACtG,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;4BACjF,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;wBAC9B,CAAC;wBAAC,OAAO,KAAK,EAAE,CAAC;4BACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ;gCAAE,MAAM,KAAK,CAAA;4BAC7D,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,MAAM,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;wBAC9E,CAAC;oBACH,CAAC,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare namespace Migration {
|
|
2
|
+
namespace Params {
|
|
3
|
+
interface Exchange {
|
|
4
|
+
users: string;
|
|
5
|
+
team_id?: string;
|
|
6
|
+
to_old?: boolean;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
declare module './internal' {
|
|
11
|
+
interface Internal {
|
|
12
|
+
/**
|
|
13
|
+
* For Enterprise Grid workspaces, map local user IDs to global user IDs
|
|
14
|
+
* @see https://api.slack.com/methods/migration.exchange
|
|
15
|
+
*/
|
|
16
|
+
migrationExchange(token: TokenInput, params: Migration.Params.Exchange): Promise<{
|
|
17
|
+
enterprise_id: string;
|
|
18
|
+
invalid_user_ids?: string[];
|
|
19
|
+
ok: boolean;
|
|
20
|
+
team_id: string;
|
|
21
|
+
user_id_map?: {};
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=migration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/types/migration.ts"],"names":[],"mappings":"AAQA,yBAAiB,SAAS,CAAC;IACzB,UAAiB,MAAM,CAAC;QACtB,UAAiB,QAAQ;YACvB,KAAK,EAAE,MAAM,CAAA;YACb,OAAO,CAAC,EAAE,MAAM,CAAA;YAChB,MAAM,CAAC,EAAE,OAAO,CAAA;SACjB;KACF;CACF;AAED,OAAO,QAAQ,YAAY,CAAC;IAC1B,UAAU,QAAQ;QAChB;;;WAGG;QACH,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC/E,aAAa,EAAE,MAAM,CAAA;YACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;YAC3B,EAAE,EAAE,OAAO,CAAA;YACX,OAAO,EAAE,MAAM,CAAA;YACf,WAAW,CAAC,EAAE,EACb,CAAA;SACF,CAAC,CAAA;KACH;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["../../../src/types/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,QAAQ,CAAC,MAAM,CAAC;IACd,qBAAqB,EAAE;QACrB,GAAG,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE;KACpC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare namespace Oauth {
|
|
2
|
+
namespace Params {
|
|
3
|
+
interface Access {
|
|
4
|
+
client_id?: string;
|
|
5
|
+
client_secret?: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
redirect_uri?: string;
|
|
8
|
+
single_channel?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface Token {
|
|
11
|
+
client_id?: string;
|
|
12
|
+
client_secret?: string;
|
|
13
|
+
code?: string;
|
|
14
|
+
redirect_uri?: string;
|
|
15
|
+
single_channel?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface V2Access {
|
|
18
|
+
client_id?: string;
|
|
19
|
+
client_secret?: string;
|
|
20
|
+
code: string;
|
|
21
|
+
redirect_uri?: string;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
declare module './internal' {
|
|
26
|
+
interface Internal {
|
|
27
|
+
/**
|
|
28
|
+
* Exchanges a temporary OAuth verifier code for an access token.
|
|
29
|
+
* @see https://api.slack.com/methods/oauth.access
|
|
30
|
+
*/
|
|
31
|
+
oauthAccess(token: TokenInput, params: Oauth.Params.Access): Promise<{
|
|
32
|
+
ok: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Exchanges a temporary OAuth verifier code for a workspace token.
|
|
36
|
+
* @see https://api.slack.com/methods/oauth.token
|
|
37
|
+
*/
|
|
38
|
+
oauthToken(token: TokenInput, params: Oauth.Params.Token): Promise<{
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Exchanges a temporary OAuth verifier code for an access token.
|
|
43
|
+
* @see https://api.slack.com/methods/oauth.v2.access
|
|
44
|
+
*/
|
|
45
|
+
oauthV2Access(token: TokenInput, params: Oauth.Params.V2Access): Promise<{
|
|
46
|
+
ok: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=oauth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../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,13 @@
|
|
|
1
|
+
import { Internal } from "./internal.js";
|
|
2
|
+
Internal.define({
|
|
3
|
+
'/oauth.access': {
|
|
4
|
+
GET: { 'oauthAccess': false },
|
|
5
|
+
},
|
|
6
|
+
'/oauth.token': {
|
|
7
|
+
GET: { 'oauthToken': false },
|
|
8
|
+
},
|
|
9
|
+
'/oauth.v2.access': {
|
|
10
|
+
GET: { 'oauthV2Access': false },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=oauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/types/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,QAAQ,CAAC,MAAM,CAAC;IACd,eAAe,EAAE;QACf,GAAG,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;KAC9B;IACD,cAAc,EAAE;QACd,GAAG,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE;KAC7B;IACD,kBAAkB,EAAE;QAClB,GAAG,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;KAChC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare namespace Pins {
|
|
2
|
+
namespace Params {
|
|
3
|
+
interface Add {
|
|
4
|
+
channel: string;
|
|
5
|
+
timestamp?: string;
|
|
6
|
+
}
|
|
7
|
+
interface List {
|
|
8
|
+
channel: string;
|
|
9
|
+
}
|
|
10
|
+
interface Remove {
|
|
11
|
+
channel: string;
|
|
12
|
+
timestamp?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare module './internal' {
|
|
17
|
+
interface Internal {
|
|
18
|
+
/**
|
|
19
|
+
* Pins an item to a channel.
|
|
20
|
+
* @see https://api.slack.com/methods/pins.add
|
|
21
|
+
*/
|
|
22
|
+
pinsAdd(token: TokenInput, params: Pins.Params.Add): Promise<{
|
|
23
|
+
ok: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Lists items pinned to a channel.
|
|
27
|
+
* @see https://api.slack.com/methods/pins.list
|
|
28
|
+
*/
|
|
29
|
+
pinsList(token: TokenInput, params: Pins.Params.List): Promise<unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Un-pins an item from a channel.
|
|
32
|
+
* @see https://api.slack.com/methods/pins.remove
|
|
33
|
+
*/
|
|
34
|
+
pinsRemove(token: TokenInput, params: Pins.Params.Remove): Promise<{
|
|
35
|
+
ok: boolean;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=pins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pins.d.ts","sourceRoot":"","sources":["../../../src/types/pins.ts"],"names":[],"mappings":"AAcA,yBAAiB,IAAI,CAAC;IACpB,UAAiB,MAAM,CAAC;QACtB,UAAiB,GAAG;YAClB,OAAO,EAAE,MAAM,CAAA;YACf,SAAS,CAAC,EAAE,MAAM,CAAA;SACnB;QACD,UAAiB,IAAI;YACnB,OAAO,EAAE,MAAM,CAAA;SAChB;QACD,UAAiB,MAAM;YACrB,OAAO,EAAE,MAAM,CAAA;YACf,SAAS,CAAC,EAAE,MAAM,CAAA;SACnB;KACF;CACF;AAED,OAAO,QAAQ,YAAY,CAAC;IAC1B,UAAU,QAAQ;QAChB;;;WAGG;QACH,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC;YAC3D,EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;QAEF;;;WAGG;QACH,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;QAEvE;;;WAGG;QACH,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC;YACjE,EAAE,EAAE,OAAO,CAAA;SACZ,CAAC,CAAA;KACH;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Internal } from "./internal.js";
|
|
2
|
+
Internal.define({
|
|
3
|
+
'/pins.add': {
|
|
4
|
+
POST: { 'pinsAdd': true },
|
|
5
|
+
},
|
|
6
|
+
'/pins.list': {
|
|
7
|
+
GET: { 'pinsList': false },
|
|
8
|
+
},
|
|
9
|
+
'/pins.remove': {
|
|
10
|
+
POST: { 'pinsRemove': true },
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=pins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pins.js","sourceRoot":"","sources":["../../../src/types/pins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,QAAQ,CAAC,MAAM,CAAC;IACd,WAAW,EAAE;QACX,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC1B;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;KAC3B;IACD,cAAc,EAAE;QACd,IAAI,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;KAC7B;CACF,CAAC,CAAA"}
|