@distilled.cloud/slack 0.0.0 → 1.0.0-rc.11
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 +201 -0
- package/lib/credentials.d.ts +27 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +53 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +83 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +59 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/lib/pagination.d.ts +31 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +31 -0
- package/lib/pagination.js.map +1 -0
- package/lib/protocol.d.ts +18 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +230 -0
- package/lib/protocol.js.map +1 -0
- package/lib/retry.d.ts +52 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +45 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/admin.d.ts +2796 -0
- package/lib/services/admin.d.ts.map +1 -0
- package/lib/services/admin.js +3217 -0
- package/lib/services/admin.js.map +1 -0
- package/lib/services/api.d.ts +23 -0
- package/lib/services/api.d.ts.map +1 -0
- package/lib/services/api.js +26 -0
- package/lib/services/api.js.map +1 -0
- package/lib/services/apps.d.ts +568 -0
- package/lib/services/apps.d.ts.map +1 -0
- package/lib/services/apps.js +584 -0
- package/lib/services/apps.js.map +1 -0
- package/lib/services/assistant.d.ts +290 -0
- package/lib/services/assistant.d.ts.map +1 -0
- package/lib/services/assistant.js +232 -0
- package/lib/services/assistant.js.map +1 -0
- package/lib/services/auth.d.ts +90 -0
- package/lib/services/auth.d.ts.map +1 -0
- package/lib/services/auth.js +114 -0
- package/lib/services/auth.js.map +1 -0
- package/lib/services/blocks.d.ts +31 -0
- package/lib/services/blocks.d.ts.map +1 -0
- package/lib/services/blocks.js +31 -0
- package/lib/services/blocks.js.map +1 -0
- package/lib/services/bookmarks.d.ts +91 -0
- package/lib/services/bookmarks.d.ts.map +1 -0
- package/lib/services/bookmarks.js +98 -0
- package/lib/services/bookmarks.js.map +1 -0
- package/lib/services/bots.d.ts +60 -0
- package/lib/services/bots.d.ts.map +1 -0
- package/lib/services/bots.js +68 -0
- package/lib/services/bots.js.map +1 -0
- package/lib/services/calls.d.ts +124 -0
- package/lib/services/calls.d.ts.map +1 -0
- package/lib/services/calls.js +136 -0
- package/lib/services/calls.js.map +1 -0
- package/lib/services/canvases.d.ts +152 -0
- package/lib/services/canvases.d.ts.map +1 -0
- package/lib/services/canvases.js +152 -0
- package/lib/services/canvases.js.map +1 -0
- package/lib/services/chat.d.ts +525 -0
- package/lib/services/chat.d.ts.map +1 -0
- package/lib/services/chat.js +436 -0
- package/lib/services/chat.js.map +1 -0
- package/lib/services/conversations.d.ts +642 -0
- package/lib/services/conversations.d.ts.map +1 -0
- package/lib/services/conversations.js +769 -0
- package/lib/services/conversations.js.map +1 -0
- package/lib/services/dialog.d.ts +20 -0
- package/lib/services/dialog.d.ts.map +1 -0
- package/lib/services/dialog.js +27 -0
- package/lib/services/dialog.js.map +1 -0
- package/lib/services/dnd.d.ts +94 -0
- package/lib/services/dnd.d.ts.map +1 -0
- package/lib/services/dnd.js +111 -0
- package/lib/services/dnd.js.map +1 -0
- package/lib/services/emoji.d.ts +35 -0
- package/lib/services/emoji.d.ts.map +1 -0
- package/lib/services/emoji.js +40 -0
- package/lib/services/emoji.js.map +1 -0
- package/lib/services/entity.d.ts +93 -0
- package/lib/services/entity.d.ts.map +1 -0
- package/lib/services/entity.js +89 -0
- package/lib/services/entity.js.map +1 -0
- package/lib/services/files.d.ts +473 -0
- package/lib/services/files.d.ts.map +1 -0
- package/lib/services/files.js +510 -0
- package/lib/services/files.js.map +1 -0
- package/lib/services/functions.d.ts +235 -0
- package/lib/services/functions.d.ts.map +1 -0
- package/lib/services/functions.js +256 -0
- package/lib/services/functions.js.map +1 -0
- package/lib/services/index.d.ts +35 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +36 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/lists.d.ts +300 -0
- package/lib/services/lists.d.ts.map +1 -0
- package/lib/services/lists.js +366 -0
- package/lib/services/lists.js.map +1 -0
- package/lib/services/migration.d.ts +34 -0
- package/lib/services/migration.d.ts.map +1 -0
- package/lib/services/migration.js +36 -0
- package/lib/services/migration.js.map +1 -0
- package/lib/services/oauth.d.ts +307 -0
- package/lib/services/oauth.d.ts.map +1 -0
- package/lib/services/oauth.js +278 -0
- package/lib/services/oauth.js.map +1 -0
- package/lib/services/openid.d.ts +86 -0
- package/lib/services/openid.d.ts.map +1 -0
- package/lib/services/openid.js +93 -0
- package/lib/services/openid.js.map +1 -0
- package/lib/services/pins.d.ts +64 -0
- package/lib/services/pins.d.ts.map +1 -0
- package/lib/services/pins.js +75 -0
- package/lib/services/pins.js.map +1 -0
- package/lib/services/reactions.d.ts +108 -0
- package/lib/services/reactions.d.ts.map +1 -0
- package/lib/services/reactions.js +119 -0
- package/lib/services/reactions.js.map +1 -0
- package/lib/services/reminders.d.ts +89 -0
- package/lib/services/reminders.d.ts.map +1 -0
- package/lib/services/reminders.js +109 -0
- package/lib/services/reminders.js.map +1 -0
- package/lib/services/rtm.d.ts +68 -0
- package/lib/services/rtm.d.ts.map +1 -0
- package/lib/services/rtm.js +74 -0
- package/lib/services/rtm.js.map +1 -0
- package/lib/services/search.d.ts +239 -0
- package/lib/services/search.d.ts.map +1 -0
- package/lib/services/search.js +190 -0
- package/lib/services/search.js.map +1 -0
- package/lib/services/stars.d.ts +126 -0
- package/lib/services/stars.d.ts.map +1 -0
- package/lib/services/stars.js +145 -0
- package/lib/services/stars.js.map +1 -0
- package/lib/services/team.d.ts +309 -0
- package/lib/services/team.d.ts.map +1 -0
- package/lib/services/team.js +333 -0
- package/lib/services/team.js.map +1 -0
- package/lib/services/tooling.d.ts +31 -0
- package/lib/services/tooling.d.ts.map +1 -0
- package/lib/services/tooling.js +38 -0
- package/lib/services/tooling.js.map +1 -0
- package/lib/services/usergroups.d.ts +183 -0
- package/lib/services/usergroups.d.ts.map +1 -0
- package/lib/services/usergroups.js +180 -0
- package/lib/services/usergroups.js.map +1 -0
- package/lib/services/users.d.ts +246 -0
- package/lib/services/users.d.ts.map +1 -0
- package/lib/services/users.js +309 -0
- package/lib/services/users.js.map +1 -0
- package/lib/services/views.d.ts +84 -0
- package/lib/services/views.d.ts.map +1 -0
- package/lib/services/views.js +95 -0
- package/lib/services/views.js.map +1 -0
- package/lib/services/workflows.d.ts +231 -0
- package/lib/services/workflows.d.ts.map +1 -0
- package/lib/services/workflows.js +238 -0
- package/lib/services/workflows.js.map +1 -0
- package/lib/traits.d.ts +11 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +12 -0
- package/lib/traits.js.map +1 -0
- package/package.json +82 -4
- package/src/credentials.ts +86 -0
- package/src/errors.ts +101 -0
- package/src/index.ts +20 -0
- package/src/pagination.ts +35 -0
- package/src/protocol.ts +326 -0
- package/src/retry.ts +76 -0
- package/src/services/admin.ts +7722 -0
- package/src/services/api.ts +58 -0
- package/src/services/apps.ts +1441 -0
- package/src/services/assistant.ts +639 -0
- package/src/services/auth.ts +241 -0
- package/src/services/blocks.ts +80 -0
- package/src/services/bookmarks.ts +223 -0
- package/src/services/bots.ts +144 -0
- package/src/services/calls.ts +318 -0
- package/src/services/canvases.ts +392 -0
- package/src/services/chat.ts +1191 -0
- package/src/services/conversations.ts +1754 -0
- package/src/services/dialog.ts +55 -0
- package/src/services/dnd.ts +246 -0
- package/src/services/emoji.ts +91 -0
- package/src/services/entity.ts +225 -0
- package/src/services/files.ts +1192 -0
- package/src/services/functions.ts +642 -0
- package/src/services/index.ts +35 -0
- package/src/services/lists.ts +832 -0
- package/src/services/migration.ts +85 -0
- package/src/services/oauth.ts +658 -0
- package/src/services/openid.ts +243 -0
- package/src/services/pins.ts +167 -0
- package/src/services/reactions.ts +272 -0
- package/src/services/reminders.ts +240 -0
- package/src/services/rtm.ts +162 -0
- package/src/services/search.ts +507 -0
- package/src/services/stars.ts +323 -0
- package/src/services/team.ts +834 -0
- package/src/services/tooling.ts +78 -0
- package/src/services/usergroups.ts +441 -0
- package/src/services/users.ts +685 -0
- package/src/services/views.ts +212 -0
- package/src/services/workflows.ts +605 -0
- package/src/traits.ts +45 -0
|
@@ -0,0 +1,1192 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
SlackProtocol,
|
|
7
|
+
type SlackOpError,
|
|
8
|
+
type SlackOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { slackPaginate } from "../pagination.ts";
|
|
11
|
+
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
12
|
+
import * as Retry from "../retry.ts";
|
|
13
|
+
|
|
14
|
+
export type { SlackOpError, SlackOpContext };
|
|
15
|
+
|
|
16
|
+
export interface AddRemoteRequest {
|
|
17
|
+
/** Creator defined GUID for the file. */
|
|
18
|
+
external_id: string;
|
|
19
|
+
/** URL of the remote file. */
|
|
20
|
+
external_url: string;
|
|
21
|
+
/** type of file */
|
|
22
|
+
filetype?: string;
|
|
23
|
+
/** A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file. */
|
|
24
|
+
indexable_file_contents?: unknown;
|
|
25
|
+
/** Preview of the document via `multipart/form-data`. */
|
|
26
|
+
preview_image?: unknown;
|
|
27
|
+
/** Title of the file being shared. */
|
|
28
|
+
title: string;
|
|
29
|
+
}
|
|
30
|
+
export const AddRemoteRequest = /*@__PURE__*/ S.suspend(() =>
|
|
31
|
+
S.Struct({
|
|
32
|
+
external_id: S.String,
|
|
33
|
+
external_url: S.String,
|
|
34
|
+
filetype: S.optional(S.String),
|
|
35
|
+
indexable_file_contents: S.optional(S.Unknown),
|
|
36
|
+
preview_image: S.optional(S.Unknown),
|
|
37
|
+
title: S.String,
|
|
38
|
+
}).pipe(
|
|
39
|
+
T.Http({
|
|
40
|
+
method: "POST",
|
|
41
|
+
uri: "/files.remote.add",
|
|
42
|
+
code: 200,
|
|
43
|
+
contentType: "form-urlencoded",
|
|
44
|
+
}),
|
|
45
|
+
),
|
|
46
|
+
).annotate({
|
|
47
|
+
identifier: "AddRemoteRequest",
|
|
48
|
+
}) as any as S.Schema<AddRemoteRequest>;
|
|
49
|
+
|
|
50
|
+
export type AddRemoteResponseFileSharesMap = {
|
|
51
|
+
[key: string]: unknown | undefined;
|
|
52
|
+
};
|
|
53
|
+
export const AddRemoteResponseFileSharesMap = /*@__PURE__*/ S.Record(
|
|
54
|
+
S.String,
|
|
55
|
+
S.Unknown,
|
|
56
|
+
) as any as S.Schema<AddRemoteResponseFileSharesMap>;
|
|
57
|
+
|
|
58
|
+
export type AddRemoteResponseFileChannelsList = Array<string>;
|
|
59
|
+
export const AddRemoteResponseFileChannelsList = /*@__PURE__*/ S.Array(
|
|
60
|
+
S.String,
|
|
61
|
+
) as any as S.Schema<AddRemoteResponseFileChannelsList>;
|
|
62
|
+
|
|
63
|
+
export type AddRemoteResponseFileGroupsList = Array<string>;
|
|
64
|
+
export const AddRemoteResponseFileGroupsList = /*@__PURE__*/ S.Array(
|
|
65
|
+
S.String,
|
|
66
|
+
) as any as S.Schema<AddRemoteResponseFileGroupsList>;
|
|
67
|
+
|
|
68
|
+
export type AddRemoteResponseFileImsList = Array<string>;
|
|
69
|
+
export const AddRemoteResponseFileImsList = /*@__PURE__*/ S.Array(
|
|
70
|
+
S.String,
|
|
71
|
+
) as any as S.Schema<AddRemoteResponseFileImsList>;
|
|
72
|
+
|
|
73
|
+
export interface AddRemoteResponseFile {
|
|
74
|
+
id?: string;
|
|
75
|
+
created?: number;
|
|
76
|
+
timestamp?: number;
|
|
77
|
+
name?: string;
|
|
78
|
+
title?: string;
|
|
79
|
+
mimetype?: string;
|
|
80
|
+
filetype?: string;
|
|
81
|
+
pretty_type?: string;
|
|
82
|
+
user?: string;
|
|
83
|
+
editable?: boolean;
|
|
84
|
+
size?: number;
|
|
85
|
+
mode?: string;
|
|
86
|
+
is_external?: boolean;
|
|
87
|
+
external_type?: string;
|
|
88
|
+
is_public?: boolean;
|
|
89
|
+
public_url_shared?: boolean;
|
|
90
|
+
display_as_bot?: boolean;
|
|
91
|
+
username?: string;
|
|
92
|
+
url_private?: string;
|
|
93
|
+
permalink?: string;
|
|
94
|
+
comments_count?: number;
|
|
95
|
+
is_starred?: boolean;
|
|
96
|
+
shares?: AddRemoteResponseFileSharesMap;
|
|
97
|
+
channels?: AddRemoteResponseFileChannelsList;
|
|
98
|
+
groups?: AddRemoteResponseFileGroupsList;
|
|
99
|
+
ims?: AddRemoteResponseFileImsList;
|
|
100
|
+
external_id?: string;
|
|
101
|
+
external_url?: string;
|
|
102
|
+
has_rich_preview?: boolean;
|
|
103
|
+
}
|
|
104
|
+
export const AddRemoteResponseFile = /*@__PURE__*/ S.suspend(() =>
|
|
105
|
+
S.Struct({
|
|
106
|
+
id: S.optional(S.String),
|
|
107
|
+
created: S.optional(S.Number),
|
|
108
|
+
timestamp: S.optional(S.Number),
|
|
109
|
+
name: S.optional(S.String),
|
|
110
|
+
title: S.optional(S.String),
|
|
111
|
+
mimetype: S.optional(S.String),
|
|
112
|
+
filetype: S.optional(S.String),
|
|
113
|
+
pretty_type: S.optional(S.String),
|
|
114
|
+
user: S.optional(S.String),
|
|
115
|
+
editable: S.optional(S.Boolean),
|
|
116
|
+
size: S.optional(S.Number),
|
|
117
|
+
mode: S.optional(S.String),
|
|
118
|
+
is_external: S.optional(S.Boolean),
|
|
119
|
+
external_type: S.optional(S.String),
|
|
120
|
+
is_public: S.optional(S.Boolean),
|
|
121
|
+
public_url_shared: S.optional(S.Boolean),
|
|
122
|
+
display_as_bot: S.optional(S.Boolean),
|
|
123
|
+
username: S.optional(S.String),
|
|
124
|
+
url_private: S.optional(S.String),
|
|
125
|
+
permalink: S.optional(S.String),
|
|
126
|
+
comments_count: S.optional(S.Number),
|
|
127
|
+
is_starred: S.optional(S.Boolean),
|
|
128
|
+
shares: S.optional(AddRemoteResponseFileSharesMap),
|
|
129
|
+
channels: S.optional(AddRemoteResponseFileChannelsList),
|
|
130
|
+
groups: S.optional(AddRemoteResponseFileGroupsList),
|
|
131
|
+
ims: S.optional(AddRemoteResponseFileImsList),
|
|
132
|
+
external_id: S.optional(S.String),
|
|
133
|
+
external_url: S.optional(S.String),
|
|
134
|
+
has_rich_preview: S.optional(S.Boolean),
|
|
135
|
+
}),
|
|
136
|
+
).annotate({
|
|
137
|
+
identifier: "AddRemoteResponseFile",
|
|
138
|
+
}) as any as S.Schema<AddRemoteResponseFile>;
|
|
139
|
+
|
|
140
|
+
export interface AddRemoteResponse {
|
|
141
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
142
|
+
ok: boolean;
|
|
143
|
+
file: AddRemoteResponseFile;
|
|
144
|
+
}
|
|
145
|
+
export const AddRemoteResponse = /*@__PURE__*/ S.suspend(() =>
|
|
146
|
+
S.Struct({
|
|
147
|
+
ok: S.Boolean,
|
|
148
|
+
file: AddRemoteResponseFile,
|
|
149
|
+
}),
|
|
150
|
+
).annotate({
|
|
151
|
+
identifier: "AddRemoteResponse",
|
|
152
|
+
}) as any as S.Schema<AddRemoteResponse>;
|
|
153
|
+
|
|
154
|
+
export interface CompleteUploadExternalRequestFilesItem {
|
|
155
|
+
/** File ID returned from files.getUploadURL. */
|
|
156
|
+
id: string;
|
|
157
|
+
/** Title of file. */
|
|
158
|
+
title?: string;
|
|
159
|
+
/** Optional highlight type hint for the file. The upload processing job may overwrite this value. */
|
|
160
|
+
highlight_type?: string;
|
|
161
|
+
}
|
|
162
|
+
export const CompleteUploadExternalRequestFilesItem = /*@__PURE__*/ S.suspend(
|
|
163
|
+
() =>
|
|
164
|
+
S.Struct({
|
|
165
|
+
id: S.String,
|
|
166
|
+
title: S.optional(S.String),
|
|
167
|
+
highlight_type: S.optional(S.String),
|
|
168
|
+
}),
|
|
169
|
+
).annotate({
|
|
170
|
+
identifier: "CompleteUploadExternalRequestFilesItem",
|
|
171
|
+
}) as any as S.Schema<CompleteUploadExternalRequestFilesItem>;
|
|
172
|
+
|
|
173
|
+
/** Array of file ids and their corresponding (optional) titles. */
|
|
174
|
+
export type CompleteUploadExternalRequestFilesList =
|
|
175
|
+
Array<CompleteUploadExternalRequestFilesItem>;
|
|
176
|
+
export const CompleteUploadExternalRequestFilesList = /*@__PURE__*/ S.Array(
|
|
177
|
+
CompleteUploadExternalRequestFilesItem,
|
|
178
|
+
) as any as S.Schema<CompleteUploadExternalRequestFilesList>;
|
|
179
|
+
|
|
180
|
+
export type CompleteUploadExternalRequestBlocksCase1ItemMap = {
|
|
181
|
+
[key: string]: unknown | undefined;
|
|
182
|
+
};
|
|
183
|
+
export const CompleteUploadExternalRequestBlocksCase1ItemMap =
|
|
184
|
+
/*@__PURE__*/ S.Record(
|
|
185
|
+
S.String,
|
|
186
|
+
S.Unknown,
|
|
187
|
+
) as any as S.Schema<CompleteUploadExternalRequestBlocksCase1ItemMap>;
|
|
188
|
+
|
|
189
|
+
export type CompleteUploadExternalRequestBlocksCase1List =
|
|
190
|
+
Array<CompleteUploadExternalRequestBlocksCase1ItemMap>;
|
|
191
|
+
export const CompleteUploadExternalRequestBlocksCase1List =
|
|
192
|
+
/*@__PURE__*/ S.Array(
|
|
193
|
+
CompleteUploadExternalRequestBlocksCase1ItemMap,
|
|
194
|
+
) as any as S.Schema<CompleteUploadExternalRequestBlocksCase1List>;
|
|
195
|
+
|
|
196
|
+
/** A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the `initial_comment` field is provided, the `blocks` field is ignored */
|
|
197
|
+
export type CompleteUploadExternalRequestBlocks =
|
|
198
|
+
| string
|
|
199
|
+
| CompleteUploadExternalRequestBlocksCase1List;
|
|
200
|
+
export const CompleteUploadExternalRequestBlocks = /*@__PURE__*/ S.Unknown.pipe(
|
|
201
|
+
T.UnionCases([[], []]),
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
export interface CompleteUploadExternalRequest {
|
|
205
|
+
/** Array of file ids and their corresponding (optional) titles. */
|
|
206
|
+
files: CompleteUploadExternalRequestFilesList;
|
|
207
|
+
/** Channel ID where the file will be shared. If not specified the file will be private. */
|
|
208
|
+
channel_id?: string;
|
|
209
|
+
/** Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead. Also make sure to provide only one channel when using 'thread_ts' */
|
|
210
|
+
thread_ts?: string;
|
|
211
|
+
/** Comma-separated string of channel IDs or user IDs where the file will be shared. */
|
|
212
|
+
channels?: string;
|
|
213
|
+
/** The message text introducing the file in specified channels. */
|
|
214
|
+
initial_comment?: string;
|
|
215
|
+
/** A JSON-based array of structured rich text blocks, presented as a URL-encoded string. If the `initial_comment` field is provided, the `blocks` field is ignored */
|
|
216
|
+
blocks?: CompleteUploadExternalRequestBlocks;
|
|
217
|
+
/** Set your bot's user name for the file share message. Requires the [`chat:write.customize`](/reference/scopes/chat.write.customize) scope. */
|
|
218
|
+
username?: string | null;
|
|
219
|
+
/** URL to an image to use as the icon for the file share message. Requires the [`chat:write.customize`](/reference/scopes/chat.write.customize) scope. */
|
|
220
|
+
icon_url?: string;
|
|
221
|
+
/** Emoji to use as the icon for the file share message. Overrides `icon_url`. Requires the [`chat:write.customize`](/reference/scopes/chat.write.customize) scope. */
|
|
222
|
+
icon_emoji?: string;
|
|
223
|
+
}
|
|
224
|
+
export const CompleteUploadExternalRequest = /*@__PURE__*/ S.suspend(() =>
|
|
225
|
+
S.Struct({
|
|
226
|
+
files: CompleteUploadExternalRequestFilesList,
|
|
227
|
+
channel_id: S.optional(S.String),
|
|
228
|
+
thread_ts: S.optional(S.String),
|
|
229
|
+
channels: S.optional(S.String),
|
|
230
|
+
initial_comment: S.optional(S.String),
|
|
231
|
+
blocks: S.optional(CompleteUploadExternalRequestBlocks),
|
|
232
|
+
username: S.optional(S.NullOr(S.String)),
|
|
233
|
+
icon_url: S.optional(S.String),
|
|
234
|
+
icon_emoji: S.optional(S.String),
|
|
235
|
+
}).pipe(
|
|
236
|
+
T.Http({ method: "POST", uri: "/files.completeUploadExternal", code: 200 }),
|
|
237
|
+
),
|
|
238
|
+
).annotate({
|
|
239
|
+
identifier: "CompleteUploadExternalRequest",
|
|
240
|
+
}) as any as S.Schema<CompleteUploadExternalRequest>;
|
|
241
|
+
|
|
242
|
+
export interface CompleteUploadExternalResponseFilesItem {
|
|
243
|
+
/** File ID returned from files.getUploadURLExternal. */
|
|
244
|
+
id: string;
|
|
245
|
+
/** Title of file. */
|
|
246
|
+
title?: unknown;
|
|
247
|
+
/** file created timestamp */
|
|
248
|
+
created?: number;
|
|
249
|
+
/** file owner */
|
|
250
|
+
user?: string;
|
|
251
|
+
}
|
|
252
|
+
export const CompleteUploadExternalResponseFilesItem = /*@__PURE__*/ S.suspend(
|
|
253
|
+
() =>
|
|
254
|
+
S.Struct({
|
|
255
|
+
id: S.String,
|
|
256
|
+
title: S.optional(S.Unknown),
|
|
257
|
+
created: S.optional(S.Number),
|
|
258
|
+
user: S.optional(S.String),
|
|
259
|
+
}),
|
|
260
|
+
).annotate({
|
|
261
|
+
identifier: "CompleteUploadExternalResponseFilesItem",
|
|
262
|
+
}) as any as S.Schema<CompleteUploadExternalResponseFilesItem>;
|
|
263
|
+
|
|
264
|
+
/** Array of files uploaded. */
|
|
265
|
+
export type CompleteUploadExternalResponseFilesList =
|
|
266
|
+
Array<CompleteUploadExternalResponseFilesItem>;
|
|
267
|
+
export const CompleteUploadExternalResponseFilesList = /*@__PURE__*/ S.Array(
|
|
268
|
+
CompleteUploadExternalResponseFilesItem,
|
|
269
|
+
) as any as S.Schema<CompleteUploadExternalResponseFilesList>;
|
|
270
|
+
|
|
271
|
+
export interface CompleteUploadExternalResponse {
|
|
272
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
273
|
+
ok: boolean;
|
|
274
|
+
/** Array of files uploaded. */
|
|
275
|
+
files: CompleteUploadExternalResponseFilesList;
|
|
276
|
+
}
|
|
277
|
+
export const CompleteUploadExternalResponse = /*@__PURE__*/ S.suspend(() =>
|
|
278
|
+
S.Struct({
|
|
279
|
+
ok: S.Boolean,
|
|
280
|
+
files: CompleteUploadExternalResponseFilesList,
|
|
281
|
+
}),
|
|
282
|
+
).annotate({
|
|
283
|
+
identifier: "CompleteUploadExternalResponse",
|
|
284
|
+
}) as any as S.Schema<CompleteUploadExternalResponse>;
|
|
285
|
+
|
|
286
|
+
export interface DeleteCommentRequest {
|
|
287
|
+
/** File to delete a comment from. */
|
|
288
|
+
file: string;
|
|
289
|
+
/** The comment to delete. */
|
|
290
|
+
id: string;
|
|
291
|
+
}
|
|
292
|
+
export const DeleteCommentRequest = /*@__PURE__*/ S.suspend(() =>
|
|
293
|
+
S.Struct({
|
|
294
|
+
file: S.String,
|
|
295
|
+
id: S.String,
|
|
296
|
+
}).pipe(T.Http({ method: "POST", uri: "/files.comments.delete", code: 200 })),
|
|
297
|
+
).annotate({
|
|
298
|
+
identifier: "DeleteCommentRequest",
|
|
299
|
+
}) as any as S.Schema<DeleteCommentRequest>;
|
|
300
|
+
|
|
301
|
+
export interface DeleteCommentResponse {
|
|
302
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
303
|
+
ok: boolean;
|
|
304
|
+
}
|
|
305
|
+
export const DeleteCommentResponse = /*@__PURE__*/ S.suspend(() =>
|
|
306
|
+
S.Struct({
|
|
307
|
+
ok: S.Boolean,
|
|
308
|
+
}),
|
|
309
|
+
).annotate({
|
|
310
|
+
identifier: "DeleteCommentResponse",
|
|
311
|
+
}) as any as S.Schema<DeleteCommentResponse>;
|
|
312
|
+
|
|
313
|
+
export interface DeleteFileRequest {
|
|
314
|
+
/** ID of file to delete. */
|
|
315
|
+
file: string;
|
|
316
|
+
}
|
|
317
|
+
export const DeleteFileRequest = /*@__PURE__*/ S.suspend(() =>
|
|
318
|
+
S.Struct({
|
|
319
|
+
file: S.String,
|
|
320
|
+
}).pipe(T.Http({ method: "POST", uri: "/files.delete", code: 200 })),
|
|
321
|
+
).annotate({
|
|
322
|
+
identifier: "DeleteFileRequest",
|
|
323
|
+
}) as any as S.Schema<DeleteFileRequest>;
|
|
324
|
+
|
|
325
|
+
export interface DeleteFileResponse {
|
|
326
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
327
|
+
ok: boolean;
|
|
328
|
+
}
|
|
329
|
+
export const DeleteFileResponse = /*@__PURE__*/ S.suspend(() =>
|
|
330
|
+
S.Struct({
|
|
331
|
+
ok: S.Boolean,
|
|
332
|
+
}),
|
|
333
|
+
).annotate({
|
|
334
|
+
identifier: "DeleteFileResponse",
|
|
335
|
+
}) as any as S.Schema<DeleteFileResponse>;
|
|
336
|
+
|
|
337
|
+
export interface FilesInfoRequest {
|
|
338
|
+
count?: number;
|
|
339
|
+
/** Parameter for pagination. File comments are paginated for a single file. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection of comments. See [pagination](/apis/web-api/pagination) for more details. */
|
|
340
|
+
cursor?: string;
|
|
341
|
+
/** Specify a file by providing its ID. */
|
|
342
|
+
file: string;
|
|
343
|
+
/** The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. */
|
|
344
|
+
limit?: number;
|
|
345
|
+
page?: number;
|
|
346
|
+
}
|
|
347
|
+
export const FilesInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
348
|
+
S.Struct({
|
|
349
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
350
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
351
|
+
file: S.String.pipe(T.Query()),
|
|
352
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
353
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
354
|
+
}).pipe(T.Http({ method: "GET", uri: "/files.info", code: 200 })),
|
|
355
|
+
).annotate({
|
|
356
|
+
identifier: "FilesInfoRequest",
|
|
357
|
+
}) as any as S.Schema<FilesInfoRequest>;
|
|
358
|
+
|
|
359
|
+
export interface FilesInfoResponseFile {
|
|
360
|
+
id: string;
|
|
361
|
+
}
|
|
362
|
+
export const FilesInfoResponseFile = /*@__PURE__*/ S.suspend(() =>
|
|
363
|
+
S.Struct({
|
|
364
|
+
id: S.String,
|
|
365
|
+
}),
|
|
366
|
+
).annotate({
|
|
367
|
+
identifier: "FilesInfoResponseFile",
|
|
368
|
+
}) as any as S.Schema<FilesInfoResponseFile>;
|
|
369
|
+
|
|
370
|
+
export interface FilesInfoResponseCommentsItem {
|
|
371
|
+
comment: string;
|
|
372
|
+
created: number;
|
|
373
|
+
id: string;
|
|
374
|
+
is_intro: boolean;
|
|
375
|
+
timestamp: number;
|
|
376
|
+
user: string;
|
|
377
|
+
}
|
|
378
|
+
export const FilesInfoResponseCommentsItem = /*@__PURE__*/ S.suspend(() =>
|
|
379
|
+
S.Struct({
|
|
380
|
+
comment: S.String,
|
|
381
|
+
created: S.Number,
|
|
382
|
+
id: S.String,
|
|
383
|
+
is_intro: S.Boolean,
|
|
384
|
+
timestamp: S.Number,
|
|
385
|
+
user: S.String,
|
|
386
|
+
}),
|
|
387
|
+
).annotate({
|
|
388
|
+
identifier: "FilesInfoResponseCommentsItem",
|
|
389
|
+
}) as any as S.Schema<FilesInfoResponseCommentsItem>;
|
|
390
|
+
|
|
391
|
+
export type FilesInfoResponseCommentsList =
|
|
392
|
+
Array<FilesInfoResponseCommentsItem>;
|
|
393
|
+
export const FilesInfoResponseCommentsList = /*@__PURE__*/ S.Array(
|
|
394
|
+
FilesInfoResponseCommentsItem,
|
|
395
|
+
) as any as S.Schema<FilesInfoResponseCommentsList>;
|
|
396
|
+
|
|
397
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
398
|
+
export interface FilesInfoResponseResponseMetadata {
|
|
399
|
+
/** Cursor for the next page — pass as `cursor` on the next call. */
|
|
400
|
+
next_cursor?: string;
|
|
401
|
+
}
|
|
402
|
+
export const FilesInfoResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
|
|
403
|
+
S.Struct({
|
|
404
|
+
next_cursor: S.optional(S.String),
|
|
405
|
+
}),
|
|
406
|
+
).annotate({
|
|
407
|
+
identifier: "FilesInfoResponseResponseMetadata",
|
|
408
|
+
}) as any as S.Schema<FilesInfoResponseResponseMetadata>;
|
|
409
|
+
|
|
410
|
+
export interface FilesInfoResponse {
|
|
411
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
412
|
+
ok: boolean;
|
|
413
|
+
file: FilesInfoResponseFile;
|
|
414
|
+
comments: FilesInfoResponseCommentsList;
|
|
415
|
+
content?: string;
|
|
416
|
+
content_html?: unknown;
|
|
417
|
+
content_highlight_html?: unknown;
|
|
418
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
419
|
+
response_metadata?: FilesInfoResponseResponseMetadata;
|
|
420
|
+
}
|
|
421
|
+
export const FilesInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
422
|
+
S.Struct({
|
|
423
|
+
ok: S.Boolean,
|
|
424
|
+
file: FilesInfoResponseFile,
|
|
425
|
+
comments: FilesInfoResponseCommentsList,
|
|
426
|
+
content: S.optional(S.String),
|
|
427
|
+
content_html: S.optional(S.Unknown),
|
|
428
|
+
content_highlight_html: S.optional(S.Unknown),
|
|
429
|
+
response_metadata: S.optional(FilesInfoResponseResponseMetadata),
|
|
430
|
+
}),
|
|
431
|
+
).annotate({
|
|
432
|
+
identifier: "FilesInfoResponse",
|
|
433
|
+
}) as any as S.Schema<FilesInfoResponse>;
|
|
434
|
+
|
|
435
|
+
export interface GetUploadURLExternalRequest {
|
|
436
|
+
/** Size in bytes of the file being uploaded. */
|
|
437
|
+
length: number;
|
|
438
|
+
/** Name of the file being uploaded. */
|
|
439
|
+
filename: string;
|
|
440
|
+
/** Syntax type of the snippet being uploaded. */
|
|
441
|
+
snippet_type?: string;
|
|
442
|
+
/** Description of image for screen-reader. */
|
|
443
|
+
alt_txt?: string;
|
|
444
|
+
}
|
|
445
|
+
export const GetUploadURLExternalRequest = /*@__PURE__*/ S.suspend(() =>
|
|
446
|
+
S.Struct({
|
|
447
|
+
length: S.Number,
|
|
448
|
+
filename: S.String,
|
|
449
|
+
snippet_type: S.optional(S.String),
|
|
450
|
+
alt_txt: S.optional(S.String),
|
|
451
|
+
}).pipe(
|
|
452
|
+
T.Http({
|
|
453
|
+
method: "POST",
|
|
454
|
+
uri: "/files.getUploadURLExternal",
|
|
455
|
+
code: 200,
|
|
456
|
+
contentType: "form-urlencoded",
|
|
457
|
+
}),
|
|
458
|
+
),
|
|
459
|
+
).annotate({
|
|
460
|
+
identifier: "GetUploadURLExternalRequest",
|
|
461
|
+
}) as any as S.Schema<GetUploadURLExternalRequest>;
|
|
462
|
+
|
|
463
|
+
export interface GetUploadURLExternalResponse {
|
|
464
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
465
|
+
ok: boolean;
|
|
466
|
+
file_id: string;
|
|
467
|
+
upload_url: string;
|
|
468
|
+
}
|
|
469
|
+
export const GetUploadURLExternalResponse = /*@__PURE__*/ S.suspend(() =>
|
|
470
|
+
S.Struct({
|
|
471
|
+
ok: S.Boolean,
|
|
472
|
+
file_id: S.String,
|
|
473
|
+
upload_url: S.String,
|
|
474
|
+
}),
|
|
475
|
+
).annotate({
|
|
476
|
+
identifier: "GetUploadURLExternalResponse",
|
|
477
|
+
}) as any as S.Schema<GetUploadURLExternalResponse>;
|
|
478
|
+
|
|
479
|
+
export type ListFilesRequestCount = number | string;
|
|
480
|
+
export const ListFilesRequestCount = /*@__PURE__*/ S.Unknown.pipe(
|
|
481
|
+
T.UnionCases([[], []]),
|
|
482
|
+
);
|
|
483
|
+
|
|
484
|
+
export type ListFilesRequestPage = number | string;
|
|
485
|
+
export const ListFilesRequestPage = /*@__PURE__*/ S.Unknown.pipe(
|
|
486
|
+
T.UnionCases([[], []]),
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
export interface ListFilesRequest {
|
|
490
|
+
/** Filter files appearing in a specific channel, indicated by its ID. */
|
|
491
|
+
channel?: string;
|
|
492
|
+
count?: ListFilesRequestCount;
|
|
493
|
+
page?: ListFilesRequestPage;
|
|
494
|
+
/** Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit. */
|
|
495
|
+
show_files_hidden_by_limit?: boolean;
|
|
496
|
+
/** encoded team id to list files in, required if org token is used */
|
|
497
|
+
team_id?: string;
|
|
498
|
+
/** Filter files created after this timestamp (inclusive). */
|
|
499
|
+
ts_from?: string;
|
|
500
|
+
/** Filter files created before this timestamp (inclusive). */
|
|
501
|
+
ts_to?: string;
|
|
502
|
+
/** Filter files by type ([see below](#file_types)). You can pass multiple values in the types argument, like `types=spaces,snippets`.The default value is `all`, which does not filter the list. */
|
|
503
|
+
types?: string;
|
|
504
|
+
/** Filter files created by a single user. */
|
|
505
|
+
user?: string;
|
|
506
|
+
}
|
|
507
|
+
export const ListFilesRequest = /*@__PURE__*/ S.suspend(() =>
|
|
508
|
+
S.Struct({
|
|
509
|
+
channel: S.optional(S.String.pipe(T.Query())),
|
|
510
|
+
count: S.optional(ListFilesRequestCount.pipe(T.Query())),
|
|
511
|
+
page: S.optional(ListFilesRequestPage.pipe(T.Query())),
|
|
512
|
+
show_files_hidden_by_limit: S.optional(S.Boolean.pipe(T.Query())),
|
|
513
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
514
|
+
ts_from: S.optional(S.String.pipe(T.Query())),
|
|
515
|
+
ts_to: S.optional(S.String.pipe(T.Query())),
|
|
516
|
+
types: S.optional(S.String.pipe(T.Query())),
|
|
517
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
518
|
+
}).pipe(T.Http({ method: "GET", uri: "/files.list", code: 200 })),
|
|
519
|
+
).annotate({
|
|
520
|
+
identifier: "ListFilesRequest",
|
|
521
|
+
}) as any as S.Schema<ListFilesRequest>;
|
|
522
|
+
|
|
523
|
+
export interface ListFilesResponseFilesItem {
|
|
524
|
+
id: string;
|
|
525
|
+
created?: number;
|
|
526
|
+
user?: string;
|
|
527
|
+
}
|
|
528
|
+
export const ListFilesResponseFilesItem = /*@__PURE__*/ S.suspend(() =>
|
|
529
|
+
S.Struct({
|
|
530
|
+
id: S.String,
|
|
531
|
+
created: S.optional(S.Number),
|
|
532
|
+
user: S.optional(S.String),
|
|
533
|
+
}),
|
|
534
|
+
).annotate({
|
|
535
|
+
identifier: "ListFilesResponseFilesItem",
|
|
536
|
+
}) as any as S.Schema<ListFilesResponseFilesItem>;
|
|
537
|
+
|
|
538
|
+
export type ListFilesResponseFilesList = Array<ListFilesResponseFilesItem>;
|
|
539
|
+
export const ListFilesResponseFilesList = /*@__PURE__*/ S.Array(
|
|
540
|
+
ListFilesResponseFilesItem,
|
|
541
|
+
) as any as S.Schema<ListFilesResponseFilesList>;
|
|
542
|
+
|
|
543
|
+
export interface ListFilesResponsePaging {
|
|
544
|
+
count?: number;
|
|
545
|
+
total: number;
|
|
546
|
+
page: number;
|
|
547
|
+
pages: number;
|
|
548
|
+
}
|
|
549
|
+
export const ListFilesResponsePaging = /*@__PURE__*/ S.suspend(() =>
|
|
550
|
+
S.Struct({
|
|
551
|
+
count: S.optional(S.Number),
|
|
552
|
+
total: S.Number,
|
|
553
|
+
page: S.Number,
|
|
554
|
+
pages: S.Number,
|
|
555
|
+
}),
|
|
556
|
+
).annotate({
|
|
557
|
+
identifier: "ListFilesResponsePaging",
|
|
558
|
+
}) as any as S.Schema<ListFilesResponsePaging>;
|
|
559
|
+
|
|
560
|
+
export interface ListFilesResponse {
|
|
561
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
562
|
+
ok: boolean;
|
|
563
|
+
files: ListFilesResponseFilesList;
|
|
564
|
+
paging?: ListFilesResponsePaging;
|
|
565
|
+
}
|
|
566
|
+
export const ListFilesResponse = /*@__PURE__*/ S.suspend(() =>
|
|
567
|
+
S.Struct({
|
|
568
|
+
ok: S.Boolean,
|
|
569
|
+
files: ListFilesResponseFilesList,
|
|
570
|
+
paging: S.optional(ListFilesResponsePaging),
|
|
571
|
+
}),
|
|
572
|
+
).annotate({
|
|
573
|
+
identifier: "ListFilesResponse",
|
|
574
|
+
}) as any as S.Schema<ListFilesResponse>;
|
|
575
|
+
|
|
576
|
+
export interface ListRemoteRequest {
|
|
577
|
+
/** Filter files appearing in a specific channel, indicated by its ID. */
|
|
578
|
+
channel?: string;
|
|
579
|
+
/** Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more detail. */
|
|
580
|
+
cursor?: string;
|
|
581
|
+
/** The maximum number of items to return. */
|
|
582
|
+
limit?: number;
|
|
583
|
+
/** Filter files created after this timestamp (inclusive). */
|
|
584
|
+
ts_from?: string;
|
|
585
|
+
/** Filter files created before this timestamp (inclusive). */
|
|
586
|
+
ts_to?: string;
|
|
587
|
+
}
|
|
588
|
+
export const ListRemoteRequest = /*@__PURE__*/ S.suspend(() =>
|
|
589
|
+
S.Struct({
|
|
590
|
+
channel: S.optional(S.String.pipe(T.Query())),
|
|
591
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
592
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
593
|
+
ts_from: S.optional(S.String.pipe(T.Query())),
|
|
594
|
+
ts_to: S.optional(S.String.pipe(T.Query())),
|
|
595
|
+
}).pipe(T.Http({ method: "GET", uri: "/files.remote.list", code: 200 })),
|
|
596
|
+
).annotate({
|
|
597
|
+
identifier: "ListRemoteRequest",
|
|
598
|
+
}) as any as S.Schema<ListRemoteRequest>;
|
|
599
|
+
|
|
600
|
+
export interface ListRemoteResponseFilesItem {
|
|
601
|
+
id?: string;
|
|
602
|
+
}
|
|
603
|
+
export const ListRemoteResponseFilesItem = /*@__PURE__*/ S.suspend(() =>
|
|
604
|
+
S.Struct({
|
|
605
|
+
id: S.optional(S.String),
|
|
606
|
+
}),
|
|
607
|
+
).annotate({
|
|
608
|
+
identifier: "ListRemoteResponseFilesItem",
|
|
609
|
+
}) as any as S.Schema<ListRemoteResponseFilesItem>;
|
|
610
|
+
|
|
611
|
+
export type ListRemoteResponseFilesList = Array<ListRemoteResponseFilesItem>;
|
|
612
|
+
export const ListRemoteResponseFilesList = /*@__PURE__*/ S.Array(
|
|
613
|
+
ListRemoteResponseFilesItem,
|
|
614
|
+
) as any as S.Schema<ListRemoteResponseFilesList>;
|
|
615
|
+
|
|
616
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
617
|
+
export type ListRemoteResponseResponseMetadata =
|
|
618
|
+
FilesInfoResponseResponseMetadata;
|
|
619
|
+
export const ListRemoteResponseResponseMetadata =
|
|
620
|
+
FilesInfoResponseResponseMetadata;
|
|
621
|
+
|
|
622
|
+
export interface ListRemoteResponse {
|
|
623
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
624
|
+
ok: boolean;
|
|
625
|
+
files: ListRemoteResponseFilesList;
|
|
626
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
627
|
+
response_metadata?: FilesInfoResponseResponseMetadata;
|
|
628
|
+
}
|
|
629
|
+
export const ListRemoteResponse = /*@__PURE__*/ S.suspend(() =>
|
|
630
|
+
S.Struct({
|
|
631
|
+
ok: S.Boolean,
|
|
632
|
+
files: ListRemoteResponseFilesList,
|
|
633
|
+
response_metadata: S.optional(FilesInfoResponseResponseMetadata),
|
|
634
|
+
}),
|
|
635
|
+
).annotate({
|
|
636
|
+
identifier: "ListRemoteResponse",
|
|
637
|
+
}) as any as S.Schema<ListRemoteResponse>;
|
|
638
|
+
|
|
639
|
+
export interface RemoteInfoRequest {
|
|
640
|
+
/** Creator defined GUID for the file. */
|
|
641
|
+
external_id?: string;
|
|
642
|
+
/** Specify a file by providing its ID. */
|
|
643
|
+
file?: string;
|
|
644
|
+
}
|
|
645
|
+
export const RemoteInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
646
|
+
S.Struct({
|
|
647
|
+
external_id: S.optional(S.String.pipe(T.Query())),
|
|
648
|
+
file: S.optional(S.String.pipe(T.Query())),
|
|
649
|
+
}).pipe(T.Http({ method: "GET", uri: "/files.remote.info", code: 200 })),
|
|
650
|
+
).annotate({
|
|
651
|
+
identifier: "RemoteInfoRequest",
|
|
652
|
+
}) as any as S.Schema<RemoteInfoRequest>;
|
|
653
|
+
|
|
654
|
+
export type RemoteInfoResponseFile = ListFilesResponseFilesItem;
|
|
655
|
+
export const RemoteInfoResponseFile = ListFilesResponseFilesItem;
|
|
656
|
+
|
|
657
|
+
export interface RemoteInfoResponse {
|
|
658
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
659
|
+
ok: boolean;
|
|
660
|
+
file: ListFilesResponseFilesItem;
|
|
661
|
+
}
|
|
662
|
+
export const RemoteInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
663
|
+
S.Struct({
|
|
664
|
+
ok: S.Boolean,
|
|
665
|
+
file: ListFilesResponseFilesItem,
|
|
666
|
+
}),
|
|
667
|
+
).annotate({
|
|
668
|
+
identifier: "RemoteInfoResponse",
|
|
669
|
+
}) as any as S.Schema<RemoteInfoResponse>;
|
|
670
|
+
|
|
671
|
+
export interface RemoveRemoteRequest {
|
|
672
|
+
/** Creator defined GUID for the file. */
|
|
673
|
+
external_id?: string;
|
|
674
|
+
/** Specify a file by providing its ID. */
|
|
675
|
+
file?: string;
|
|
676
|
+
}
|
|
677
|
+
export const RemoveRemoteRequest = /*@__PURE__*/ S.suspend(() =>
|
|
678
|
+
S.Struct({
|
|
679
|
+
external_id: S.optional(S.String),
|
|
680
|
+
file: S.optional(S.String),
|
|
681
|
+
}).pipe(
|
|
682
|
+
T.Http({
|
|
683
|
+
method: "POST",
|
|
684
|
+
uri: "/files.remote.remove",
|
|
685
|
+
code: 200,
|
|
686
|
+
contentType: "form-urlencoded",
|
|
687
|
+
}),
|
|
688
|
+
),
|
|
689
|
+
).annotate({
|
|
690
|
+
identifier: "RemoveRemoteRequest",
|
|
691
|
+
}) as any as S.Schema<RemoveRemoteRequest>;
|
|
692
|
+
|
|
693
|
+
export interface RemoveRemoteResponse {
|
|
694
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
695
|
+
ok: boolean;
|
|
696
|
+
}
|
|
697
|
+
export const RemoveRemoteResponse = /*@__PURE__*/ S.suspend(() =>
|
|
698
|
+
S.Struct({
|
|
699
|
+
ok: S.Boolean,
|
|
700
|
+
}),
|
|
701
|
+
).annotate({
|
|
702
|
+
identifier: "RemoveRemoteResponse",
|
|
703
|
+
}) as any as S.Schema<RemoveRemoteResponse>;
|
|
704
|
+
|
|
705
|
+
export interface RevokePublicURLRequest {
|
|
706
|
+
/** File to revoke */
|
|
707
|
+
file: string;
|
|
708
|
+
}
|
|
709
|
+
export const RevokePublicURLRequest = /*@__PURE__*/ S.suspend(() =>
|
|
710
|
+
S.Struct({
|
|
711
|
+
file: S.String,
|
|
712
|
+
}).pipe(T.Http({ method: "POST", uri: "/files.revokePublicURL", code: 200 })),
|
|
713
|
+
).annotate({
|
|
714
|
+
identifier: "RevokePublicURLRequest",
|
|
715
|
+
}) as any as S.Schema<RevokePublicURLRequest>;
|
|
716
|
+
|
|
717
|
+
export interface RevokePublicURLResponseFile {
|
|
718
|
+
id?: string;
|
|
719
|
+
created?: number;
|
|
720
|
+
user?: string;
|
|
721
|
+
}
|
|
722
|
+
export const RevokePublicURLResponseFile = /*@__PURE__*/ S.suspend(() =>
|
|
723
|
+
S.Struct({
|
|
724
|
+
id: S.optional(S.String),
|
|
725
|
+
created: S.optional(S.Number),
|
|
726
|
+
user: S.optional(S.String),
|
|
727
|
+
}),
|
|
728
|
+
).annotate({
|
|
729
|
+
identifier: "RevokePublicURLResponseFile",
|
|
730
|
+
}) as any as S.Schema<RevokePublicURLResponseFile>;
|
|
731
|
+
|
|
732
|
+
export interface RevokePublicURLResponse {
|
|
733
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
734
|
+
ok: boolean;
|
|
735
|
+
file: RevokePublicURLResponseFile;
|
|
736
|
+
}
|
|
737
|
+
export const RevokePublicURLResponse = /*@__PURE__*/ S.suspend(() =>
|
|
738
|
+
S.Struct({
|
|
739
|
+
ok: S.Boolean,
|
|
740
|
+
file: RevokePublicURLResponseFile,
|
|
741
|
+
}),
|
|
742
|
+
).annotate({
|
|
743
|
+
identifier: "RevokePublicURLResponse",
|
|
744
|
+
}) as any as S.Schema<RevokePublicURLResponse>;
|
|
745
|
+
|
|
746
|
+
export interface SharedPublicURLRequest {
|
|
747
|
+
/** File to share */
|
|
748
|
+
file: string;
|
|
749
|
+
}
|
|
750
|
+
export const SharedPublicURLRequest = /*@__PURE__*/ S.suspend(() =>
|
|
751
|
+
S.Struct({
|
|
752
|
+
file: S.String,
|
|
753
|
+
}).pipe(T.Http({ method: "POST", uri: "/files.sharedPublicURL", code: 200 })),
|
|
754
|
+
).annotate({
|
|
755
|
+
identifier: "SharedPublicURLRequest",
|
|
756
|
+
}) as any as S.Schema<SharedPublicURLRequest>;
|
|
757
|
+
|
|
758
|
+
export type SharedPublicURLResponseFile = RevokePublicURLResponseFile;
|
|
759
|
+
export const SharedPublicURLResponseFile = RevokePublicURLResponseFile;
|
|
760
|
+
|
|
761
|
+
export type SharedPublicURLResponseCommentItemMap = {
|
|
762
|
+
[key: string]: unknown | undefined;
|
|
763
|
+
};
|
|
764
|
+
export const SharedPublicURLResponseCommentItemMap = /*@__PURE__*/ S.Record(
|
|
765
|
+
S.String,
|
|
766
|
+
S.Unknown,
|
|
767
|
+
) as any as S.Schema<SharedPublicURLResponseCommentItemMap>;
|
|
768
|
+
|
|
769
|
+
export type SharedPublicURLResponseCommentList =
|
|
770
|
+
Array<SharedPublicURLResponseCommentItemMap>;
|
|
771
|
+
export const SharedPublicURLResponseCommentList = /*@__PURE__*/ S.Array(
|
|
772
|
+
SharedPublicURLResponseCommentItemMap,
|
|
773
|
+
) as any as S.Schema<SharedPublicURLResponseCommentList>;
|
|
774
|
+
|
|
775
|
+
export type SharedPublicURLResponsePagingMap = {
|
|
776
|
+
[key: string]: unknown | undefined;
|
|
777
|
+
};
|
|
778
|
+
export const SharedPublicURLResponsePagingMap = /*@__PURE__*/ S.Record(
|
|
779
|
+
S.String,
|
|
780
|
+
S.Unknown,
|
|
781
|
+
) as any as S.Schema<SharedPublicURLResponsePagingMap>;
|
|
782
|
+
|
|
783
|
+
export interface SharedPublicURLResponse {
|
|
784
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
785
|
+
ok: boolean;
|
|
786
|
+
file: RevokePublicURLResponseFile;
|
|
787
|
+
comment?: SharedPublicURLResponseCommentList;
|
|
788
|
+
paging?: SharedPublicURLResponsePagingMap;
|
|
789
|
+
}
|
|
790
|
+
export const SharedPublicURLResponse = /*@__PURE__*/ S.suspend(() =>
|
|
791
|
+
S.Struct({
|
|
792
|
+
ok: S.Boolean,
|
|
793
|
+
file: RevokePublicURLResponseFile,
|
|
794
|
+
comment: S.optional(SharedPublicURLResponseCommentList),
|
|
795
|
+
paging: S.optional(SharedPublicURLResponsePagingMap),
|
|
796
|
+
}),
|
|
797
|
+
).annotate({
|
|
798
|
+
identifier: "SharedPublicURLResponse",
|
|
799
|
+
}) as any as S.Schema<SharedPublicURLResponse>;
|
|
800
|
+
|
|
801
|
+
export interface ShareRemoteRequest {
|
|
802
|
+
/** Comma-separated list of channel IDs where the file will be shared. */
|
|
803
|
+
channels: string;
|
|
804
|
+
/** The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or `file` or both are required. */
|
|
805
|
+
external_id?: string;
|
|
806
|
+
/** Specify a file registered with Slack by providing its ID. Either this field or `external_id` or both are required. */
|
|
807
|
+
file?: string;
|
|
808
|
+
}
|
|
809
|
+
export const ShareRemoteRequest = /*@__PURE__*/ S.suspend(() =>
|
|
810
|
+
S.Struct({
|
|
811
|
+
channels: S.String.pipe(T.Query()),
|
|
812
|
+
external_id: S.optional(S.String.pipe(T.Query())),
|
|
813
|
+
file: S.optional(S.String.pipe(T.Query())),
|
|
814
|
+
}).pipe(T.Http({ method: "GET", uri: "/files.remote.share", code: 200 })),
|
|
815
|
+
).annotate({
|
|
816
|
+
identifier: "ShareRemoteRequest",
|
|
817
|
+
}) as any as S.Schema<ShareRemoteRequest>;
|
|
818
|
+
|
|
819
|
+
export type ShareRemoteResponseFile = ListRemoteResponseFilesItem;
|
|
820
|
+
export const ShareRemoteResponseFile = ListRemoteResponseFilesItem;
|
|
821
|
+
|
|
822
|
+
export interface ShareRemoteResponse {
|
|
823
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
824
|
+
ok: boolean;
|
|
825
|
+
file?: ListRemoteResponseFilesItem;
|
|
826
|
+
}
|
|
827
|
+
export const ShareRemoteResponse = /*@__PURE__*/ S.suspend(() =>
|
|
828
|
+
S.Struct({
|
|
829
|
+
ok: S.Boolean,
|
|
830
|
+
file: S.optional(ListRemoteResponseFilesItem),
|
|
831
|
+
}),
|
|
832
|
+
).annotate({
|
|
833
|
+
identifier: "ShareRemoteResponse",
|
|
834
|
+
}) as any as S.Schema<ShareRemoteResponse>;
|
|
835
|
+
|
|
836
|
+
export interface UpdateRemoteRequest {
|
|
837
|
+
/** Creator defined GUID for the file. */
|
|
838
|
+
external_id?: string;
|
|
839
|
+
/** URL of the remote file. */
|
|
840
|
+
external_url?: string;
|
|
841
|
+
/** Specify a file by providing its ID. */
|
|
842
|
+
file?: string;
|
|
843
|
+
/** type of file */
|
|
844
|
+
filetype?: string;
|
|
845
|
+
/** File containing contents that can be used to improve searchability for the remote file. */
|
|
846
|
+
indexable_file_contents?: unknown;
|
|
847
|
+
/** Preview of the document via `multipart/form-data`. */
|
|
848
|
+
preview_image?: unknown;
|
|
849
|
+
/** Title of the file being shared. */
|
|
850
|
+
title?: string;
|
|
851
|
+
}
|
|
852
|
+
export const UpdateRemoteRequest = /*@__PURE__*/ S.suspend(() =>
|
|
853
|
+
S.Struct({
|
|
854
|
+
external_id: S.optional(S.String),
|
|
855
|
+
external_url: S.optional(S.String),
|
|
856
|
+
file: S.optional(S.String),
|
|
857
|
+
filetype: S.optional(S.String),
|
|
858
|
+
indexable_file_contents: S.optional(S.Unknown),
|
|
859
|
+
preview_image: S.optional(S.Unknown),
|
|
860
|
+
title: S.optional(S.String),
|
|
861
|
+
}).pipe(
|
|
862
|
+
T.Http({
|
|
863
|
+
method: "POST",
|
|
864
|
+
uri: "/files.remote.update",
|
|
865
|
+
code: 200,
|
|
866
|
+
contentType: "form-urlencoded",
|
|
867
|
+
}),
|
|
868
|
+
),
|
|
869
|
+
).annotate({
|
|
870
|
+
identifier: "UpdateRemoteRequest",
|
|
871
|
+
}) as any as S.Schema<UpdateRemoteRequest>;
|
|
872
|
+
|
|
873
|
+
export type UpdateRemoteResponseFile = ListRemoteResponseFilesItem;
|
|
874
|
+
export const UpdateRemoteResponseFile = ListRemoteResponseFilesItem;
|
|
875
|
+
|
|
876
|
+
export interface UpdateRemoteResponse {
|
|
877
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
878
|
+
ok: boolean;
|
|
879
|
+
file?: ListRemoteResponseFilesItem;
|
|
880
|
+
}
|
|
881
|
+
export const UpdateRemoteResponse = /*@__PURE__*/ S.suspend(() =>
|
|
882
|
+
S.Struct({
|
|
883
|
+
ok: S.Boolean,
|
|
884
|
+
file: S.optional(ListRemoteResponseFilesItem),
|
|
885
|
+
}),
|
|
886
|
+
).annotate({
|
|
887
|
+
identifier: "UpdateRemoteResponse",
|
|
888
|
+
}) as any as S.Schema<UpdateRemoteResponse>;
|
|
889
|
+
|
|
890
|
+
export interface UploadFileRequest {
|
|
891
|
+
/** Comma-separated list of channel names or IDs where the file will be shared. */
|
|
892
|
+
channels?: string;
|
|
893
|
+
/** File contents via a POST variable. If omitting this parameter, you must provide a `file`. */
|
|
894
|
+
content?: string;
|
|
895
|
+
/** File contents via `multipart/form-data`. If omitting this parameter, you must submit `content`. */
|
|
896
|
+
file?: unknown;
|
|
897
|
+
/** Filename of file. */
|
|
898
|
+
filename?: string;
|
|
899
|
+
/** A [file type](/reference/objects/file-object#file_types) identifier. */
|
|
900
|
+
filetype?: string;
|
|
901
|
+
/** The message text introducing the file in specified `channels`. */
|
|
902
|
+
initial_comment?: string;
|
|
903
|
+
/** Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead. */
|
|
904
|
+
thread_ts?: string;
|
|
905
|
+
/** Title of file. */
|
|
906
|
+
title?: string;
|
|
907
|
+
}
|
|
908
|
+
export const UploadFileRequest = /*@__PURE__*/ S.suspend(() =>
|
|
909
|
+
S.Struct({
|
|
910
|
+
channels: S.optional(S.String),
|
|
911
|
+
content: S.optional(S.String),
|
|
912
|
+
file: S.optional(S.Unknown),
|
|
913
|
+
filename: S.optional(S.String),
|
|
914
|
+
filetype: S.optional(S.String),
|
|
915
|
+
initial_comment: S.optional(S.String),
|
|
916
|
+
thread_ts: S.optional(S.String),
|
|
917
|
+
title: S.optional(S.String),
|
|
918
|
+
}).pipe(
|
|
919
|
+
T.Http({
|
|
920
|
+
method: "POST",
|
|
921
|
+
uri: "/files.upload",
|
|
922
|
+
code: 200,
|
|
923
|
+
contentType: "form-urlencoded",
|
|
924
|
+
}),
|
|
925
|
+
),
|
|
926
|
+
).annotate({
|
|
927
|
+
identifier: "UploadFileRequest",
|
|
928
|
+
}) as any as S.Schema<UploadFileRequest>;
|
|
929
|
+
|
|
930
|
+
export type UploadFileResponseFile = RevokePublicURLResponseFile;
|
|
931
|
+
export const UploadFileResponseFile = RevokePublicURLResponseFile;
|
|
932
|
+
|
|
933
|
+
export interface UploadFileResponse {
|
|
934
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
935
|
+
ok: boolean;
|
|
936
|
+
file: RevokePublicURLResponseFile;
|
|
937
|
+
}
|
|
938
|
+
export const UploadFileResponse = /*@__PURE__*/ S.suspend(() =>
|
|
939
|
+
S.Struct({
|
|
940
|
+
ok: S.Boolean,
|
|
941
|
+
file: RevokePublicURLResponseFile,
|
|
942
|
+
}),
|
|
943
|
+
).annotate({
|
|
944
|
+
identifier: "UploadFileResponse",
|
|
945
|
+
}) as any as S.Schema<UploadFileResponse>;
|
|
946
|
+
|
|
947
|
+
export type AddRemoteError = SlackOpError;
|
|
948
|
+
/** Adds a file from a remote service Required scopes — bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_image` — The uploaded image could not be processed - try passing a JPG or PNG - `bad_title` — The title provided is too long. - `bot_user_required` — bot user token is required - `invalid_external_id` — The external_id provided is too long. - `too_large` — The uploaded image had excessive dimensions See https://docs.slack.dev/reference/methods/files.remote.add */
|
|
949
|
+
export const addRemote: API.OperationMethod<
|
|
950
|
+
AddRemoteRequest,
|
|
951
|
+
AddRemoteResponse,
|
|
952
|
+
AddRemoteError,
|
|
953
|
+
SlackOpContext
|
|
954
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
955
|
+
input: AddRemoteRequest,
|
|
956
|
+
output: AddRemoteResponse,
|
|
957
|
+
errors: [SlackError, SlackRateLimited],
|
|
958
|
+
protocol: SlackProtocol,
|
|
959
|
+
retry: Retry.Retry,
|
|
960
|
+
}));
|
|
961
|
+
|
|
962
|
+
export type CompleteUploadExternalError = SlackOpError;
|
|
963
|
+
/** Finishes an upload started with files.getUploadURLExternal Required scopes — bot: `files:write`; user: `files:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `access_denied` — User is not the owner of the file. - `channel_not_found` — Value passed for `channel_id` was invalid. - `file_not_found` — Could not find the file from the upload ticket. - `file_update_failed` — Failure occurred when attempting to update the file. - `invalid_blocks` — Provided blocks are in the incorrect format. - `invalid_channel` — Channel could not be found or channel specified is invalid. - `not_in_channel` — User/bot membership is required for the specified channel. - `posting_to_channel_denied` — User is not authorized to post to channel. - `channels_limit_exceeded` — Exceeded the channel limit. A maximum of 100 channels is allowed per request. - `file_type_not_allowed` — The file type is not permitted based on the team's allowed_file_upload_types preference. - `file_uploads_except_images_disabled` — Only image file uploads are permitted for this team. See https://docs.slack.dev/reference/methods/files.completeUploadExternal */
|
|
964
|
+
export const completeUploadExternal: API.OperationMethod<
|
|
965
|
+
CompleteUploadExternalRequest,
|
|
966
|
+
CompleteUploadExternalResponse,
|
|
967
|
+
CompleteUploadExternalError,
|
|
968
|
+
SlackOpContext
|
|
969
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
970
|
+
input: CompleteUploadExternalRequest,
|
|
971
|
+
output: CompleteUploadExternalResponse,
|
|
972
|
+
errors: [SlackError, SlackRateLimited],
|
|
973
|
+
protocol: SlackProtocol,
|
|
974
|
+
retry: Retry.Retry,
|
|
975
|
+
}));
|
|
976
|
+
|
|
977
|
+
export type DeleteCommentError = SlackOpError;
|
|
978
|
+
/** Deletes an existing comment on a file. Required scopes — bot: `files:write`; user: `files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cant_delete` — The requested comment could not be deleted. - `file_deleted` — The requested file was previously deleted. - `file_not_found` — The requested file could not be found. See https://docs.slack.dev/reference/methods/files.comments.delete */
|
|
979
|
+
export const deleteComment: API.OperationMethod<
|
|
980
|
+
DeleteCommentRequest,
|
|
981
|
+
DeleteCommentResponse,
|
|
982
|
+
DeleteCommentError,
|
|
983
|
+
SlackOpContext
|
|
984
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
985
|
+
input: DeleteCommentRequest,
|
|
986
|
+
output: DeleteCommentResponse,
|
|
987
|
+
errors: [SlackError, SlackRateLimited],
|
|
988
|
+
protocol: SlackProtocol,
|
|
989
|
+
retry: Retry.Retry,
|
|
990
|
+
}));
|
|
991
|
+
|
|
992
|
+
export type DeleteFileError = SlackOpError;
|
|
993
|
+
/** Deletes a file. Required scopes — bot: `files:write`; user: `files:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cant_delete_file` — Authenticated user does not have permission to delete this file. - `delete_not_allowed` — Error returned when the requested file does not support deletion; for example, when attempting to delete a canvas template. - `file_deleted` — The file has already been deleted. - `file_deleting_disabled` — This functionality is disabled. - `file_not_found` — The file does not exist, or is not visible to the calling user. See https://docs.slack.dev/reference/methods/files.delete */
|
|
994
|
+
export const deleteFile: API.OperationMethod<
|
|
995
|
+
DeleteFileRequest,
|
|
996
|
+
DeleteFileResponse,
|
|
997
|
+
DeleteFileError,
|
|
998
|
+
SlackOpContext
|
|
999
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1000
|
+
input: DeleteFileRequest,
|
|
1001
|
+
output: DeleteFileResponse,
|
|
1002
|
+
errors: [SlackError, SlackRateLimited],
|
|
1003
|
+
protocol: SlackProtocol,
|
|
1004
|
+
retry: Retry.Retry,
|
|
1005
|
+
}));
|
|
1006
|
+
|
|
1007
|
+
export type FilesInfoError = SlackOpError;
|
|
1008
|
+
/** Gets information about a file. Required scopes — bot: `files:read`; user: `files:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `access_denied` — Unable to access the file (slack connect) - `file_deleted` — The requested file has been deleted - `file_not_found` — Value passed for `file` was invalid - `canvas_globally_disabled` — Canvas is disabled for this team - `canvas_disabled_user_team` — Canvas is disabled on user's team for connected Channels - `canvas_disabled_file_team` — Canvas is disabled on file's team - `not_visible` — Do not have permission to view the file - `template_not_visible` — Do not have permissions to view this template - `slack_connect_canvas_sharing_blocked` — Admin has disabled sharing of Canvas links in all Slack Connect communications See https://docs.slack.dev/reference/methods/files.info */
|
|
1009
|
+
export const filesInfo: API.PaginatedOperationMethod<
|
|
1010
|
+
FilesInfoRequest,
|
|
1011
|
+
FilesInfoResponse,
|
|
1012
|
+
FilesInfoError,
|
|
1013
|
+
SlackOpContext,
|
|
1014
|
+
FilesInfoResponseCommentsItem
|
|
1015
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
1016
|
+
() => ({
|
|
1017
|
+
input: FilesInfoRequest,
|
|
1018
|
+
output: FilesInfoResponse,
|
|
1019
|
+
errors: [SlackError, SlackRateLimited],
|
|
1020
|
+
protocol: SlackProtocol,
|
|
1021
|
+
retry: Retry.Retry,
|
|
1022
|
+
pagination: {
|
|
1023
|
+
mode: "cursor",
|
|
1024
|
+
inputToken: "cursor",
|
|
1025
|
+
outputToken: "response_metadata.next_cursor",
|
|
1026
|
+
items: "comments",
|
|
1027
|
+
pageSize: "limit",
|
|
1028
|
+
} as const,
|
|
1029
|
+
}),
|
|
1030
|
+
slackPaginate,
|
|
1031
|
+
) as any;
|
|
1032
|
+
|
|
1033
|
+
export type GetUploadURLExternalError = SlackOpError;
|
|
1034
|
+
/** Gets a URL for an edge external file upload Required scopes — bot: `files:write`; user: `files:write` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `alt_txt_too_large` — Description for the image is longer than the limit of 1000 character - `file_upload_size_restricted` — The size of provided file is too large, as the team has restricted uploads of large files. - `file_uploads_disabled` — Team has disabled all file uploads. - `missing_argument` — A required argument was not provided. Typically only occurs when the `length` provided is 0. - `snippet_too_large` — The provided `length` is too large to create a snippet, which are limited to 1MB. - `storage_limit_reached` — File storage limit has been reached. This occurs when free teams have uploaded 5GB of files. - `unknown_snippet_type` — The provided `snippet_type` is not a supported type. - `unknown_subtype` — The provided `subtype` is not a supported type. - `file_type_not_allowed` — The file type is not allowed. - `file_uploads_except_images_disabled` — File uploads except images are disabled. See https://docs.slack.dev/reference/methods/files.getUploadURLExternal */
|
|
1035
|
+
export const getUploadURLExternal: API.OperationMethod<
|
|
1036
|
+
GetUploadURLExternalRequest,
|
|
1037
|
+
GetUploadURLExternalResponse,
|
|
1038
|
+
GetUploadURLExternalError,
|
|
1039
|
+
SlackOpContext
|
|
1040
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1041
|
+
input: GetUploadURLExternalRequest,
|
|
1042
|
+
output: GetUploadURLExternalResponse,
|
|
1043
|
+
errors: [SlackError, SlackRateLimited],
|
|
1044
|
+
protocol: SlackProtocol,
|
|
1045
|
+
retry: Retry.Retry,
|
|
1046
|
+
}));
|
|
1047
|
+
|
|
1048
|
+
export type ListFilesError = SlackOpError;
|
|
1049
|
+
/** List files for a team, in a channel, or from a user with applied filters. Required scopes — bot: `files:read`; user: `files:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — A required argument is missing. - `slack_connect_canvas_sharing_blocked` — Admin has disabled sharing of Canvas links in all Slack Connect communications - `user_not_found` — Value passed for `user` was invalid - `unknown_type` — Value passed for `types` was invalid See https://docs.slack.dev/reference/methods/files.list */
|
|
1050
|
+
export const listFiles: API.OperationMethod<
|
|
1051
|
+
ListFilesRequest,
|
|
1052
|
+
ListFilesResponse,
|
|
1053
|
+
ListFilesError,
|
|
1054
|
+
SlackOpContext
|
|
1055
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1056
|
+
input: ListFilesRequest,
|
|
1057
|
+
output: ListFilesResponse,
|
|
1058
|
+
errors: [SlackError, SlackRateLimited],
|
|
1059
|
+
protocol: SlackProtocol,
|
|
1060
|
+
retry: Retry.Retry,
|
|
1061
|
+
}));
|
|
1062
|
+
|
|
1063
|
+
export type ListRemoteError = SlackOpError;
|
|
1064
|
+
/** Retrieve information about a remote file added to Slack Required scopes — bot: `remote_files:read`; user: `remote_files:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` — Value passed for `cursor` was not valid or is no longer valid. - `no_bot_user_for_app` — Cannot call the Remote Files endpoints unless app has associated bot user See https://docs.slack.dev/reference/methods/files.remote.list */
|
|
1065
|
+
export const listRemote: API.PaginatedOperationMethod<
|
|
1066
|
+
ListRemoteRequest,
|
|
1067
|
+
ListRemoteResponse,
|
|
1068
|
+
ListRemoteError,
|
|
1069
|
+
SlackOpContext,
|
|
1070
|
+
ListRemoteResponseFilesItem
|
|
1071
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
1072
|
+
() => ({
|
|
1073
|
+
input: ListRemoteRequest,
|
|
1074
|
+
output: ListRemoteResponse,
|
|
1075
|
+
errors: [SlackError, SlackRateLimited],
|
|
1076
|
+
protocol: SlackProtocol,
|
|
1077
|
+
retry: Retry.Retry,
|
|
1078
|
+
pagination: {
|
|
1079
|
+
mode: "cursor",
|
|
1080
|
+
inputToken: "cursor",
|
|
1081
|
+
outputToken: "response_metadata.next_cursor",
|
|
1082
|
+
items: "files",
|
|
1083
|
+
pageSize: "limit",
|
|
1084
|
+
} as const,
|
|
1085
|
+
}),
|
|
1086
|
+
slackPaginate,
|
|
1087
|
+
) as any;
|
|
1088
|
+
|
|
1089
|
+
export type RemoteInfoError = SlackOpError;
|
|
1090
|
+
/** Retrieve information about a remote file added to Slack Required scopes — bot: `remote_files:read`; user: `remote_files:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `file_not_found` — Value passed for `file` or `external_id` was invalid - `invalid_args` — Invalid arguments passed to endpoint - `no_bot_user_for_app` — Cannot call the Remote Files endpoints unless app has associated bot user - `too_many_ids` — The request specified both an external_id and a file, only one may be specified See https://docs.slack.dev/reference/methods/files.remote.info */
|
|
1091
|
+
export const remoteInfo: API.OperationMethod<
|
|
1092
|
+
RemoteInfoRequest,
|
|
1093
|
+
RemoteInfoResponse,
|
|
1094
|
+
RemoteInfoError,
|
|
1095
|
+
SlackOpContext
|
|
1096
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1097
|
+
input: RemoteInfoRequest,
|
|
1098
|
+
output: RemoteInfoResponse,
|
|
1099
|
+
errors: [SlackError, SlackRateLimited],
|
|
1100
|
+
protocol: SlackProtocol,
|
|
1101
|
+
retry: Retry.Retry,
|
|
1102
|
+
}));
|
|
1103
|
+
|
|
1104
|
+
export type RemoveRemoteError = SlackOpError;
|
|
1105
|
+
/** Remove a remote file. Required scopes — bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bot_user_required` — bot user token is required - `file_not_found` — Value passed for `file` or `external_id` was invalid - `file_under_review` — File passed is tombstoned for DLP review - `invalid_args` — Invalid arguments passed to endpoint - `too_many_ids` — The request specified both an external_id and a file, only one may be specified See https://docs.slack.dev/reference/methods/files.remote.remove */
|
|
1106
|
+
export const removeRemote: API.OperationMethod<
|
|
1107
|
+
RemoveRemoteRequest,
|
|
1108
|
+
RemoveRemoteResponse,
|
|
1109
|
+
RemoveRemoteError,
|
|
1110
|
+
SlackOpContext
|
|
1111
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1112
|
+
input: RemoveRemoteRequest,
|
|
1113
|
+
output: RemoveRemoteResponse,
|
|
1114
|
+
errors: [SlackError, SlackRateLimited],
|
|
1115
|
+
protocol: SlackProtocol,
|
|
1116
|
+
retry: Retry.Retry,
|
|
1117
|
+
}));
|
|
1118
|
+
|
|
1119
|
+
export type RevokePublicURLError = SlackOpError;
|
|
1120
|
+
/** Revokes public/external sharing access for a file Required scopes — bot: `files:write`; user: `files:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `file_not_found` — Value passed for `file` was invalid See https://docs.slack.dev/reference/methods/files.revokePublicURL */
|
|
1121
|
+
export const revokePublicURL: API.OperationMethod<
|
|
1122
|
+
RevokePublicURLRequest,
|
|
1123
|
+
RevokePublicURLResponse,
|
|
1124
|
+
RevokePublicURLError,
|
|
1125
|
+
SlackOpContext
|
|
1126
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1127
|
+
input: RevokePublicURLRequest,
|
|
1128
|
+
output: RevokePublicURLResponse,
|
|
1129
|
+
errors: [SlackError, SlackRateLimited],
|
|
1130
|
+
protocol: SlackProtocol,
|
|
1131
|
+
retry: Retry.Retry,
|
|
1132
|
+
}));
|
|
1133
|
+
|
|
1134
|
+
export type SharedPublicURLError = SlackOpError;
|
|
1135
|
+
/** Enables a file for public/external sharing. Required scopes — user: `files:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `file_not_found` — Value passed for `file` was invalid - `not_allowed` — Public sharing has been disabled for this team. You may see this error if you are creating an external link from a free or trial workspace. You can either upgrade to a [Paid Plan](https://app.slack.com/plans) or use `file.list` to get a `url_private_download` link, download the file with an application, and re-upload it somewhere it can be shared with users who are not members of your workspace. Be sure to pass the Slack [Bot token](/authentication/tokens#bot) to the request on the headers file when calling `url_private_download`. - `public_video_not_allowed` — Public sharing of videos is not available. A `Free` instance of Slack may encounter this error because free teams don't have the ability to share video files publicly. - `public_file_type_not_allowed` — Public sharing has been restricted for this file type. See https://docs.slack.dev/reference/methods/files.sharedPublicURL */
|
|
1136
|
+
export const sharedPublicURL: API.OperationMethod<
|
|
1137
|
+
SharedPublicURLRequest,
|
|
1138
|
+
SharedPublicURLResponse,
|
|
1139
|
+
SharedPublicURLError,
|
|
1140
|
+
SlackOpContext
|
|
1141
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1142
|
+
input: SharedPublicURLRequest,
|
|
1143
|
+
output: SharedPublicURLResponse,
|
|
1144
|
+
errors: [SlackError, SlackRateLimited],
|
|
1145
|
+
protocol: SlackProtocol,
|
|
1146
|
+
retry: Retry.Retry,
|
|
1147
|
+
}));
|
|
1148
|
+
|
|
1149
|
+
export type ShareRemoteError = SlackOpError;
|
|
1150
|
+
/** Share a remote file into a channel. Required scopes — bot: `remote_files:share`; user: `remote_files:share` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` — At least one of the values passed for `channels` was invalid. - `file_not_found` — No file with the requested ID found. - `invalid_args` — Invalid arguments passed to endpoint - `no_bot_user_for_app` — Cannot call the Remote Files endpoints unless app has associated bot user - `not_in_channel` — Authenticated user is not in at least one of the the provided channels. See https://docs.slack.dev/reference/methods/files.remote.share */
|
|
1151
|
+
export const shareRemote: API.OperationMethod<
|
|
1152
|
+
ShareRemoteRequest,
|
|
1153
|
+
ShareRemoteResponse,
|
|
1154
|
+
ShareRemoteError,
|
|
1155
|
+
SlackOpContext
|
|
1156
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1157
|
+
input: ShareRemoteRequest,
|
|
1158
|
+
output: ShareRemoteResponse,
|
|
1159
|
+
errors: [SlackError, SlackRateLimited],
|
|
1160
|
+
protocol: SlackProtocol,
|
|
1161
|
+
retry: Retry.Retry,
|
|
1162
|
+
}));
|
|
1163
|
+
|
|
1164
|
+
export type UpdateRemoteError = SlackOpError;
|
|
1165
|
+
/** Updates an existing remote file. Required scopes — bot: `remote_files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_image` — The uploaded image could not be processed - try passing a JPG or PNG - `bot_user_required` — bot user token is required - `failed_to_unshare` — The file was either not found or it has been unshared already. - `file_not_found` — Could not find the file to update. - `invalid_title` — invalid title provided - `invalid_type` — invalid type provided - `invalid_url` — invalid url provided - `too_large` — The uploaded image had excessive dimensions See https://docs.slack.dev/reference/methods/files.remote.update */
|
|
1166
|
+
export const updateRemote: API.OperationMethod<
|
|
1167
|
+
UpdateRemoteRequest,
|
|
1168
|
+
UpdateRemoteResponse,
|
|
1169
|
+
UpdateRemoteError,
|
|
1170
|
+
SlackOpContext
|
|
1171
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1172
|
+
input: UpdateRemoteRequest,
|
|
1173
|
+
output: UpdateRemoteResponse,
|
|
1174
|
+
errors: [SlackError, SlackRateLimited],
|
|
1175
|
+
protocol: SlackProtocol,
|
|
1176
|
+
retry: Retry.Retry,
|
|
1177
|
+
}));
|
|
1178
|
+
|
|
1179
|
+
export type UploadFileError = SlackOpError;
|
|
1180
|
+
/** Uploads or creates a file. Required scopes — bot: `files:write`; user: `files:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `blocked_file_type` — Admin has disabled uploading this type of file - `channel_not_found` — At least one of the values passed for `channels` was invalid. - `invalid_channel` — One or more channels supplied are invalid - `malware_detected` — This file may contain a virus or other malware and can't be uploaded to Slack - `not_in_channel` — Authenticated user is not in the channel. - `post_contents_too_large` — File content is larger than 130kb. - `posting_to_general_channel_denied` — An admin has restricted posting to the #general channel. - `slack_connect_blocked_file_type` — File uploads with certain types are blocked in all Slack Connect communications - `slack_connect_clip_sharing_blocked` — Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_file_upload_sharing_blocked` — Admin has disabled File uploads in all Slack Connect communications - `invalid_thread_ts` — Value passed to thread_ts was invalid - `method_deprecated` — This API is deprecated. Please refer to https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay See https://docs.slack.dev/reference/methods/files.upload */
|
|
1181
|
+
export const uploadFile: API.OperationMethod<
|
|
1182
|
+
UploadFileRequest,
|
|
1183
|
+
UploadFileResponse,
|
|
1184
|
+
UploadFileError,
|
|
1185
|
+
SlackOpContext
|
|
1186
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1187
|
+
input: UploadFileRequest,
|
|
1188
|
+
output: UploadFileResponse,
|
|
1189
|
+
errors: [SlackError, SlackRateLimited],
|
|
1190
|
+
protocol: SlackProtocol,
|
|
1191
|
+
retry: Retry.Retry,
|
|
1192
|
+
}));
|