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