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