@atlaskit/media-client 17.1.3 → 18.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/CHANGELOG.md +22 -0
- package/dist/cjs/client/media-client.js +2 -2
- package/dist/cjs/client/media-store/index.js +22 -11
- package/dist/cjs/client/mobile-upload.js +1 -1
- package/dist/cjs/file-streams-cache.js +2 -2
- package/dist/cjs/index.js +0 -9
- package/dist/cjs/utils/getVideoDimensionsFromBlob.js +23 -19
- package/dist/cjs/utils/mobileUpload/servicesCache.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/media-client.js +2 -2
- package/dist/es2019/client/media-store/index.js +14 -5
- package/dist/es2019/client/mobile-upload.js +1 -1
- package/dist/es2019/file-streams-cache.js +2 -2
- package/dist/es2019/index.js +0 -2
- package/dist/es2019/utils/getVideoDimensionsFromBlob.js +21 -7
- package/dist/es2019/utils/mobileUpload/servicesCache.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/media-client.js +2 -2
- package/dist/esm/client/media-store/index.js +19 -10
- package/dist/esm/client/mobile-upload.js +1 -1
- package/dist/esm/file-streams-cache.js +2 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/utils/getVideoDimensionsFromBlob.js +21 -16
- package/dist/esm/utils/mobileUpload/servicesCache.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/client/media-client.d.ts +1 -1
- package/dist/types/client/media-store/index.d.ts +8 -1
- package/dist/types/file-streams-cache.d.ts +2 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/utils/getVideoDimensionsFromBlob.d.ts +3 -4
- package/dist/types/utils/mobileUpload/servicesCache.d.ts +2 -2
- package/dist/types/utils/request/helpers.d.ts +1 -1
- package/dist/types-ts4.0/client/media-client.d.ts +1 -1
- package/dist/types-ts4.0/client/media-store/index.d.ts +8 -1
- package/dist/types-ts4.0/file-streams-cache.d.ts +2 -2
- package/dist/types-ts4.0/index.d.ts +0 -1
- package/dist/types-ts4.0/utils/getVideoDimensionsFromBlob.d.ts +3 -4
- package/dist/types-ts4.0/utils/mobileUpload/servicesCache.d.ts +2 -2
- package/dist/types-ts4.0/utils/request/helpers.d.ts +1 -1
- package/example-helpers/styles.ts +9 -8
- package/package.json +14 -12
- package/report.api.md +807 -517
package/report.api.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
4
|
|
|
5
|
+
<!--
|
|
6
|
+
Generated API Report version: 2.0
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
10
|
+
|
|
5
11
|
```ts
|
|
6
12
|
import { AsapBasedAuth } from '@atlaskit/media-core';
|
|
7
13
|
import { Auth } from '@atlaskit/media-core';
|
|
@@ -10,7 +16,6 @@ import { AuthProvider } from '@atlaskit/media-core';
|
|
|
10
16
|
import { ChunkinatorFile } from '@atlaskit/chunkinator';
|
|
11
17
|
import { ClientAltBasedAuth } from '@atlaskit/media-core';
|
|
12
18
|
import { FileStatus as FileStatus_2 } from '@atlaskit/media-common';
|
|
13
|
-
import { LRUCache } from 'lru-fast';
|
|
14
19
|
import { MediaApiConfig } from '@atlaskit/media-core';
|
|
15
20
|
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
16
21
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
@@ -18,114 +23,141 @@ import { MediaType } from '@atlaskit/media-common';
|
|
|
18
23
|
import { default as React_2 } from 'react';
|
|
19
24
|
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
// @public (undocumented)
|
|
27
|
+
export type AbortFunction = () => void;
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
// @public (undocumented)
|
|
30
|
+
export const addFileAttrsToUrl: (
|
|
24
31
|
url: string,
|
|
25
32
|
fileAttrs: MediaBlobUrlAttrs,
|
|
26
33
|
) => string;
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
// @public (undocumented)
|
|
36
|
+
export type AppendChunksToUploadRequestBody = {
|
|
29
37
|
readonly chunks: string[];
|
|
30
38
|
readonly hash?: string;
|
|
31
39
|
readonly offset?: number;
|
|
32
40
|
};
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
// @public (undocumented)
|
|
43
|
+
export type Artifacts = {
|
|
35
44
|
[name: string]: MediaArtifact;
|
|
36
45
|
};
|
|
37
46
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
declare abstract class BaseMediaClientError<
|
|
47
|
+
// @public
|
|
48
|
+
abstract class BaseMediaClientError<
|
|
42
49
|
Attributes extends MediaClientErrorAttributes
|
|
43
50
|
>
|
|
44
51
|
extends Error
|
|
45
52
|
implements MediaClientError<Attributes> {
|
|
46
|
-
readonly message: string;
|
|
47
53
|
constructor(message: string);
|
|
54
|
+
// (undocumented)
|
|
48
55
|
abstract get attributes(): Attributes;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
readonly message: string;
|
|
49
58
|
}
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export const checkWebpSupport: () => Promise<boolean>;
|
|
52
62
|
|
|
53
|
-
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export type ClientOptions = {
|
|
54
65
|
readonly retryOptions?: Partial<RetryOptions>;
|
|
55
66
|
readonly clientTimeout?: number;
|
|
56
67
|
};
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
// @public (undocumented)
|
|
70
|
+
export class CollectionFetcher {
|
|
60
71
|
constructor(mediaStore: MediaStore);
|
|
61
|
-
|
|
62
|
-
private populateCache;
|
|
63
|
-
private removeFromCache;
|
|
72
|
+
// (undocumented)
|
|
64
73
|
getItems(
|
|
65
74
|
collectionName: string,
|
|
66
75
|
params?: MediaStoreGetCollectionItemsParams,
|
|
67
76
|
): MediaSubscribable<MediaCollectionItem[]>;
|
|
77
|
+
// (undocumented)
|
|
78
|
+
loadNextPage(
|
|
79
|
+
collectionName: string,
|
|
80
|
+
params?: MediaStoreGetCollectionItemsParams,
|
|
81
|
+
): Promise<void>;
|
|
82
|
+
// (undocumented)
|
|
83
|
+
readonly mediaStore: MediaStore;
|
|
84
|
+
// (undocumented)
|
|
68
85
|
removeFile(
|
|
69
86
|
id: string,
|
|
70
87
|
collectionName: string,
|
|
71
88
|
occurrenceKey?: string,
|
|
72
89
|
): Promise<void>;
|
|
73
|
-
loadNextPage(
|
|
74
|
-
collectionName: string,
|
|
75
|
-
params?: MediaStoreGetCollectionItemsParams,
|
|
76
|
-
): Promise<void>;
|
|
77
90
|
}
|
|
78
91
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
92
|
+
// @public (undocumented)
|
|
93
|
+
type CompletionObserver<T> = PartialObserver<T> &
|
|
94
|
+
Required<Pick<PartialObserver<T>, 'complete'>>;
|
|
82
95
|
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
// @public (undocumented)
|
|
97
|
+
export interface CopyDestination extends MediaStoreCopyFileWithTokenParams {
|
|
98
|
+
// (undocumented)
|
|
85
99
|
authProvider: AuthProvider;
|
|
100
|
+
// (undocumented)
|
|
86
101
|
mediaStore?: MediaStore;
|
|
87
102
|
}
|
|
88
103
|
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
// @public (undocumented)
|
|
105
|
+
export interface CopyFileOptions {
|
|
106
|
+
// (undocumented)
|
|
91
107
|
mimeType?: string;
|
|
108
|
+
// (undocumented)
|
|
109
|
+
preview?: FilePreview | Promise<FilePreview>;
|
|
92
110
|
}
|
|
93
111
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
112
|
+
// @public (undocumented)
|
|
113
|
+
export interface CopySourceFile {
|
|
114
|
+
// (undocumented)
|
|
97
115
|
authProvider: AuthProvider;
|
|
116
|
+
// (undocumented)
|
|
117
|
+
collection?: string;
|
|
118
|
+
// (undocumented)
|
|
119
|
+
id: string;
|
|
98
120
|
}
|
|
99
121
|
|
|
100
|
-
|
|
122
|
+
// @public (undocumented)
|
|
123
|
+
export interface CreatedTouchedFile {
|
|
124
|
+
// (undocumented)
|
|
101
125
|
fileId: string;
|
|
126
|
+
// (undocumented)
|
|
102
127
|
uploadId: string;
|
|
103
128
|
}
|
|
104
129
|
|
|
105
|
-
|
|
130
|
+
// @public (undocumented)
|
|
131
|
+
export function createMediaSubject<T extends MediaSubscribableItem>(
|
|
106
132
|
initialState?: T | Error,
|
|
107
133
|
): ReplaySubject<T>;
|
|
108
134
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
135
|
+
// @public (undocumented)
|
|
136
|
+
export function createMediaSubscribable<T extends MediaSubscribableItem>(
|
|
137
|
+
mediaSubscribableItem?: T | Error,
|
|
138
|
+
): MediaSubscribable<T>;
|
|
112
139
|
|
|
113
|
-
|
|
140
|
+
// @public (undocumented)
|
|
141
|
+
export function createUrl(
|
|
114
142
|
url: string,
|
|
115
143
|
{ params, auth }: CreateUrlOptions,
|
|
116
144
|
): string;
|
|
117
145
|
|
|
118
|
-
|
|
146
|
+
// @public (undocumented)
|
|
147
|
+
export type CreateUrlOptions = {
|
|
119
148
|
readonly params?: RequestParams;
|
|
120
149
|
readonly auth?: Auth;
|
|
121
150
|
};
|
|
122
151
|
|
|
123
|
-
|
|
152
|
+
// @public (undocumented)
|
|
153
|
+
export type Dimensions = {
|
|
124
154
|
width: number;
|
|
125
155
|
height: number;
|
|
126
156
|
};
|
|
127
157
|
|
|
128
|
-
|
|
158
|
+
// @public (undocumented)
|
|
159
|
+
export interface EdgeData {
|
|
160
|
+
// (undocumented)
|
|
129
161
|
data: {
|
|
130
162
|
clientId: string;
|
|
131
163
|
token: string;
|
|
@@ -135,106 +167,134 @@ export declare interface EdgeData {
|
|
|
135
167
|
};
|
|
136
168
|
}
|
|
137
169
|
|
|
138
|
-
|
|
139
|
-
|
|
170
|
+
// @public (undocumented)
|
|
171
|
+
export interface EmptyFile {
|
|
172
|
+
// (undocumented)
|
|
140
173
|
readonly createdAt: number;
|
|
174
|
+
// (undocumented)
|
|
175
|
+
readonly id: string;
|
|
141
176
|
}
|
|
142
177
|
|
|
143
|
-
|
|
144
|
-
|
|
178
|
+
// @public (undocumented)
|
|
179
|
+
export interface ErrorFileState {
|
|
180
|
+
// (undocumented)
|
|
145
181
|
id: string;
|
|
146
|
-
|
|
182
|
+
// (undocumented)
|
|
147
183
|
message?: string;
|
|
184
|
+
// (undocumented)
|
|
185
|
+
occurrenceKey?: string;
|
|
186
|
+
// (undocumented)
|
|
187
|
+
status: 'error';
|
|
148
188
|
}
|
|
149
189
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
> &
|
|
190
|
+
// @public (undocumented)
|
|
191
|
+
type ErrorObserver<T> = PartialObserver<T> &
|
|
153
192
|
Required<Pick<PartialObserver<T>, 'error'>>;
|
|
154
193
|
|
|
155
|
-
|
|
194
|
+
// @public (undocumented)
|
|
195
|
+
export type EventPayloadListener<
|
|
156
196
|
M extends EventPayloadMap<P>,
|
|
157
197
|
E extends keyof M,
|
|
158
198
|
P = any
|
|
159
199
|
> = (payload: M[E]) => void;
|
|
160
200
|
|
|
161
|
-
|
|
201
|
+
// @public (undocumented)
|
|
202
|
+
type EventPayloadMap<P> = {
|
|
162
203
|
readonly [event: string]: P;
|
|
163
204
|
};
|
|
164
205
|
|
|
165
|
-
|
|
206
|
+
// @public (undocumented)
|
|
207
|
+
export type Executor = () => Promise<void>;
|
|
166
208
|
|
|
167
|
-
|
|
168
|
-
|
|
209
|
+
// @public (undocumented)
|
|
210
|
+
export interface ExternalImageIdentifier {
|
|
211
|
+
// (undocumented)
|
|
169
212
|
readonly dataURI: string;
|
|
213
|
+
// (undocumented)
|
|
214
|
+
readonly mediaItemType: 'external-image';
|
|
215
|
+
// (undocumented)
|
|
170
216
|
readonly name?: string;
|
|
171
217
|
}
|
|
172
218
|
|
|
173
|
-
|
|
219
|
+
// @public (undocumented)
|
|
220
|
+
type ExternalUploadPayload = {
|
|
174
221
|
uploadableFileUpfrontIds: UploadableFileUpfrontIds;
|
|
175
222
|
dimensions: Dimensions;
|
|
176
223
|
};
|
|
177
224
|
|
|
178
|
-
|
|
225
|
+
// @public (undocumented)
|
|
226
|
+
export interface FileDetails {
|
|
227
|
+
// (undocumented)
|
|
228
|
+
artifacts?: Artifacts;
|
|
229
|
+
// (undocumented)
|
|
230
|
+
createdAt?: number;
|
|
231
|
+
// (undocumented)
|
|
232
|
+
creationDate?: number;
|
|
233
|
+
// (undocumented)
|
|
179
234
|
id: string;
|
|
180
|
-
|
|
181
|
-
size?: number;
|
|
182
|
-
mimeType?: string;
|
|
235
|
+
// (undocumented)
|
|
183
236
|
mediaType?: MediaType;
|
|
184
|
-
|
|
237
|
+
// (undocumented)
|
|
238
|
+
mimeType?: string;
|
|
239
|
+
// (undocumented)
|
|
240
|
+
name?: string;
|
|
241
|
+
// (undocumented)
|
|
185
242
|
processingStatus?: FileProcessingStatus;
|
|
186
|
-
|
|
187
|
-
|
|
243
|
+
// (undocumented)
|
|
244
|
+
size?: number;
|
|
188
245
|
}
|
|
189
246
|
|
|
190
|
-
|
|
191
|
-
|
|
247
|
+
// @public (undocumented)
|
|
248
|
+
export interface FileFetcher {
|
|
249
|
+
// (undocumented)
|
|
250
|
+
copyFile(
|
|
251
|
+
source: CopySourceFile,
|
|
252
|
+
destination: CopyDestination,
|
|
253
|
+
options?: CopyFileOptions,
|
|
254
|
+
): Promise<MediaFile>;
|
|
255
|
+
// (undocumented)
|
|
256
|
+
downloadBinary(
|
|
192
257
|
id: string,
|
|
193
|
-
|
|
194
|
-
|
|
258
|
+
name?: string,
|
|
259
|
+
collectionName?: string,
|
|
260
|
+
): Promise<void>;
|
|
261
|
+
// (undocumented)
|
|
195
262
|
getArtifactURL(
|
|
196
263
|
artifacts: MediaFileArtifacts,
|
|
197
264
|
artifactName: keyof MediaFileArtifacts,
|
|
198
265
|
collectionName?: string,
|
|
199
266
|
): Promise<string>;
|
|
267
|
+
// (undocumented)
|
|
268
|
+
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
269
|
+
// (undocumented)
|
|
270
|
+
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
271
|
+
// (undocumented)
|
|
272
|
+
getFileState(
|
|
273
|
+
id: string,
|
|
274
|
+
options?: GetFileOptions,
|
|
275
|
+
): MediaSubscribable<FileState>;
|
|
276
|
+
// (undocumented)
|
|
200
277
|
touchFiles(
|
|
201
278
|
descriptors: TouchFileDescriptor[],
|
|
202
279
|
collection?: string,
|
|
203
280
|
): Promise<TouchedFiles>;
|
|
281
|
+
// (undocumented)
|
|
204
282
|
upload(
|
|
205
283
|
file: UploadableFile,
|
|
206
284
|
controller?: UploadController,
|
|
207
285
|
uploadableFileUpfrontIds?: UploadableFileUpfrontIds,
|
|
208
286
|
): MediaSubscribable<FileState>;
|
|
287
|
+
// (undocumented)
|
|
209
288
|
uploadExternal(
|
|
210
289
|
url: string,
|
|
211
290
|
collection?: string,
|
|
212
291
|
): Promise<ExternalUploadPayload>;
|
|
213
|
-
downloadBinary(
|
|
214
|
-
id: string,
|
|
215
|
-
name?: string,
|
|
216
|
-
collectionName?: string,
|
|
217
|
-
): Promise<void>;
|
|
218
|
-
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
219
|
-
copyFile(
|
|
220
|
-
source: CopySourceFile,
|
|
221
|
-
destination: CopyDestination,
|
|
222
|
-
options?: CopyFileOptions,
|
|
223
|
-
): Promise<MediaFile>;
|
|
224
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
225
292
|
}
|
|
226
293
|
|
|
227
|
-
|
|
294
|
+
// @public (undocumented)
|
|
295
|
+
export class FileFetcherError extends BaseMediaClientError<
|
|
228
296
|
FileFetcherErrorAttributes
|
|
229
297
|
> {
|
|
230
|
-
readonly reason: FileFetcherErrorReason;
|
|
231
|
-
readonly id: string;
|
|
232
|
-
readonly metadata?:
|
|
233
|
-
| {
|
|
234
|
-
readonly collectionName?: string | undefined;
|
|
235
|
-
readonly occurrenceKey?: string | undefined;
|
|
236
|
-
}
|
|
237
|
-
| undefined;
|
|
238
298
|
constructor(
|
|
239
299
|
reason: FileFetcherErrorReason,
|
|
240
300
|
id: string,
|
|
@@ -245,15 +305,28 @@ export declare class FileFetcherError extends BaseMediaClientError<
|
|
|
245
305
|
}
|
|
246
306
|
| undefined,
|
|
247
307
|
);
|
|
308
|
+
// (undocumented)
|
|
248
309
|
get attributes(): {
|
|
249
310
|
reason: FileFetcherErrorReason;
|
|
250
311
|
id: string;
|
|
251
312
|
collectionName: string | undefined;
|
|
252
313
|
occurrenceKey: string | undefined;
|
|
253
314
|
};
|
|
315
|
+
// (undocumented)
|
|
316
|
+
readonly id: string;
|
|
317
|
+
// (undocumented)
|
|
318
|
+
readonly metadata?:
|
|
319
|
+
| {
|
|
320
|
+
readonly collectionName?: string | undefined;
|
|
321
|
+
readonly occurrenceKey?: string | undefined;
|
|
322
|
+
}
|
|
323
|
+
| undefined;
|
|
324
|
+
// (undocumented)
|
|
325
|
+
readonly reason: FileFetcherErrorReason;
|
|
254
326
|
}
|
|
255
327
|
|
|
256
|
-
|
|
328
|
+
// @public (undocumented)
|
|
329
|
+
export type FileFetcherErrorAttributes = {
|
|
257
330
|
readonly reason: FileFetcherErrorReason;
|
|
258
331
|
readonly id: string;
|
|
259
332
|
readonly metadata?: {
|
|
@@ -262,128 +335,160 @@ export declare type FileFetcherErrorAttributes = {
|
|
|
262
335
|
};
|
|
263
336
|
};
|
|
264
337
|
|
|
265
|
-
|
|
338
|
+
// @public (undocumented)
|
|
339
|
+
export type FileFetcherErrorReason =
|
|
266
340
|
| 'invalidFileId'
|
|
267
341
|
| 'emptyItems'
|
|
268
342
|
| 'zeroVersionFile';
|
|
269
343
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
private readonly dataloader;
|
|
344
|
+
// @public (undocumented)
|
|
345
|
+
export class FileFetcherImpl implements FileFetcher {
|
|
273
346
|
constructor(mediaStore: MediaStore);
|
|
274
|
-
|
|
347
|
+
// (undocumented)
|
|
348
|
+
copyFile(
|
|
349
|
+
source: CopySourceFile,
|
|
350
|
+
destination: CopyDestination,
|
|
351
|
+
options?: CopyFileOptions,
|
|
352
|
+
): Promise<MediaFile>;
|
|
353
|
+
// (undocumented)
|
|
354
|
+
downloadBinary(
|
|
275
355
|
id: string,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
356
|
+
name?: string,
|
|
357
|
+
collectionName?: string,
|
|
358
|
+
): Promise<void>;
|
|
359
|
+
// (undocumented)
|
|
279
360
|
getArtifactURL(
|
|
280
361
|
artifacts: MediaFileArtifacts,
|
|
281
362
|
artifactName: keyof MediaFileArtifacts,
|
|
282
363
|
collectionName?: string,
|
|
283
364
|
): Promise<string>;
|
|
365
|
+
// (undocumented)
|
|
366
|
+
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
367
|
+
// (undocumented)
|
|
284
368
|
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
285
|
-
|
|
369
|
+
// (undocumented)
|
|
370
|
+
getFileState(
|
|
371
|
+
id: string,
|
|
372
|
+
options?: GetFileOptions,
|
|
373
|
+
): MediaSubscribable<FileState>;
|
|
374
|
+
// (undocumented)
|
|
286
375
|
touchFiles(
|
|
287
376
|
descriptors: TouchFileDescriptor[],
|
|
288
377
|
collection?: string,
|
|
289
378
|
): Promise<TouchedFiles>;
|
|
290
|
-
|
|
291
|
-
uploadExternal(
|
|
292
|
-
url: string,
|
|
293
|
-
collection?: string,
|
|
294
|
-
): Promise<ExternalUploadPayload>;
|
|
379
|
+
// (undocumented)
|
|
295
380
|
upload(
|
|
296
381
|
file: UploadableFile,
|
|
297
382
|
controller?: UploadController,
|
|
298
383
|
uploadableFileUpfrontIds?: UploadableFileUpfrontIds,
|
|
299
384
|
): MediaSubscribable<FileState>;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
): Promise<
|
|
305
|
-
copyFile(
|
|
306
|
-
source: CopySourceFile,
|
|
307
|
-
destination: CopyDestination,
|
|
308
|
-
options?: CopyFileOptions,
|
|
309
|
-
): Promise<MediaFile>;
|
|
385
|
+
// (undocumented)
|
|
386
|
+
uploadExternal(
|
|
387
|
+
url: string,
|
|
388
|
+
collection?: string,
|
|
389
|
+
): Promise<ExternalUploadPayload>;
|
|
310
390
|
}
|
|
311
391
|
|
|
312
|
-
|
|
313
|
-
|
|
392
|
+
// @public (undocumented)
|
|
393
|
+
export interface FileIdentifier {
|
|
394
|
+
// (undocumented)
|
|
395
|
+
readonly collectionName?: string;
|
|
396
|
+
// (undocumented)
|
|
314
397
|
readonly id: string;
|
|
398
|
+
// (undocumented)
|
|
399
|
+
readonly mediaItemType: 'file';
|
|
400
|
+
// (undocumented)
|
|
315
401
|
readonly occurrenceKey?: string;
|
|
316
|
-
readonly collectionName?: string;
|
|
317
402
|
}
|
|
318
403
|
|
|
319
|
-
|
|
320
|
-
|
|
404
|
+
// @public (undocumented)
|
|
405
|
+
export interface FileItem {
|
|
406
|
+
// (undocumented)
|
|
321
407
|
details: FileDetails;
|
|
408
|
+
// (undocumented)
|
|
409
|
+
type: 'file';
|
|
322
410
|
}
|
|
323
411
|
|
|
324
|
-
|
|
325
|
-
|
|
412
|
+
// @public (undocumented)
|
|
413
|
+
export interface FilePreview {
|
|
414
|
+
// (undocumented)
|
|
326
415
|
origin?: 'local' | 'remote';
|
|
416
|
+
// (undocumented)
|
|
327
417
|
originalDimensions?: {
|
|
328
418
|
width: number;
|
|
329
419
|
height: number;
|
|
330
420
|
};
|
|
421
|
+
// (undocumented)
|
|
422
|
+
value: Blob | string;
|
|
331
423
|
}
|
|
332
424
|
|
|
333
|
-
|
|
425
|
+
// @public (undocumented)
|
|
426
|
+
export type FileProcessingStatus =
|
|
334
427
|
| 'pending'
|
|
335
428
|
| 'running'
|
|
336
429
|
| 'succeeded'
|
|
337
430
|
| 'failed';
|
|
338
431
|
|
|
339
|
-
|
|
432
|
+
// @public (undocumented)
|
|
433
|
+
export type FileState =
|
|
340
434
|
| UploadingFileState
|
|
341
435
|
| ProcessingFileState
|
|
342
436
|
| ProcessedFileState
|
|
343
437
|
| ErrorFileState
|
|
344
438
|
| ProcessingFailedState;
|
|
345
439
|
|
|
346
|
-
|
|
440
|
+
// @public (undocumented)
|
|
441
|
+
export type FileStatus = FileStatus_2;
|
|
347
442
|
|
|
348
|
-
|
|
443
|
+
// @public (undocumented)
|
|
444
|
+
export const getArtifactUrl: (
|
|
349
445
|
artifacts: MediaFileArtifacts,
|
|
350
446
|
prop: keyof MediaFileArtifacts,
|
|
351
447
|
) => string | undefined;
|
|
352
448
|
|
|
353
|
-
|
|
449
|
+
// @public (undocumented)
|
|
450
|
+
export const getAttrsFromUrl: (
|
|
354
451
|
blobUrl: string,
|
|
355
452
|
) => MediaBlobUrlAttrs | undefined;
|
|
356
453
|
|
|
357
|
-
|
|
454
|
+
// @public (undocumented)
|
|
455
|
+
export const getDimensionsFromBlob: (
|
|
358
456
|
mediaType: MediaType,
|
|
359
457
|
blob: Blob,
|
|
360
458
|
) => Promise<Dimensions>;
|
|
361
459
|
|
|
362
|
-
|
|
363
|
-
|
|
460
|
+
// @public (undocumented)
|
|
461
|
+
export interface GetFileOptions {
|
|
462
|
+
// (undocumented)
|
|
364
463
|
collectionName?: string;
|
|
464
|
+
// (undocumented)
|
|
365
465
|
occurrenceKey?: string;
|
|
466
|
+
// (undocumented)
|
|
467
|
+
preview?: PreviewOptions;
|
|
366
468
|
}
|
|
367
469
|
|
|
368
|
-
|
|
470
|
+
// @public (undocumented)
|
|
471
|
+
export const getMediaClient: (
|
|
369
472
|
mediaClientConfig: MediaClientConfig,
|
|
370
473
|
featureFlags?: MediaFeatureFlags | undefined,
|
|
371
474
|
) => MediaClient;
|
|
372
475
|
|
|
373
|
-
|
|
476
|
+
// @public (undocumented)
|
|
477
|
+
export function getMediaClientErrorReason(
|
|
374
478
|
err: Error,
|
|
375
479
|
): MediaClientErrorReason | 'unknown';
|
|
376
480
|
|
|
377
|
-
|
|
481
|
+
// @public (undocumented)
|
|
482
|
+
export const getMediaEnvironment: () => string | undefined;
|
|
378
483
|
|
|
379
|
-
|
|
484
|
+
// @public (undocumented)
|
|
485
|
+
export const getMediaRegion: () => string | undefined;
|
|
380
486
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
*/
|
|
384
|
-
export declare const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
|
|
487
|
+
// @public @deprecated (undocumented)
|
|
488
|
+
export const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
|
|
385
489
|
|
|
386
|
-
|
|
490
|
+
// @public (undocumented)
|
|
491
|
+
export const globalMediaEventEmitter: {
|
|
387
492
|
on<E extends keyof UploadEventPayloadMap>(
|
|
388
493
|
event: E,
|
|
389
494
|
listener: EventPayloadListener<UploadEventPayloadMap, E, any>,
|
|
@@ -398,129 +503,119 @@ export declare const globalMediaEventEmitter: {
|
|
|
398
503
|
): boolean | undefined;
|
|
399
504
|
};
|
|
400
505
|
|
|
401
|
-
|
|
506
|
+
// @public (undocumented)
|
|
507
|
+
export type Identifier = FileIdentifier | ExternalImageIdentifier;
|
|
402
508
|
|
|
403
|
-
|
|
509
|
+
// @public (undocumented)
|
|
510
|
+
export interface ImageMetadata {
|
|
511
|
+
// (undocumented)
|
|
512
|
+
original?: ImageMetadataArtifact;
|
|
513
|
+
// (undocumented)
|
|
404
514
|
pending: boolean;
|
|
515
|
+
// (undocumented)
|
|
405
516
|
preview?: ImageMetadataArtifact;
|
|
406
|
-
original?: ImageMetadataArtifact;
|
|
407
517
|
}
|
|
408
518
|
|
|
409
|
-
|
|
519
|
+
// @public (undocumented)
|
|
520
|
+
export type ImageMetadataArtifact = {
|
|
410
521
|
url?: string;
|
|
411
522
|
width?: number;
|
|
412
523
|
height?: number;
|
|
413
524
|
size?: number;
|
|
414
525
|
};
|
|
415
526
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
| 'fit'
|
|
419
|
-
| 'full-fit'
|
|
420
|
-
| 'stretchy-fit';
|
|
527
|
+
// @public (undocumented)
|
|
528
|
+
export type ImageResizeMode = 'crop' | 'fit' | 'full-fit' | 'stretchy-fit';
|
|
421
529
|
|
|
422
|
-
|
|
530
|
+
// @public (undocumented)
|
|
531
|
+
export const imageResizeModeToFileImageMode: (
|
|
423
532
|
resizeMode?: ImageResizeMode | undefined,
|
|
424
533
|
) => MediaStoreGetFileImageParams['mode'];
|
|
425
534
|
|
|
426
|
-
|
|
535
|
+
// @public (undocumented)
|
|
536
|
+
export function isAbortedRequestError(err: any): boolean;
|
|
427
537
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
*/
|
|
431
|
-
export declare const isAudioMimeTypeSupportedByServer: (
|
|
432
|
-
mimeType: string,
|
|
433
|
-
) => boolean;
|
|
538
|
+
// @public @deprecated (undocumented)
|
|
539
|
+
export const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
434
540
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
b: Identifier,
|
|
438
|
-
) => boolean;
|
|
541
|
+
// @public (undocumented)
|
|
542
|
+
export const isDifferentIdentifier: (a: Identifier, b: Identifier) => boolean;
|
|
439
543
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
*/
|
|
443
|
-
export declare const isDocumentMimeTypeSupportedByBrowser: (
|
|
544
|
+
// @public @deprecated (undocumented)
|
|
545
|
+
export const isDocumentMimeTypeSupportedByBrowser: (
|
|
444
546
|
mimeType: string,
|
|
445
547
|
) => boolean;
|
|
446
548
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
*/
|
|
450
|
-
export declare const isDocumentMimeTypeSupportedByServer: (
|
|
451
|
-
mimeType: string,
|
|
452
|
-
) => boolean;
|
|
549
|
+
// @public @deprecated (undocumented)
|
|
550
|
+
export const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
453
551
|
|
|
454
|
-
|
|
552
|
+
// @public (undocumented)
|
|
553
|
+
export const isErrorFileState: (
|
|
455
554
|
fileState: FileState,
|
|
456
555
|
) => fileState is ErrorFileState;
|
|
457
556
|
|
|
458
|
-
|
|
557
|
+
// @public (undocumented)
|
|
558
|
+
export const isExternalImageIdentifier: (
|
|
459
559
|
identifier: Identifier,
|
|
460
560
|
) => identifier is ExternalImageIdentifier;
|
|
461
561
|
|
|
462
|
-
|
|
562
|
+
// @public (undocumented)
|
|
563
|
+
export function isFileFetcherError(err: Error): err is FileFetcherError;
|
|
463
564
|
|
|
464
|
-
|
|
565
|
+
// @public (undocumented)
|
|
566
|
+
export const isFileIdentifier: (
|
|
465
567
|
identifier: Identifier,
|
|
466
568
|
) => identifier is FileIdentifier;
|
|
467
569
|
|
|
468
|
-
|
|
570
|
+
// @public (undocumented)
|
|
571
|
+
export const isFinalFileState: (
|
|
469
572
|
fileState: FileState,
|
|
470
573
|
) => fileState is ProcessedFileState | ProcessingFailedState | ErrorFileState;
|
|
471
574
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
*/
|
|
475
|
-
export declare const isImageMimeTypeSupportedByBrowser: (
|
|
476
|
-
mimeType: string,
|
|
477
|
-
) => boolean;
|
|
575
|
+
// @public @deprecated (undocumented)
|
|
576
|
+
export const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
478
577
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
*/
|
|
482
|
-
export declare const isImageMimeTypeSupportedByServer: (
|
|
483
|
-
mimeType: string,
|
|
484
|
-
) => boolean;
|
|
578
|
+
// @public @deprecated (undocumented)
|
|
579
|
+
export const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
485
580
|
|
|
486
|
-
|
|
581
|
+
// @public (undocumented)
|
|
582
|
+
export const isImageRemote: (
|
|
487
583
|
imageUrl: string,
|
|
488
584
|
windowOrigin?: string,
|
|
489
585
|
) => boolean;
|
|
490
586
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
) => boolean;
|
|
587
|
+
// @public (undocumented)
|
|
588
|
+
export const isImageRepresentationReady: (fileState: FileState) => boolean;
|
|
494
589
|
|
|
495
|
-
|
|
590
|
+
// @public (undocumented)
|
|
591
|
+
export const isMediaBlobUrl: (url: string) => boolean;
|
|
496
592
|
|
|
497
|
-
|
|
593
|
+
// @public (undocumented)
|
|
594
|
+
export function isMediaClientError(
|
|
498
595
|
error: any,
|
|
499
596
|
): error is MediaClientError<{
|
|
500
597
|
reason: MediaClientErrorReason;
|
|
501
598
|
}>;
|
|
502
599
|
|
|
503
|
-
|
|
600
|
+
// @public (undocumented)
|
|
601
|
+
export const isMediaCollectionItemFullDetails: (
|
|
504
602
|
mediaCollectionItem: MediaCollectionItemDetails,
|
|
505
603
|
) => mediaCollectionItem is MediaCollectionItemFullDetails;
|
|
506
604
|
|
|
507
|
-
|
|
605
|
+
// @public (undocumented)
|
|
606
|
+
export function isMediaStoreError(err: Error): err is MediaStoreError;
|
|
508
607
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
*/
|
|
512
|
-
export declare const isMimeTypeSupportedByBrowser: (
|
|
513
|
-
mimeType: string,
|
|
514
|
-
) => boolean;
|
|
608
|
+
// @public @deprecated (undocumented)
|
|
609
|
+
export const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
515
610
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
*/
|
|
519
|
-
export declare const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
611
|
+
// @public @deprecated (undocumented)
|
|
612
|
+
export const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
520
613
|
|
|
521
|
-
|
|
614
|
+
// @public (undocumented)
|
|
615
|
+
export function isPollingError(err?: Error): err is PollingError;
|
|
522
616
|
|
|
523
|
-
|
|
617
|
+
// @public (undocumented)
|
|
618
|
+
export const isPreviewableFileState: (
|
|
524
619
|
fileState: FileState,
|
|
525
620
|
) => fileState is (
|
|
526
621
|
| UploadingFileState
|
|
@@ -530,92 +625,100 @@ export declare const isPreviewableFileState: (
|
|
|
530
625
|
) &
|
|
531
626
|
PreviewableFileState;
|
|
532
627
|
|
|
533
|
-
|
|
628
|
+
// @public (undocumented)
|
|
629
|
+
export const isPreviewableType: (
|
|
534
630
|
type: MediaType,
|
|
535
631
|
featureFlags?: MediaFeatureFlags | undefined,
|
|
536
632
|
) => boolean;
|
|
537
633
|
|
|
538
|
-
|
|
634
|
+
// @public (undocumented)
|
|
635
|
+
export const isProcessedFileState: (
|
|
539
636
|
fileState: FileState,
|
|
540
637
|
) => fileState is ProcessedFileState;
|
|
541
638
|
|
|
542
|
-
|
|
639
|
+
// @public (undocumented)
|
|
640
|
+
export const isProcessingFileState: (
|
|
543
641
|
fileState: FileState,
|
|
544
642
|
) => fileState is ProcessingFileState;
|
|
545
643
|
|
|
546
|
-
|
|
644
|
+
// @public (undocumented)
|
|
645
|
+
export function isRateLimitedError(error: Error | undefined): boolean;
|
|
547
646
|
|
|
548
|
-
|
|
647
|
+
// @public (undocumented)
|
|
648
|
+
export function isRequestError(err: Error): err is RequestError;
|
|
549
649
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
*/
|
|
553
|
-
export declare const isUnknownMimeTypeSupportedByServer: (
|
|
554
|
-
mimeType: string,
|
|
555
|
-
) => boolean;
|
|
650
|
+
// @public @deprecated (undocumented)
|
|
651
|
+
export const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
556
652
|
|
|
557
|
-
|
|
653
|
+
// @public (undocumented)
|
|
654
|
+
export const isUploadingFileState: (
|
|
558
655
|
fileState: FileState,
|
|
559
656
|
) => fileState is UploadingFileState;
|
|
560
657
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
*/
|
|
564
|
-
export declare const isVideoMimeTypeSupportedByServer: (
|
|
565
|
-
mimeType: string,
|
|
566
|
-
) => boolean;
|
|
658
|
+
// @public @deprecated (undocumented)
|
|
659
|
+
export const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
567
660
|
|
|
568
|
-
|
|
661
|
+
// @public (undocumented)
|
|
662
|
+
export interface ItemsPayload {
|
|
663
|
+
// (undocumented)
|
|
569
664
|
items: ResponseFileItem[];
|
|
570
665
|
}
|
|
571
666
|
|
|
572
|
-
|
|
667
|
+
// @public (undocumented)
|
|
668
|
+
export const mapMediaFileToFileState: (
|
|
573
669
|
mediaFile: MediaStoreResponse<MediaFile>,
|
|
574
670
|
) => FileState;
|
|
575
671
|
|
|
576
|
-
|
|
672
|
+
// @public (undocumented)
|
|
673
|
+
export const mapMediaItemToFileState: (
|
|
577
674
|
id: string,
|
|
578
675
|
item: MediaCollectionItemFullDetails,
|
|
579
676
|
) => FileState;
|
|
580
677
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
* TODO: https://product-fabric.atlassian.net/browse/BMPT-1354
|
|
584
|
-
*/
|
|
585
|
-
export declare function mapResponseToBlob(response: Response): Promise<Blob>;
|
|
678
|
+
// @public @deprecated (undocumented)
|
|
679
|
+
export function mapResponseToBlob(response: Response): Promise<Blob>;
|
|
586
680
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
* TODO: https://product-fabric.atlassian.net/browse/BMPT-1354
|
|
590
|
-
*/
|
|
591
|
-
export declare function mapResponseToJson(response: Response): Promise<any>;
|
|
681
|
+
// @public @deprecated (undocumented)
|
|
682
|
+
export function mapResponseToJson(response: Response): Promise<any>;
|
|
592
683
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
* TODO: https://product-fabric.atlassian.net/browse/BMPT-1354
|
|
596
|
-
*/
|
|
597
|
-
export declare function mapResponseToVoid(): Promise<void>;
|
|
684
|
+
// @public @deprecated (undocumented)
|
|
685
|
+
export function mapResponseToVoid(): Promise<void>;
|
|
598
686
|
|
|
599
|
-
|
|
687
|
+
// @public (undocumented)
|
|
688
|
+
export const MAX_RESOLUTION = 4096;
|
|
600
689
|
|
|
601
|
-
|
|
690
|
+
// @public (undocumented)
|
|
691
|
+
export interface MediaArtifact {
|
|
692
|
+
// (undocumented)
|
|
602
693
|
processingStatus?: FileProcessingStatus;
|
|
694
|
+
// (undocumented)
|
|
603
695
|
url?: string;
|
|
604
696
|
}
|
|
605
697
|
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
698
|
+
// @public (undocumented)
|
|
699
|
+
export interface MediaBlobUrlAttrs {
|
|
700
|
+
// (undocumented)
|
|
701
|
+
alt?: string;
|
|
702
|
+
// (undocumented)
|
|
609
703
|
collection?: string;
|
|
610
|
-
|
|
611
|
-
|
|
704
|
+
// (undocumented)
|
|
705
|
+
contextId: string;
|
|
706
|
+
// (undocumented)
|
|
707
|
+
height?: number;
|
|
708
|
+
// (undocumented)
|
|
709
|
+
id: string;
|
|
710
|
+
// (undocumented)
|
|
612
711
|
mimeType?: string;
|
|
712
|
+
// (undocumented)
|
|
713
|
+
name?: string;
|
|
714
|
+
// (undocumented)
|
|
715
|
+
size?: number;
|
|
716
|
+
// (undocumented)
|
|
613
717
|
width?: number;
|
|
614
|
-
height?: number;
|
|
615
|
-
alt?: string;
|
|
616
718
|
}
|
|
617
719
|
|
|
618
|
-
|
|
720
|
+
// @public (undocumented)
|
|
721
|
+
export type MediaChunksProbe = {
|
|
619
722
|
readonly results: {
|
|
620
723
|
readonly [etag: string]: {
|
|
621
724
|
readonly exists: boolean;
|
|
@@ -623,69 +726,79 @@ export declare type MediaChunksProbe = {
|
|
|
623
726
|
};
|
|
624
727
|
};
|
|
625
728
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
629
|
-
readonly mediaStore: MediaStore;
|
|
630
|
-
readonly collection: CollectionFetcher;
|
|
631
|
-
readonly file: FileFetcher;
|
|
632
|
-
readonly stargate: StargateClient;
|
|
633
|
-
private readonly eventEmitter;
|
|
634
|
-
private mobileUpload?;
|
|
635
|
-
readonly config: MediaClientConfig;
|
|
729
|
+
// @public (undocumented)
|
|
730
|
+
export class MediaClient {
|
|
636
731
|
constructor(
|
|
637
732
|
mediaClientConfig: MediaClientConfig,
|
|
638
733
|
featureFlags?: MediaFeatureFlags | undefined,
|
|
639
734
|
);
|
|
735
|
+
// (undocumented)
|
|
736
|
+
readonly collection: CollectionFetcher;
|
|
737
|
+
// (undocumented)
|
|
738
|
+
readonly config: MediaClientConfig;
|
|
739
|
+
// (undocumented)
|
|
740
|
+
emit<E extends keyof UploadEventPayloadMap>(
|
|
741
|
+
event: E,
|
|
742
|
+
payload: UploadEventPayloadMap[E],
|
|
743
|
+
): boolean;
|
|
744
|
+
// (undocumented)
|
|
745
|
+
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
746
|
+
// (undocumented)
|
|
747
|
+
readonly file: FileFetcher;
|
|
748
|
+
// (undocumented)
|
|
640
749
|
getImage(
|
|
641
750
|
id: string,
|
|
642
751
|
params?: MediaStoreGetFileImageParams,
|
|
643
752
|
controller?: AbortController,
|
|
644
753
|
fetchMaxRes?: boolean,
|
|
645
754
|
): Promise<Blob>;
|
|
755
|
+
// (undocumented)
|
|
756
|
+
getImageMetadata(
|
|
757
|
+
id: string,
|
|
758
|
+
params?: MediaStoreGetFileImageParams,
|
|
759
|
+
): Promise<ImageMetadata>;
|
|
760
|
+
// (undocumented)
|
|
646
761
|
getImageUrl(
|
|
647
762
|
id: string,
|
|
648
763
|
params?: MediaStoreGetFileImageParams,
|
|
649
764
|
): Promise<string>;
|
|
765
|
+
// (undocumented)
|
|
650
766
|
getImageUrlSync(id: string, params?: MediaStoreGetFileImageParams): string;
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
767
|
+
// (undocumented)
|
|
768
|
+
readonly mediaClientConfig: MediaClientConfig;
|
|
769
|
+
// (undocumented)
|
|
770
|
+
readonly mediaStore: MediaStore;
|
|
771
|
+
// (undocumented)
|
|
655
772
|
mobileUploadPromise(): Promise<MobileUpload>;
|
|
656
|
-
|
|
773
|
+
// (undocumented)
|
|
774
|
+
off<E extends keyof UploadEventPayloadMap>(
|
|
657
775
|
event: E,
|
|
658
776
|
listener: EventPayloadListener<UploadEventPayloadMap, E>,
|
|
659
777
|
): void;
|
|
660
|
-
|
|
778
|
+
// (undocumented)
|
|
779
|
+
on<E extends keyof UploadEventPayloadMap>(
|
|
661
780
|
event: E,
|
|
662
781
|
listener: EventPayloadListener<UploadEventPayloadMap, E>,
|
|
663
782
|
): void;
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
payload: UploadEventPayloadMap[E],
|
|
667
|
-
): boolean;
|
|
783
|
+
// (undocumented)
|
|
784
|
+
readonly stargate: StargateClient;
|
|
668
785
|
}
|
|
669
786
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
* reasons that the erros can define. Its values are private to this file.
|
|
675
|
-
* Any new error has to define its own Error Reasons locally, and also declare them
|
|
676
|
-
* here to comply with the interface restrictions
|
|
677
|
-
*/
|
|
678
|
-
export declare interface MediaClientError<
|
|
679
|
-
Attributes extends MediaClientErrorAttributes
|
|
680
|
-
> extends Error {
|
|
787
|
+
// @public
|
|
788
|
+
export interface MediaClientError<Attributes extends MediaClientErrorAttributes>
|
|
789
|
+
extends Error {
|
|
790
|
+
// (undocumented)
|
|
681
791
|
readonly attributes: Attributes;
|
|
682
792
|
}
|
|
683
793
|
|
|
684
|
-
|
|
794
|
+
// @public (undocumented)
|
|
795
|
+
export interface MediaClientErrorAttributes {
|
|
796
|
+
// (undocumented)
|
|
685
797
|
reason: MediaClientErrorReason;
|
|
686
798
|
}
|
|
687
799
|
|
|
688
|
-
|
|
800
|
+
// @public (undocumented)
|
|
801
|
+
export type MediaClientErrorReason =
|
|
689
802
|
| 'clientOffline'
|
|
690
803
|
| 'clientAbortedRequest'
|
|
691
804
|
| 'clientTimeoutRequest'
|
|
@@ -709,23 +822,27 @@ export declare type MediaClientErrorReason =
|
|
|
709
822
|
| 'pollingMaxAttemptsExceeded'
|
|
710
823
|
| 'fileSizeExceedsLimit';
|
|
711
824
|
|
|
712
|
-
|
|
825
|
+
// @public (undocumented)
|
|
826
|
+
export type MediaCollection = {
|
|
713
827
|
readonly name: string;
|
|
714
828
|
readonly createdAt: number;
|
|
715
829
|
};
|
|
716
830
|
|
|
717
|
-
|
|
831
|
+
// @public (undocumented)
|
|
832
|
+
export type MediaCollectionItem = {
|
|
718
833
|
readonly id: string;
|
|
719
834
|
readonly insertedAt: number;
|
|
720
835
|
readonly occurrenceKey: string;
|
|
721
836
|
readonly details: MediaCollectionItemDetails;
|
|
722
837
|
};
|
|
723
838
|
|
|
724
|
-
|
|
839
|
+
// @public (undocumented)
|
|
840
|
+
export type MediaCollectionItemDetails =
|
|
725
841
|
| MediaCollectionItemMinimalDetails
|
|
726
842
|
| MediaCollectionItemFullDetails;
|
|
727
843
|
|
|
728
|
-
|
|
844
|
+
// @public (undocumented)
|
|
845
|
+
export type MediaCollectionItemFullDetails = {
|
|
729
846
|
readonly mediaType: MediaType;
|
|
730
847
|
readonly mimeType: string;
|
|
731
848
|
readonly name: string;
|
|
@@ -736,17 +853,20 @@ export declare type MediaCollectionItemFullDetails = {
|
|
|
736
853
|
readonly createdAt?: number;
|
|
737
854
|
};
|
|
738
855
|
|
|
739
|
-
|
|
856
|
+
// @public (undocumented)
|
|
857
|
+
export type MediaCollectionItemMinimalDetails = {
|
|
740
858
|
readonly name: string;
|
|
741
859
|
readonly size: number;
|
|
742
860
|
};
|
|
743
861
|
|
|
744
|
-
|
|
862
|
+
// @public (undocumented)
|
|
863
|
+
export type MediaCollectionItems = {
|
|
745
864
|
readonly contents: MediaCollectionItem[];
|
|
746
865
|
readonly nextInclusiveStartKey?: string;
|
|
747
866
|
};
|
|
748
867
|
|
|
749
|
-
|
|
868
|
+
// @public (undocumented)
|
|
869
|
+
export type MediaFile = {
|
|
750
870
|
readonly id: string;
|
|
751
871
|
readonly mediaType: MediaType;
|
|
752
872
|
readonly mimeType: string;
|
|
@@ -758,150 +878,180 @@ export declare type MediaFile = {
|
|
|
758
878
|
readonly createdAt?: number;
|
|
759
879
|
};
|
|
760
880
|
|
|
761
|
-
|
|
881
|
+
// @public (undocumented)
|
|
882
|
+
export type MediaFileArtifact = {
|
|
762
883
|
readonly url: string;
|
|
763
884
|
readonly processingStatus: MediaFileProcessingStatus;
|
|
764
885
|
};
|
|
765
886
|
|
|
766
|
-
|
|
887
|
+
// @public (undocumented)
|
|
888
|
+
export interface MediaFileArtifacts {
|
|
889
|
+
// (undocumented)
|
|
890
|
+
'audio.mp3'?: MediaFileArtifact;
|
|
891
|
+
// (undocumented)
|
|
892
|
+
'document.pdf'?: MediaFileArtifact;
|
|
893
|
+
// (undocumented)
|
|
767
894
|
'video_1280.mp4'?: MediaFileArtifact;
|
|
895
|
+
// (undocumented)
|
|
768
896
|
'video_640.mp4'?: MediaFileArtifact;
|
|
769
|
-
'document.pdf'?: MediaFileArtifact;
|
|
770
|
-
'audio.mp3'?: MediaFileArtifact;
|
|
771
897
|
}
|
|
772
898
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
| 'succeeded'
|
|
776
|
-
| 'failed';
|
|
899
|
+
// @public (undocumented)
|
|
900
|
+
export type MediaFileProcessingStatus = 'pending' | 'succeeded' | 'failed';
|
|
777
901
|
|
|
778
|
-
|
|
902
|
+
// @public (undocumented)
|
|
903
|
+
export type MediaItemType = 'file' | 'external-image';
|
|
779
904
|
|
|
780
|
-
|
|
905
|
+
// @public (undocumented)
|
|
906
|
+
export type MediaObserver<T> =
|
|
781
907
|
| NextObserver<T>
|
|
782
908
|
| ErrorObserver<T>
|
|
783
909
|
| CompletionObserver<T>
|
|
784
910
|
| ((value: T) => void);
|
|
785
911
|
|
|
786
|
-
|
|
912
|
+
// @public (undocumented)
|
|
913
|
+
export type MediaRepresentations = {
|
|
787
914
|
image?: Object;
|
|
788
915
|
};
|
|
789
916
|
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
917
|
+
// @public (undocumented)
|
|
918
|
+
export class MediaStore {
|
|
793
919
|
constructor(
|
|
794
920
|
config: MediaApiConfig,
|
|
795
921
|
featureFlags?: MediaFeatureFlags | undefined,
|
|
796
922
|
);
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
removeCollectionFile(
|
|
802
|
-
id: string,
|
|
803
|
-
collectionName: string,
|
|
804
|
-
occurrenceKey?: string,
|
|
805
|
-
): Promise<void>;
|
|
806
|
-
createUpload(
|
|
807
|
-
createUpTo?: number,
|
|
923
|
+
// (undocumented)
|
|
924
|
+
appendChunksToUpload(
|
|
925
|
+
uploadId: string,
|
|
926
|
+
body: AppendChunksToUploadRequestBody,
|
|
808
927
|
collectionName?: string,
|
|
809
|
-
): Promise<MediaStoreResponse<MediaUpload[]>>;
|
|
810
|
-
uploadChunk(
|
|
811
|
-
etag: string,
|
|
812
|
-
blob: Blob,
|
|
813
|
-
{
|
|
814
|
-
collectionName,
|
|
815
|
-
uploadId,
|
|
816
|
-
partNumber,
|
|
817
|
-
}?: {
|
|
818
|
-
collectionName?: string;
|
|
819
|
-
uploadId?: string;
|
|
820
|
-
partNumber?: number;
|
|
821
|
-
},
|
|
822
928
|
): Promise<void>;
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
collectionName?: string;
|
|
830
|
-
uploadId?: string;
|
|
831
|
-
},
|
|
832
|
-
): Promise<MediaStoreResponse<MediaChunksProbe>>;
|
|
929
|
+
// (undocumented)
|
|
930
|
+
copyFileWithToken(
|
|
931
|
+
body: MediaStoreCopyFileWithTokenBody,
|
|
932
|
+
params: MediaStoreCopyFileWithTokenParams,
|
|
933
|
+
): Promise<MediaStoreResponse<MediaFile>>;
|
|
934
|
+
// (undocumented)
|
|
833
935
|
createFileFromUpload(
|
|
834
936
|
body: MediaStoreCreateFileFromUploadBody,
|
|
835
937
|
params?: MediaStoreCreateFileFromUploadParams,
|
|
836
938
|
): Promise<MediaStoreResponse<MediaFile>>;
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
939
|
+
// (undocumented)
|
|
940
|
+
createUpload(
|
|
941
|
+
createUpTo?: number,
|
|
942
|
+
collectionName?: string,
|
|
943
|
+
): Promise<MediaStoreResponse<MediaUpload[]>>;
|
|
944
|
+
// (undocumented)
|
|
945
|
+
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
946
|
+
// (undocumented)
|
|
947
|
+
getArtifactURL(
|
|
948
|
+
artifacts: MediaFileArtifacts,
|
|
949
|
+
artifactName: keyof MediaFileArtifacts,
|
|
950
|
+
collectionName?: string,
|
|
951
|
+
): Promise<string>;
|
|
952
|
+
// (undocumented)
|
|
953
|
+
getCollectionItems(
|
|
954
|
+
collectionName: string,
|
|
955
|
+
params?: MediaStoreGetCollectionItemsParams,
|
|
956
|
+
): Promise<MediaStoreResponse<MediaCollectionItems>>;
|
|
957
|
+
// (undocumented)
|
|
841
958
|
getFile(
|
|
842
959
|
fileId: string,
|
|
843
960
|
params?: MediaStoreGetFileParams,
|
|
844
961
|
): Promise<MediaStoreResponse<MediaFile>>;
|
|
962
|
+
// (undocumented)
|
|
963
|
+
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
964
|
+
// (undocumented)
|
|
845
965
|
getFileImageURL(
|
|
846
966
|
id: string,
|
|
847
967
|
params?: MediaStoreGetFileImageParams,
|
|
848
968
|
): Promise<string>;
|
|
969
|
+
// (undocumented)
|
|
849
970
|
getFileImageURLSync(
|
|
850
971
|
id: string,
|
|
851
972
|
params?: MediaStoreGetFileImageParams,
|
|
852
973
|
): string;
|
|
853
|
-
|
|
854
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
855
|
-
getArtifactURL(
|
|
856
|
-
artifacts: MediaFileArtifacts,
|
|
857
|
-
artifactName: keyof MediaFileArtifacts,
|
|
858
|
-
collectionName?: string,
|
|
859
|
-
): Promise<string>;
|
|
974
|
+
// (undocumented)
|
|
860
975
|
getImage(
|
|
861
976
|
id: string,
|
|
862
977
|
params?: MediaStoreGetFileImageParams,
|
|
863
978
|
controller?: AbortController,
|
|
864
979
|
fetchMaxRes?: boolean,
|
|
865
980
|
): Promise<Blob>;
|
|
866
|
-
|
|
867
|
-
ids: string[],
|
|
868
|
-
collectionName?: string,
|
|
869
|
-
): Promise<MediaStoreResponse<ItemsPayload>>;
|
|
981
|
+
// (undocumented)
|
|
870
982
|
getImageMetadata(
|
|
871
983
|
id: string,
|
|
872
984
|
params?: MediaStoreGetFileImageParams,
|
|
873
985
|
): Promise<{
|
|
874
986
|
metadata: ImageMetadata;
|
|
875
987
|
}>;
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
988
|
+
// (undocumented)
|
|
989
|
+
getItems(
|
|
990
|
+
ids: string[],
|
|
879
991
|
collectionName?: string,
|
|
992
|
+
): Promise<MediaStoreResponse<ItemsPayload>>;
|
|
993
|
+
// (undocumented)
|
|
994
|
+
probeChunks(
|
|
995
|
+
chunks: string[],
|
|
996
|
+
{
|
|
997
|
+
collectionName,
|
|
998
|
+
uploadId,
|
|
999
|
+
}?: {
|
|
1000
|
+
collectionName?: string;
|
|
1001
|
+
uploadId?: string;
|
|
1002
|
+
},
|
|
1003
|
+
): Promise<MediaStoreResponse<MediaChunksProbe>>;
|
|
1004
|
+
// (undocumented)
|
|
1005
|
+
removeCollectionFile(
|
|
1006
|
+
id: string,
|
|
1007
|
+
collectionName: string,
|
|
1008
|
+
occurrenceKey?: string,
|
|
880
1009
|
): Promise<void>;
|
|
881
|
-
|
|
882
|
-
body: MediaStoreCopyFileWithTokenBody,
|
|
883
|
-
params: MediaStoreCopyFileWithTokenParams,
|
|
884
|
-
): Promise<MediaStoreResponse<MediaFile>>;
|
|
1010
|
+
// (undocumented)
|
|
885
1011
|
request(
|
|
886
1012
|
path: string,
|
|
887
1013
|
options?: MediaStoreRequestOptions,
|
|
888
1014
|
controller?: AbortController,
|
|
889
1015
|
): Promise<Response>;
|
|
1016
|
+
// (undocumented)
|
|
890
1017
|
resolveAuth: (authContext?: AuthContext | undefined) => Promise<Auth>;
|
|
1018
|
+
// (undocumented)
|
|
891
1019
|
resolveInitialAuth: () => Auth;
|
|
1020
|
+
// (undocumented)
|
|
1021
|
+
touchFiles(
|
|
1022
|
+
body: MediaStoreTouchFileBody,
|
|
1023
|
+
params?: MediaStoreTouchFileParams,
|
|
1024
|
+
): Promise<MediaStoreResponse<TouchedFiles>>;
|
|
1025
|
+
// (undocumented)
|
|
1026
|
+
uploadChunk(
|
|
1027
|
+
etag: string,
|
|
1028
|
+
blob: Blob,
|
|
1029
|
+
{
|
|
1030
|
+
collectionName,
|
|
1031
|
+
uploadId,
|
|
1032
|
+
partNumber,
|
|
1033
|
+
}?: {
|
|
1034
|
+
collectionName?: string;
|
|
1035
|
+
uploadId?: string;
|
|
1036
|
+
partNumber?: number;
|
|
1037
|
+
},
|
|
1038
|
+
): Promise<void>;
|
|
892
1039
|
}
|
|
893
1040
|
|
|
894
|
-
|
|
1041
|
+
// @public (undocumented)
|
|
1042
|
+
export type MediaStoreCopyFileWithTokenBody = {
|
|
895
1043
|
sourceFile: SourceFile;
|
|
896
1044
|
};
|
|
897
1045
|
|
|
898
|
-
|
|
1046
|
+
// @public (undocumented)
|
|
1047
|
+
export type MediaStoreCopyFileWithTokenParams = {
|
|
899
1048
|
readonly collection?: string;
|
|
900
1049
|
readonly replaceFileId?: string;
|
|
901
1050
|
readonly occurrenceKey?: string;
|
|
902
1051
|
};
|
|
903
1052
|
|
|
904
|
-
|
|
1053
|
+
// @public (undocumented)
|
|
1054
|
+
export type MediaStoreCreateFileFromBinaryParams = {
|
|
905
1055
|
readonly replaceFileId?: string;
|
|
906
1056
|
readonly collection?: string;
|
|
907
1057
|
readonly occurrenceKey?: string;
|
|
@@ -910,19 +1060,22 @@ export declare type MediaStoreCreateFileFromBinaryParams = {
|
|
|
910
1060
|
readonly name?: string;
|
|
911
1061
|
};
|
|
912
1062
|
|
|
913
|
-
|
|
1063
|
+
// @public (undocumented)
|
|
1064
|
+
export type MediaStoreCreateFileFromUploadBody = {
|
|
914
1065
|
readonly uploadId: string;
|
|
915
1066
|
readonly name?: string;
|
|
916
1067
|
readonly mimeType?: string;
|
|
917
1068
|
readonly conditions?: MediaStoreCreateFileFromUploadConditions;
|
|
918
1069
|
};
|
|
919
1070
|
|
|
920
|
-
|
|
1071
|
+
// @public (undocumented)
|
|
1072
|
+
export type MediaStoreCreateFileFromUploadConditions = {
|
|
921
1073
|
readonly hash: string;
|
|
922
1074
|
readonly size: number;
|
|
923
1075
|
};
|
|
924
1076
|
|
|
925
|
-
|
|
1077
|
+
// @public (undocumented)
|
|
1078
|
+
export type MediaStoreCreateFileFromUploadParams = {
|
|
926
1079
|
readonly collection?: string;
|
|
927
1080
|
readonly occurrenceKey?: string;
|
|
928
1081
|
readonly expireAfter?: number;
|
|
@@ -930,43 +1083,52 @@ export declare type MediaStoreCreateFileFromUploadParams = {
|
|
|
930
1083
|
readonly skipConversions?: boolean;
|
|
931
1084
|
};
|
|
932
1085
|
|
|
933
|
-
|
|
1086
|
+
// @public (undocumented)
|
|
1087
|
+
export type MediaStoreCreateFileParams = {
|
|
934
1088
|
readonly occurrenceKey?: string;
|
|
935
1089
|
readonly collection?: string;
|
|
936
1090
|
};
|
|
937
1091
|
|
|
938
|
-
|
|
1092
|
+
// @public (undocumented)
|
|
1093
|
+
export class MediaStoreError extends BaseMediaClientError<
|
|
939
1094
|
MediaStoreErrorAttributes
|
|
940
1095
|
> {
|
|
941
|
-
readonly reason: MediaStoreErrorReason;
|
|
942
|
-
readonly innerError?: Error | undefined;
|
|
943
1096
|
constructor(reason: MediaStoreErrorReason, innerError?: Error | undefined);
|
|
1097
|
+
// (undocumented)
|
|
944
1098
|
get attributes(): {
|
|
945
1099
|
reason: MediaStoreErrorReason;
|
|
946
1100
|
innerError: Error | undefined;
|
|
947
1101
|
};
|
|
1102
|
+
// (undocumented)
|
|
1103
|
+
readonly innerError?: Error | undefined;
|
|
1104
|
+
// (undocumented)
|
|
1105
|
+
readonly reason: MediaStoreErrorReason;
|
|
948
1106
|
}
|
|
949
1107
|
|
|
950
|
-
|
|
1108
|
+
// @public (undocumented)
|
|
1109
|
+
export type MediaStoreErrorAttributes = {
|
|
951
1110
|
readonly reason: MediaStoreErrorReason;
|
|
952
1111
|
readonly innerError?: Error;
|
|
953
1112
|
};
|
|
954
1113
|
|
|
955
|
-
|
|
1114
|
+
// @public (undocumented)
|
|
1115
|
+
export type MediaStoreErrorReason =
|
|
956
1116
|
| 'failedAuthProvider'
|
|
957
1117
|
| 'tokenExpired'
|
|
958
1118
|
| 'missingInitialAuth'
|
|
959
1119
|
| 'emptyAuth'
|
|
960
1120
|
| 'authProviderTimedOut';
|
|
961
1121
|
|
|
962
|
-
|
|
1122
|
+
// @public (undocumented)
|
|
1123
|
+
export type MediaStoreGetCollectionItemsParams = {
|
|
963
1124
|
readonly limit?: number;
|
|
964
1125
|
readonly inclusiveStartKey?: string;
|
|
965
1126
|
readonly sortDirection?: 'asc' | 'desc';
|
|
966
1127
|
readonly details?: 'minimal' | 'full';
|
|
967
1128
|
};
|
|
968
1129
|
|
|
969
|
-
|
|
1130
|
+
// @public (undocumented)
|
|
1131
|
+
export type MediaStoreGetFileImageParams = {
|
|
970
1132
|
readonly allowAnimated?: boolean;
|
|
971
1133
|
readonly version?: number;
|
|
972
1134
|
readonly collection?: string;
|
|
@@ -977,12 +1139,14 @@ export declare type MediaStoreGetFileImageParams = {
|
|
|
977
1139
|
readonly 'max-age'?: number;
|
|
978
1140
|
};
|
|
979
1141
|
|
|
980
|
-
|
|
1142
|
+
// @public (undocumented)
|
|
1143
|
+
export type MediaStoreGetFileParams = {
|
|
981
1144
|
readonly version?: number;
|
|
982
1145
|
readonly collection?: string;
|
|
983
1146
|
};
|
|
984
1147
|
|
|
985
|
-
|
|
1148
|
+
// @public (undocumented)
|
|
1149
|
+
export type MediaStoreRequestOptions = RequestMetadata & {
|
|
986
1150
|
readonly method?: RequestMethod;
|
|
987
1151
|
readonly authContext?: AuthContext;
|
|
988
1152
|
readonly params?: RequestParams;
|
|
@@ -991,64 +1155,87 @@ export declare type MediaStoreRequestOptions = RequestMetadata & {
|
|
|
991
1155
|
readonly clientOptions?: ClientOptions;
|
|
992
1156
|
};
|
|
993
1157
|
|
|
994
|
-
|
|
1158
|
+
// @public (undocumented)
|
|
1159
|
+
export interface MediaStoreResponse<Data> {
|
|
1160
|
+
// (undocumented)
|
|
995
1161
|
readonly data: Data;
|
|
996
1162
|
}
|
|
997
1163
|
|
|
998
|
-
|
|
1164
|
+
// @public (undocumented)
|
|
1165
|
+
export interface MediaStoreTouchFileBody {
|
|
1166
|
+
// (undocumented)
|
|
999
1167
|
descriptors: TouchFileDescriptor[];
|
|
1000
1168
|
}
|
|
1001
1169
|
|
|
1002
|
-
|
|
1170
|
+
// @public (undocumented)
|
|
1171
|
+
export interface MediaStoreTouchFileParams {
|
|
1172
|
+
// (undocumented)
|
|
1003
1173
|
readonly collection?: string;
|
|
1004
1174
|
}
|
|
1005
1175
|
|
|
1006
|
-
|
|
1176
|
+
// @public (undocumented)
|
|
1177
|
+
export type MediaSubscribable<T> = {
|
|
1007
1178
|
subscribe(observer?: MediaObserver<T>): MediaSubscription;
|
|
1008
1179
|
};
|
|
1009
1180
|
|
|
1010
|
-
|
|
1181
|
+
// @public (undocumented)
|
|
1182
|
+
export type MediaSubscribableItem = FileState | MediaCollectionItem[];
|
|
1011
1183
|
|
|
1012
|
-
|
|
1184
|
+
// @public (undocumented)
|
|
1185
|
+
export type MediaSubscription = {
|
|
1013
1186
|
unsubscribe: () => void;
|
|
1014
1187
|
};
|
|
1015
1188
|
|
|
1016
1189
|
export { MediaType };
|
|
1017
1190
|
|
|
1018
|
-
|
|
1191
|
+
// @public (undocumented)
|
|
1192
|
+
export type MediaUpload = {
|
|
1019
1193
|
readonly id: string;
|
|
1020
1194
|
readonly created: number;
|
|
1021
1195
|
readonly expires: number;
|
|
1022
1196
|
};
|
|
1023
1197
|
|
|
1024
|
-
|
|
1198
|
+
// @public (undocumented)
|
|
1199
|
+
export interface MediaViewedEventPayload {
|
|
1200
|
+
// (undocumented)
|
|
1025
1201
|
fileId: string;
|
|
1026
|
-
|
|
1202
|
+
// (undocumented)
|
|
1027
1203
|
isUserCollection?: boolean;
|
|
1204
|
+
// (undocumented)
|
|
1205
|
+
viewingLevel: 'minimal' | 'full' | 'download';
|
|
1028
1206
|
}
|
|
1029
1207
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1208
|
+
// @public (undocumented)
|
|
1209
|
+
export interface MobileUpload {
|
|
1210
|
+
// (undocumented)
|
|
1033
1211
|
notifyUploadEnd(event: MobileUploadEndEvent): void;
|
|
1212
|
+
// (undocumented)
|
|
1034
1213
|
notifyUploadError(event: MobileUploadErrorEvent): void;
|
|
1214
|
+
// (undocumented)
|
|
1215
|
+
notifyUploadProgress(event: MobileUploadProgressEvent): void;
|
|
1216
|
+
// (undocumented)
|
|
1217
|
+
notifyUploadStart(event: MobileUploadStartEvent): void;
|
|
1035
1218
|
}
|
|
1036
1219
|
|
|
1037
|
-
|
|
1220
|
+
// @public (undocumented)
|
|
1221
|
+
export type MobileUploadEndEvent = {
|
|
1038
1222
|
fileId: string;
|
|
1039
1223
|
};
|
|
1040
1224
|
|
|
1041
|
-
|
|
1225
|
+
// @public (undocumented)
|
|
1226
|
+
export type MobileUploadErrorEvent = {
|
|
1042
1227
|
fileId: string;
|
|
1043
1228
|
message: string;
|
|
1044
1229
|
};
|
|
1045
1230
|
|
|
1046
|
-
|
|
1231
|
+
// @public (undocumented)
|
|
1232
|
+
export type MobileUploadProgressEvent = {
|
|
1047
1233
|
fileId: string;
|
|
1048
1234
|
progress: number;
|
|
1049
1235
|
};
|
|
1050
1236
|
|
|
1051
|
-
|
|
1237
|
+
// @public (undocumented)
|
|
1238
|
+
export type MobileUploadStartEvent = {
|
|
1052
1239
|
fileId: string;
|
|
1053
1240
|
collectionName?: string;
|
|
1054
1241
|
occurrenceKey?: string;
|
|
@@ -1059,143 +1246,191 @@ export declare type MobileUploadStartEvent = {
|
|
|
1059
1246
|
createdAt?: number;
|
|
1060
1247
|
};
|
|
1061
1248
|
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
> &
|
|
1249
|
+
// @public (undocumented)
|
|
1250
|
+
type NextObserver<T> = PartialObserver<T> &
|
|
1065
1251
|
Required<Pick<PartialObserver<T>, 'next'>>;
|
|
1066
1252
|
|
|
1067
|
-
|
|
1253
|
+
// @public (undocumented)
|
|
1254
|
+
export type NonErrorFileState = Exclude<FileState, ErrorFileState>;
|
|
1068
1255
|
|
|
1069
|
-
|
|
1256
|
+
// @public (undocumented)
|
|
1257
|
+
export const objectToQueryString: (json: {
|
|
1070
1258
|
[key: string]: string | number | boolean | null | undefined;
|
|
1071
1259
|
}) => string;
|
|
1072
1260
|
|
|
1073
|
-
|
|
1261
|
+
// @public (undocumented)
|
|
1262
|
+
type PartialObserver<T> = {
|
|
1074
1263
|
next?: (value: T) => void;
|
|
1075
1264
|
error?: (err: any) => void;
|
|
1076
1265
|
complete?: () => void;
|
|
1077
1266
|
};
|
|
1078
1267
|
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
> {
|
|
1082
|
-
readonly reason: PollingErrorReason;
|
|
1083
|
-
readonly attempts: number;
|
|
1268
|
+
// @public (undocumented)
|
|
1269
|
+
export class PollingError extends BaseMediaClientError<PollingErrorAttributes> {
|
|
1084
1270
|
constructor(reason: PollingErrorReason, attempts: number);
|
|
1271
|
+
// (undocumented)
|
|
1272
|
+
readonly attempts: number;
|
|
1273
|
+
// (undocumented)
|
|
1085
1274
|
get attributes(): {
|
|
1086
1275
|
reason: 'pollingMaxAttemptsExceeded';
|
|
1087
1276
|
attempts: number;
|
|
1088
1277
|
};
|
|
1278
|
+
// (undocumented)
|
|
1279
|
+
readonly reason: PollingErrorReason;
|
|
1089
1280
|
}
|
|
1090
1281
|
|
|
1091
|
-
|
|
1282
|
+
// @public (undocumented)
|
|
1283
|
+
export type PollingErrorAttributes = {
|
|
1092
1284
|
readonly reason: PollingErrorReason;
|
|
1093
1285
|
readonly attempts: number;
|
|
1094
1286
|
readonly innerError?: Error;
|
|
1095
1287
|
};
|
|
1096
1288
|
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
* - async executor function provides each attempt
|
|
1103
|
-
* - executor will only repeat defined max amount of times (options)
|
|
1104
|
-
* - each attempt uses a timeout to the next attempt by an interval (ms)
|
|
1105
|
-
* - each attempt increases the timeout interval by a "poll_backoffFactor"
|
|
1106
|
-
* - if max attempts are exceeded or executor has exception then onError handler is called
|
|
1107
|
-
*
|
|
1108
|
-
* IMPORTANT! the executor function must explicitly call ".next()" for the next iteration to run
|
|
1109
|
-
*/
|
|
1110
|
-
export declare class PollingFunction {
|
|
1111
|
-
options: PollingOptions;
|
|
1112
|
-
poll_intervalMs: number;
|
|
1113
|
-
attempt: number;
|
|
1114
|
-
shouldIterate: boolean;
|
|
1115
|
-
onError?: (error: Error) => void;
|
|
1116
|
-
timeoutId: number;
|
|
1289
|
+
// @public (undocumented)
|
|
1290
|
+
export type PollingErrorReason = 'pollingMaxAttemptsExceeded';
|
|
1291
|
+
|
|
1292
|
+
// @public
|
|
1293
|
+
export class PollingFunction {
|
|
1117
1294
|
constructor(options?: Partial<PollingOptions>);
|
|
1295
|
+
// (undocumented)
|
|
1296
|
+
attempt: number;
|
|
1297
|
+
// (undocumented)
|
|
1298
|
+
cancel(): void;
|
|
1299
|
+
// (undocumented)
|
|
1118
1300
|
execute(executor: Executor): Promise<void>;
|
|
1119
|
-
|
|
1301
|
+
// (undocumented)
|
|
1120
1302
|
getIntervalMsForIteration(iteration: number): number;
|
|
1303
|
+
// (undocumented)
|
|
1121
1304
|
next(): void;
|
|
1122
|
-
|
|
1305
|
+
// (undocumented)
|
|
1306
|
+
onError?: (error: Error) => void;
|
|
1307
|
+
// (undocumented)
|
|
1308
|
+
options: PollingOptions;
|
|
1309
|
+
// (undocumented)
|
|
1310
|
+
poll_intervalMs: number;
|
|
1311
|
+
// (undocumented)
|
|
1312
|
+
shouldIterate: boolean;
|
|
1313
|
+
// (undocumented)
|
|
1314
|
+
timeoutId: number;
|
|
1123
1315
|
}
|
|
1124
1316
|
|
|
1125
|
-
|
|
1317
|
+
// @public (undocumented)
|
|
1318
|
+
interface PollingOptions {
|
|
1319
|
+
// (undocumented)
|
|
1320
|
+
poll_backoffFactor: number;
|
|
1321
|
+
// (undocumented)
|
|
1126
1322
|
poll_intervalMs: number;
|
|
1323
|
+
// (undocumented)
|
|
1127
1324
|
poll_maxAttempts: number;
|
|
1128
|
-
|
|
1325
|
+
// (undocumented)
|
|
1129
1326
|
poll_maxIntervalMs: number;
|
|
1130
1327
|
}
|
|
1131
1328
|
|
|
1132
|
-
|
|
1329
|
+
// @public (undocumented)
|
|
1330
|
+
export interface PreviewableFileState {
|
|
1331
|
+
// (undocumented)
|
|
1133
1332
|
preview: FilePreview | Promise<FilePreview>;
|
|
1134
1333
|
}
|
|
1135
1334
|
|
|
1136
|
-
|
|
1335
|
+
// @public (undocumented)
|
|
1336
|
+
export interface PreviewOptions {}
|
|
1137
1337
|
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
occurrenceKey?: string;
|
|
1142
|
-
name: string;
|
|
1143
|
-
size: number;
|
|
1338
|
+
// @public (undocumented)
|
|
1339
|
+
export interface ProcessedFileState {
|
|
1340
|
+
// (undocumented)
|
|
1144
1341
|
artifacts: MediaFileArtifacts;
|
|
1342
|
+
// (undocumented)
|
|
1343
|
+
createdAt?: number;
|
|
1344
|
+
// (undocumented)
|
|
1345
|
+
id: string;
|
|
1346
|
+
// (undocumented)
|
|
1145
1347
|
mediaType: MediaType;
|
|
1348
|
+
// (undocumented)
|
|
1146
1349
|
mimeType: string;
|
|
1350
|
+
// (undocumented)
|
|
1351
|
+
name: string;
|
|
1352
|
+
// (undocumented)
|
|
1353
|
+
occurrenceKey?: string;
|
|
1354
|
+
// (undocumented)
|
|
1147
1355
|
preview?: FilePreview | Promise<FilePreview>;
|
|
1356
|
+
// (undocumented)
|
|
1148
1357
|
representations?: MediaRepresentations;
|
|
1149
|
-
|
|
1358
|
+
// (undocumented)
|
|
1359
|
+
size: number;
|
|
1360
|
+
// (undocumented)
|
|
1361
|
+
status: 'processed';
|
|
1150
1362
|
}
|
|
1151
1363
|
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
occurrenceKey?: string;
|
|
1156
|
-
name: string;
|
|
1157
|
-
size: number;
|
|
1364
|
+
// @public (undocumented)
|
|
1365
|
+
export interface ProcessingFailedState {
|
|
1366
|
+
// (undocumented)
|
|
1158
1367
|
artifacts: Object;
|
|
1368
|
+
// (undocumented)
|
|
1369
|
+
createdAt?: number;
|
|
1370
|
+
// (undocumented)
|
|
1371
|
+
id: string;
|
|
1372
|
+
// (undocumented)
|
|
1159
1373
|
mediaType: MediaType;
|
|
1374
|
+
// (undocumented)
|
|
1160
1375
|
mimeType: string;
|
|
1376
|
+
// (undocumented)
|
|
1377
|
+
name: string;
|
|
1378
|
+
// (undocumented)
|
|
1379
|
+
occurrenceKey?: string;
|
|
1380
|
+
// (undocumented)
|
|
1161
1381
|
preview?: FilePreview | Promise<FilePreview>;
|
|
1382
|
+
// (undocumented)
|
|
1162
1383
|
representations?: MediaRepresentations;
|
|
1163
|
-
|
|
1384
|
+
// (undocumented)
|
|
1385
|
+
size: number;
|
|
1386
|
+
// (undocumented)
|
|
1387
|
+
status: 'failed-processing';
|
|
1164
1388
|
}
|
|
1165
1389
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
occurrenceKey?: string;
|
|
1170
|
-
name: string;
|
|
1171
|
-
size: number;
|
|
1390
|
+
// @public (undocumented)
|
|
1391
|
+
export interface ProcessingFileState {
|
|
1392
|
+
// (undocumented)
|
|
1172
1393
|
artifacts?: MediaFileArtifacts;
|
|
1394
|
+
// (undocumented)
|
|
1395
|
+
createdAt?: number;
|
|
1396
|
+
// (undocumented)
|
|
1397
|
+
id: string;
|
|
1398
|
+
// (undocumented)
|
|
1173
1399
|
mediaType: MediaType;
|
|
1400
|
+
// (undocumented)
|
|
1174
1401
|
mimeType: string;
|
|
1402
|
+
// (undocumented)
|
|
1403
|
+
name: string;
|
|
1404
|
+
// (undocumented)
|
|
1405
|
+
occurrenceKey?: string;
|
|
1406
|
+
// (undocumented)
|
|
1175
1407
|
preview?: FilePreview | Promise<FilePreview>;
|
|
1408
|
+
// (undocumented)
|
|
1176
1409
|
representations?: MediaRepresentations;
|
|
1177
|
-
|
|
1410
|
+
// (undocumented)
|
|
1411
|
+
size: number;
|
|
1412
|
+
// (undocumented)
|
|
1413
|
+
status: 'processing';
|
|
1178
1414
|
}
|
|
1179
1415
|
|
|
1180
|
-
|
|
1416
|
+
// @public (undocumented)
|
|
1417
|
+
export const RECENTS_COLLECTION = 'recents';
|
|
1181
1418
|
|
|
1182
|
-
|
|
1419
|
+
// @public (undocumented)
|
|
1420
|
+
export function request(
|
|
1183
1421
|
url: string,
|
|
1184
1422
|
options?: RequestOptions,
|
|
1185
1423
|
controller?: AbortController,
|
|
1186
1424
|
): Promise<Response>;
|
|
1187
1425
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
> {
|
|
1191
|
-
readonly reason: RequestErrorReason;
|
|
1192
|
-
readonly metadata?: RequestErrorMetadata | undefined;
|
|
1193
|
-
readonly innerError?: Error | undefined;
|
|
1426
|
+
// @public (undocumented)
|
|
1427
|
+
export class RequestError extends BaseMediaClientError<RequestErrorAttributes> {
|
|
1194
1428
|
constructor(
|
|
1195
1429
|
reason: RequestErrorReason,
|
|
1196
1430
|
metadata?: RequestErrorMetadata | undefined,
|
|
1197
1431
|
innerError?: Error | undefined,
|
|
1198
1432
|
);
|
|
1433
|
+
// (undocumented)
|
|
1199
1434
|
get attributes(): {
|
|
1200
1435
|
reason: RequestErrorReason;
|
|
1201
1436
|
method: RequestMethod | undefined;
|
|
@@ -1207,19 +1442,28 @@ export declare class RequestError extends BaseMediaClientError<
|
|
|
1207
1442
|
statusCode: number | undefined;
|
|
1208
1443
|
innerError: Error | undefined;
|
|
1209
1444
|
};
|
|
1445
|
+
// (undocumented)
|
|
1446
|
+
readonly innerError?: Error | undefined;
|
|
1447
|
+
// (undocumented)
|
|
1448
|
+
readonly metadata?: RequestErrorMetadata | undefined;
|
|
1449
|
+
// (undocumented)
|
|
1450
|
+
readonly reason: RequestErrorReason;
|
|
1210
1451
|
}
|
|
1211
1452
|
|
|
1212
|
-
|
|
1453
|
+
// @public (undocumented)
|
|
1454
|
+
export type RequestErrorAttributes = RequestErrorMetadata & {
|
|
1213
1455
|
readonly reason: RequestErrorReason;
|
|
1214
1456
|
};
|
|
1215
1457
|
|
|
1216
|
-
|
|
1458
|
+
// @public (undocumented)
|
|
1459
|
+
export type RequestErrorMetadata = RequestMetadata & {
|
|
1217
1460
|
readonly attempts?: number;
|
|
1218
1461
|
readonly clientExhaustedRetries?: boolean;
|
|
1219
1462
|
readonly statusCode?: number;
|
|
1220
1463
|
};
|
|
1221
1464
|
|
|
1222
|
-
|
|
1465
|
+
// @public (undocumented)
|
|
1466
|
+
export type RequestErrorReason =
|
|
1223
1467
|
| 'clientOffline'
|
|
1224
1468
|
| 'clientAbortedRequest'
|
|
1225
1469
|
| 'clientTimeoutRequest'
|
|
@@ -1233,20 +1477,24 @@ export declare type RequestErrorReason =
|
|
|
1233
1477
|
| 'serverBadGateway'
|
|
1234
1478
|
| 'serverUnexpectedError';
|
|
1235
1479
|
|
|
1236
|
-
|
|
1480
|
+
// @public (undocumented)
|
|
1481
|
+
export type RequestHeaders = {
|
|
1237
1482
|
[key: string]: string;
|
|
1238
1483
|
};
|
|
1239
1484
|
|
|
1240
|
-
|
|
1485
|
+
// @public (undocumented)
|
|
1486
|
+
export type RequestMetadata = {
|
|
1241
1487
|
readonly method?: RequestMethod;
|
|
1242
1488
|
readonly endpoint?: string;
|
|
1243
1489
|
readonly mediaRegion?: string;
|
|
1244
1490
|
readonly mediaEnv?: string;
|
|
1245
1491
|
};
|
|
1246
1492
|
|
|
1247
|
-
|
|
1493
|
+
// @public (undocumented)
|
|
1494
|
+
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
1248
1495
|
|
|
1249
|
-
|
|
1496
|
+
// @public (undocumented)
|
|
1497
|
+
export type RequestOptions = RequestMetadata & {
|
|
1250
1498
|
readonly auth?: Auth;
|
|
1251
1499
|
readonly params?: RequestParams;
|
|
1252
1500
|
readonly headers?: RequestHeaders;
|
|
@@ -1254,136 +1502,178 @@ export declare type RequestOptions = RequestMetadata & {
|
|
|
1254
1502
|
readonly clientOptions?: ClientOptions;
|
|
1255
1503
|
};
|
|
1256
1504
|
|
|
1257
|
-
|
|
1505
|
+
// @public (undocumented)
|
|
1506
|
+
export type RequestParams = {
|
|
1258
1507
|
[key: string]: any;
|
|
1259
1508
|
};
|
|
1260
1509
|
|
|
1261
|
-
|
|
1510
|
+
// @public (undocumented)
|
|
1511
|
+
export interface ResponseFileItem {
|
|
1512
|
+
// (undocumented)
|
|
1513
|
+
collection?: string;
|
|
1514
|
+
// (undocumented)
|
|
1515
|
+
details: MediaCollectionItemFullDetails;
|
|
1516
|
+
// (undocumented)
|
|
1262
1517
|
id: string;
|
|
1518
|
+
// (undocumented)
|
|
1263
1519
|
type: 'file';
|
|
1264
|
-
details: MediaCollectionItemFullDetails;
|
|
1265
|
-
collection?: string;
|
|
1266
1520
|
}
|
|
1267
1521
|
|
|
1268
|
-
|
|
1522
|
+
// @public (undocumented)
|
|
1523
|
+
export type RetryOptions = {
|
|
1269
1524
|
readonly startTimeoutInMs: number;
|
|
1270
1525
|
readonly maxAttempts: number;
|
|
1271
1526
|
readonly factor: number;
|
|
1272
1527
|
};
|
|
1273
1528
|
|
|
1274
|
-
|
|
1529
|
+
// @public (undocumented)
|
|
1530
|
+
export const safeUnsubscribe: (subscription: MediaSubscription) => void;
|
|
1275
1531
|
|
|
1276
|
-
|
|
1532
|
+
// @public (undocumented)
|
|
1533
|
+
export interface SourceFile {
|
|
1534
|
+
// (undocumented)
|
|
1535
|
+
collection?: string;
|
|
1536
|
+
// (undocumented)
|
|
1277
1537
|
id: string;
|
|
1538
|
+
// (undocumented)
|
|
1278
1539
|
owner: ClientAltBasedAuth | AsapBasedAuth;
|
|
1279
|
-
|
|
1540
|
+
// (undocumented)
|
|
1280
1541
|
version?: number;
|
|
1281
1542
|
}
|
|
1282
1543
|
|
|
1283
|
-
|
|
1284
|
-
|
|
1544
|
+
// @public (undocumented)
|
|
1545
|
+
export class StargateClient {
|
|
1285
1546
|
constructor(baseUrl: string | undefined);
|
|
1547
|
+
// (undocumented)
|
|
1286
1548
|
fetchToken(clientId: string): Promise<EdgeData>;
|
|
1549
|
+
// (undocumented)
|
|
1287
1550
|
isTokenExpired(token: EdgeData): boolean;
|
|
1288
1551
|
}
|
|
1289
1552
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
constructor(streams: LRUCache<string, ReplaySubject<T>>);
|
|
1293
|
-
has(id: string): boolean;
|
|
1294
|
-
set(id: string, stream: ReplaySubject<T>): void;
|
|
1295
|
-
get(id: string): ReplaySubject<T> | undefined;
|
|
1296
|
-
getOrInsert(id: string, callback: () => ReplaySubject<T>): ReplaySubject<T>;
|
|
1297
|
-
removeAll(): void;
|
|
1298
|
-
remove(id: string): void;
|
|
1299
|
-
get size(): number;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
export declare type TouchedFiles = {
|
|
1553
|
+
// @public (undocumented)
|
|
1554
|
+
export type TouchedFiles = {
|
|
1303
1555
|
created: CreatedTouchedFile[];
|
|
1304
1556
|
};
|
|
1305
1557
|
|
|
1306
|
-
|
|
1307
|
-
|
|
1558
|
+
// @public (undocumented)
|
|
1559
|
+
export interface TouchFileDescriptor {
|
|
1560
|
+
// (undocumented)
|
|
1308
1561
|
collection?: string;
|
|
1309
|
-
|
|
1310
|
-
expireAfter?: number;
|
|
1562
|
+
// (undocumented)
|
|
1311
1563
|
deletable?: boolean;
|
|
1564
|
+
// (undocumented)
|
|
1565
|
+
expireAfter?: number;
|
|
1566
|
+
// (undocumented)
|
|
1567
|
+
fileId: string;
|
|
1568
|
+
// (undocumented)
|
|
1569
|
+
occurrenceKey?: string;
|
|
1312
1570
|
}
|
|
1313
1571
|
|
|
1314
|
-
|
|
1572
|
+
// @public (undocumented)
|
|
1573
|
+
export type UploadableFile = {
|
|
1315
1574
|
content: ChunkinatorFile;
|
|
1316
1575
|
name?: string;
|
|
1317
1576
|
mimeType?: string;
|
|
1318
1577
|
collection?: string;
|
|
1319
1578
|
};
|
|
1320
1579
|
|
|
1321
|
-
|
|
1580
|
+
// @public (undocumented)
|
|
1581
|
+
export type UploadableFileUpfrontIds = {
|
|
1322
1582
|
id: string;
|
|
1323
1583
|
deferredUploadId: Promise<string>;
|
|
1324
1584
|
occurrenceKey?: string;
|
|
1325
1585
|
};
|
|
1326
1586
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1587
|
+
// @public (undocumented)
|
|
1588
|
+
export class UploadController {
|
|
1329
1589
|
constructor();
|
|
1330
|
-
|
|
1590
|
+
// (undocumented)
|
|
1331
1591
|
abort(): void;
|
|
1592
|
+
// (undocumented)
|
|
1593
|
+
abortFunction?: AbortFunction;
|
|
1594
|
+
// (undocumented)
|
|
1595
|
+
setAbort(abortFunction: AbortFunction): void;
|
|
1332
1596
|
}
|
|
1333
1597
|
|
|
1334
|
-
|
|
1598
|
+
// @public (undocumented)
|
|
1599
|
+
export type UploadEventPayloadMap = {
|
|
1335
1600
|
'file-added': FileState;
|
|
1336
1601
|
'media-viewed': MediaViewedEventPayload;
|
|
1337
1602
|
};
|
|
1338
1603
|
|
|
1339
|
-
|
|
1604
|
+
// @public (undocumented)
|
|
1605
|
+
export const uploadFile: (
|
|
1340
1606
|
file: UploadableFile,
|
|
1341
1607
|
store: MediaStore,
|
|
1342
1608
|
uploadableFileUpfrontIds: UploadableFileUpfrontIds,
|
|
1343
1609
|
callbacks?: UploadFileCallbacks | undefined,
|
|
1344
1610
|
) => UploadFileResult;
|
|
1345
1611
|
|
|
1346
|
-
|
|
1612
|
+
// @public (undocumented)
|
|
1613
|
+
export type UploadFileCallbacks = {
|
|
1347
1614
|
onProgress: (progress: number) => void;
|
|
1348
1615
|
onUploadFinish: (error?: any) => void;
|
|
1349
1616
|
};
|
|
1350
1617
|
|
|
1351
|
-
|
|
1618
|
+
// @public (undocumented)
|
|
1619
|
+
export interface UploadFileResult {
|
|
1620
|
+
// (undocumented)
|
|
1352
1621
|
cancel: () => void;
|
|
1353
1622
|
}
|
|
1354
1623
|
|
|
1355
|
-
|
|
1356
|
-
|
|
1624
|
+
// @public (undocumented)
|
|
1625
|
+
export interface UploadingFileState {
|
|
1626
|
+
// (undocumented)
|
|
1627
|
+
createdAt?: number;
|
|
1628
|
+
// (undocumented)
|
|
1357
1629
|
id: string;
|
|
1358
|
-
|
|
1359
|
-
name: string;
|
|
1360
|
-
size: number;
|
|
1361
|
-
progress: number;
|
|
1630
|
+
// (undocumented)
|
|
1362
1631
|
mediaType: MediaType;
|
|
1632
|
+
// (undocumented)
|
|
1363
1633
|
mimeType: string;
|
|
1634
|
+
// (undocumented)
|
|
1635
|
+
name: string;
|
|
1636
|
+
// (undocumented)
|
|
1637
|
+
occurrenceKey?: string;
|
|
1638
|
+
// (undocumented)
|
|
1364
1639
|
preview?: FilePreview | Promise<FilePreview>;
|
|
1365
|
-
|
|
1640
|
+
// (undocumented)
|
|
1641
|
+
progress: number;
|
|
1642
|
+
// (undocumented)
|
|
1643
|
+
size: number;
|
|
1644
|
+
// (undocumented)
|
|
1645
|
+
status: 'uploading';
|
|
1366
1646
|
}
|
|
1367
1647
|
|
|
1368
|
-
|
|
1369
|
-
|
|
1648
|
+
// @public (undocumented)
|
|
1649
|
+
export interface WithMediaClient {
|
|
1650
|
+
// (undocumented)
|
|
1370
1651
|
identifier?: Identifier;
|
|
1652
|
+
// (undocumented)
|
|
1653
|
+
mediaClient: MediaClient;
|
|
1371
1654
|
}
|
|
1372
1655
|
|
|
1373
|
-
|
|
1656
|
+
// @public (undocumented)
|
|
1657
|
+
export const withMediaClient: WithMediaClientFunction;
|
|
1374
1658
|
|
|
1375
|
-
|
|
1659
|
+
// @public (undocumented)
|
|
1660
|
+
export interface WithMediaClientConfig {
|
|
1661
|
+
// (undocumented)
|
|
1376
1662
|
mediaClientConfig: MediaClientConfig;
|
|
1377
1663
|
}
|
|
1378
1664
|
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1665
|
+
// @public (undocumented)
|
|
1666
|
+
export type WithMediaClientConfigProps<P extends WithMediaClient> = Omit<
|
|
1667
|
+
P,
|
|
1668
|
+
'mediaClient'
|
|
1669
|
+
> &
|
|
1670
|
+
WithMediaClientConfig;
|
|
1382
1671
|
|
|
1383
|
-
|
|
1672
|
+
// @public (undocumented)
|
|
1673
|
+
export type WithMediaClientFunction = <P extends WithMediaClient>(
|
|
1384
1674
|
Component: React_2.ComponentType<P>,
|
|
1385
1675
|
featureFlags?: MediaFeatureFlags,
|
|
1386
1676
|
) => React_2.ComponentType<WithMediaClientConfigProps<P>>;
|
|
1387
1677
|
|
|
1388
|
-
|
|
1678
|
+
// (No @packageDocumentation comment for this package)
|
|
1389
1679
|
```
|