1 |
|
2 |
|
3 |
|
4 | import type { Stream } from 'node:stream';
|
5 | import type { ExcludeFromUnion } from '../helpers';
|
6 | import type { FilesGetUploadURLExternalResponse } from '../response/index';
|
7 | import type { CursorPaginationEnabled, OptionalTeamAssignable, TokenOverridable, TraditionalPagingEnabled } from './common';
|
8 | export interface FileArgument {
|
9 |
|
10 | file: string;
|
11 | }
|
12 | export interface ExternalIDArgument {
|
13 |
|
14 | external_id: string;
|
15 | }
|
16 | export interface ChannelsArgument {
|
17 | |
18 |
|
19 |
|
20 |
|
21 | channels?: string;
|
22 | }
|
23 | export interface FileType {
|
24 | |
25 |
|
26 |
|
27 |
|
28 | filetype?: string;
|
29 | }
|
30 | export interface FileUploadComplete {
|
31 |
|
32 | id: string;
|
33 |
|
34 | title?: string;
|
35 | }
|
36 | export interface FileChannelDestinationArgument {
|
37 |
|
38 | channel_id?: string;
|
39 | thread_ts?: never;
|
40 | }
|
41 | export interface FileThreadDestinationArgument {
|
42 |
|
43 | channel_id: string;
|
44 |
|
45 | thread_ts: string;
|
46 | }
|
47 | type FileDestinationArgument = FileChannelDestinationArgument | FileThreadDestinationArgument;
|
48 | export interface FileChannelDestinationArgumentChannels extends ChannelsArgument {
|
49 | thread_ts?: never;
|
50 | }
|
51 | export interface FileThreadDestinationArgumentChannels extends Required<ChannelsArgument> {
|
52 |
|
53 | thread_ts: string;
|
54 | }
|
55 | type FileDestinationArgumentChannels = FileChannelDestinationArgumentChannels | FileThreadDestinationArgumentChannels;
|
56 | export type FilesCompleteUploadExternalArguments = FileDestinationArgument & TokenOverridable & {
|
57 |
|
58 | files: [FileUploadComplete, ...FileUploadComplete[]];
|
59 |
|
60 | initial_comment?: string;
|
61 | };
|
62 | export interface FilesDeleteArguments extends FileArgument, TokenOverridable {
|
63 | }
|
64 | export interface FilesGetUploadURLExternalArguments extends TokenOverridable {
|
65 |
|
66 | filename: string;
|
67 |
|
68 | length: number;
|
69 |
|
70 | alt_text?: string;
|
71 |
|
72 | snippet_type?: string;
|
73 | }
|
74 | export interface FilesInfoArguments extends FileArgument, TokenOverridable, CursorPaginationEnabled, TraditionalPagingEnabled {
|
75 | }
|
76 | export interface FilesListArguments extends TokenOverridable, TraditionalPagingEnabled, OptionalTeamAssignable {
|
77 |
|
78 | channel?: string;
|
79 | |
80 |
|
81 |
|
82 |
|
83 | show_files_hidden_by_limit?: boolean;
|
84 |
|
85 | ts_from?: string;
|
86 |
|
87 | ts_to?: string;
|
88 | |
89 |
|
90 |
|
91 |
|
92 |
|
93 | types?: string;
|
94 |
|
95 | user?: string;
|
96 | }
|
97 | export interface FilesRevokePublicURLArguments extends FileArgument, TokenOverridable {
|
98 | }
|
99 | export interface FilesSharedPublicURLArguments extends FileArgument, TokenOverridable {
|
100 | }
|
101 | export interface FileUploadStringContents {
|
102 |
|
103 | content: string;
|
104 | }
|
105 | export interface FileUploadBinaryContents {
|
106 | |
107 |
|
108 |
|
109 |
|
110 |
|
111 | file: Buffer | Stream | string;
|
112 | }
|
113 | type FileUploadContents = FileUploadStringContents | FileUploadBinaryContents;
|
114 | type FileUpload = FileUploadContents & (FileDestinationArgumentChannels | FileDestinationArgument) & FileType & {
|
115 |
|
116 | filename?: string;
|
117 |
|
118 | initial_comment?: string;
|
119 |
|
120 | title?: string;
|
121 | };
|
122 | export type FilesUploadArguments = FileUpload & TokenOverridable;
|
123 | export type FileUploadV2 = FileUpload & {
|
124 |
|
125 | alt_text?: string;
|
126 |
|
127 | channel_id?: string;
|
128 |
|
129 | channels?: string;
|
130 |
|
131 | snippet_type?: string;
|
132 | };
|
133 | export interface FilesUploadV2ArgumentsMultipleFiles {
|
134 | file_uploads: ExcludeFromUnion<FileUploadV2, 'channel_id' | 'channels' | 'initial_comment' | 'thread_ts'>[];
|
135 | }
|
136 | export type FilesUploadV2Arguments = TokenOverridable & (FileUploadV2 | (Omit<FileUploadV2, 'file' | 'content'> & FilesUploadV2ArgumentsMultipleFiles));
|
137 | export type FileUploadV2Job = FileUploadV2 & TokenOverridable & Pick<FilesGetUploadURLExternalResponse, 'file_id' | 'upload_url' | 'error'> & {
|
138 | length?: number;
|
139 | data?: Buffer;
|
140 | };
|
141 | export interface FilesCommentsDeleteArguments extends FileArgument, TokenOverridable {
|
142 |
|
143 | id: string;
|
144 | }
|
145 | export interface SharedFile {
|
146 |
|
147 | title: string;
|
148 |
|
149 | external_url: string;
|
150 |
|
151 | preview_image?: Buffer | Stream;
|
152 | |
153 |
|
154 |
|
155 |
|
156 | indexable_file_contents?: Buffer | Stream;
|
157 | }
|
158 | export interface FilesRemoteAddArguments extends SharedFile, FileType, ExternalIDArgument, TokenOverridable {
|
159 | }
|
160 | type FileOrExternalID = (FileArgument & {
|
161 | external_id?: never;
|
162 | }) | (ExternalIDArgument & {
|
163 | file?: never;
|
164 | });
|
165 | export type FilesRemoteInfoArguments = FileOrExternalID & TokenOverridable;
|
166 | export interface FilesRemoteListArguments extends TokenOverridable, CursorPaginationEnabled {
|
167 |
|
168 | channel?: string;
|
169 |
|
170 | ts_from?: string;
|
171 |
|
172 | ts_to?: string;
|
173 | }
|
174 | export type FilesRemoteRemoveArguments = FileOrExternalID & TokenOverridable;
|
175 | export type FilesRemoteShareArguments = Required<ChannelsArgument> & FileOrExternalID & TokenOverridable;
|
176 | export type FilesRemoteUpdateArguments = Partial<SharedFile> & FileOrExternalID & FileType & TokenOverridable;
|
177 | export {};
|
178 |
|
\ | No newline at end of file |