@atlaskit/media-client 17.1.2 → 17.1.4
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 +0 -13
- 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 +70 -44
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/uploader/index.js +22 -20
- package/dist/cjs/utils/request/helpers.js +46 -22
- package/dist/cjs/utils/request/index.js +3 -2
- package/dist/cjs/version.json +1 -1
- 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 -35
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/uploader/index.js +14 -14
- package/dist/es2019/utils/request/helpers.js +29 -8
- package/dist/es2019/utils/request/index.js +4 -3
- package/dist/es2019/version.json +1 -1
- 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 -45
- package/dist/esm/index.js +1 -1
- package/dist/esm/uploader/index.js +23 -21
- package/dist/esm/utils/request/helpers.js +41 -20
- package/dist/esm/utils/request/index.js +4 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/client/file-fetcher/index.d.ts +9 -8
- package/dist/types/client/media-client.d.ts +2 -1
- package/dist/types/client/media-store/index.d.ts +15 -14
- package/dist/types/index.d.ts +3 -3
- package/dist/types/uploader/index.d.ts +2 -1
- package/dist/types/utils/request/helpers.d.ts +11 -3
- package/dist/types/utils/request/types.d.ts +5 -0
- package/package.json +5 -5
|
@@ -5,23 +5,23 @@ import { createHasher } from '../utils/hashing/hasherCreator';
|
|
|
5
5
|
import { UploaderError } from './error';
|
|
6
6
|
import { CHUNK_SIZE, PROCESSING_BATCH_SIZE } from '../constants';
|
|
7
7
|
import { calculateChunkSize, fileSizeError } from './calculateChunkSize';
|
|
8
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
8
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
9
9
|
|
|
10
10
|
const hashingFunction = async blob => {
|
|
11
11
|
const hasher = await createHasher();
|
|
12
12
|
return hasher.hash(blob);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const createProbingFunction = (store, deferredUploadId, collectionName) => async chunks => {
|
|
15
|
+
const createProbingFunction = (store, deferredUploadId, collectionName, traceContext) => async chunks => {
|
|
16
16
|
const response = await store.probeChunks(hashedChunks(chunks), {
|
|
17
17
|
collectionName,
|
|
18
18
|
uploadId: getMediaFeatureFlag('mediaUploadApiV2', store.featureFlags) ? await deferredUploadId : undefined
|
|
19
|
-
});
|
|
19
|
+
}, traceContext);
|
|
20
20
|
const results = response.data.results;
|
|
21
21
|
return Object.values(results).map(result => result.exists);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const createUploadingFunction = (store, deferredUploadId, collectionName) => async chunk => {
|
|
24
|
+
const createUploadingFunction = (store, deferredUploadId, collectionName, traceContext) => async chunk => {
|
|
25
25
|
const options = getMediaFeatureFlag('mediaUploadApiV2', store.featureFlags) ? {
|
|
26
26
|
partNumber: chunk.partNumber,
|
|
27
27
|
uploadId: await deferredUploadId
|
|
@@ -29,21 +29,21 @@ const createUploadingFunction = (store, deferredUploadId, collectionName) => asy
|
|
|
29
29
|
return await store.uploadChunk(chunk.hash, chunk.blob, {
|
|
30
30
|
collectionName,
|
|
31
31
|
...options
|
|
32
|
-
});
|
|
32
|
+
}, traceContext);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const createProcessingFunction = (store, deferredUploadId, collection) => {
|
|
35
|
+
const createProcessingFunction = (store, deferredUploadId, collection, traceContext) => {
|
|
36
36
|
let offset = 0;
|
|
37
37
|
return async chunks => {
|
|
38
38
|
await store.appendChunksToUpload(await deferredUploadId, {
|
|
39
39
|
chunks: hashedChunks(chunks),
|
|
40
40
|
offset
|
|
41
|
-
}, collection);
|
|
41
|
+
}, collection, traceContext);
|
|
42
42
|
offset += chunks.length;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const createFileFromUpload = async (file, store, uploadableFileUpfrontIds, uploadId) => {
|
|
46
|
+
const createFileFromUpload = async (file, store, uploadableFileUpfrontIds, uploadId, traceContext) => {
|
|
47
47
|
const {
|
|
48
48
|
collection,
|
|
49
49
|
name,
|
|
@@ -61,10 +61,10 @@ const createFileFromUpload = async (file, store, uploadableFileUpfrontIds, uploa
|
|
|
61
61
|
occurrenceKey,
|
|
62
62
|
collection,
|
|
63
63
|
replaceFileId: id
|
|
64
|
-
});
|
|
64
|
+
}, traceContext);
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
export const uploadFile = (file, store, uploadableFileUpfrontIds, callbacks) => {
|
|
67
|
+
export const uploadFile = (file, store, uploadableFileUpfrontIds, callbacks, traceContext) => {
|
|
68
68
|
const {
|
|
69
69
|
content,
|
|
70
70
|
collection
|
|
@@ -101,10 +101,10 @@ export const uploadFile = (file, store, uploadableFileUpfrontIds, callbacks) =>
|
|
|
101
101
|
probingBatchSize: 100,
|
|
102
102
|
chunkSize,
|
|
103
103
|
uploadingConcurrency: 3,
|
|
104
|
-
uploadingFunction: createUploadingFunction(store, deferredUploadId, collection),
|
|
105
|
-
probingFunction: createProbingFunction(store, deferredUploadId, collection),
|
|
104
|
+
uploadingFunction: createUploadingFunction(store, deferredUploadId, collection, traceContext),
|
|
105
|
+
probingFunction: createProbingFunction(store, deferredUploadId, collection, traceContext),
|
|
106
106
|
processingBatchSize: PROCESSING_BATCH_SIZE,
|
|
107
|
-
processingFunction: createProcessingFunction(store, deferredUploadId, collection)
|
|
107
|
+
processingFunction: createProcessingFunction(store, deferredUploadId, collection, traceContext)
|
|
108
108
|
}, {
|
|
109
109
|
onProgress(progress) {
|
|
110
110
|
if (callbacks) {
|
|
@@ -116,7 +116,7 @@ export const uploadFile = (file, store, uploadableFileUpfrontIds, callbacks) =>
|
|
|
116
116
|
|
|
117
117
|
const onUploadFinish = callbacks && callbacks.onUploadFinish || (() => {});
|
|
118
118
|
|
|
119
|
-
const subscription = from(deferredUploadId).pipe(concatMap(uploadId => chunkinatorObservable.pipe(concatMap(() => from(createFileFromUpload(file, store, uploadableFileUpfrontIds, uploadId)))))).subscribe({
|
|
119
|
+
const subscription = from(deferredUploadId).pipe(concatMap(uploadId => chunkinatorObservable.pipe(concatMap(() => from(createFileFromUpload(file, store, uploadableFileUpfrontIds, uploadId, traceContext)))))).subscribe({
|
|
120
120
|
error: err => onUploadFinish(err),
|
|
121
121
|
complete: () => onUploadFinish()
|
|
122
122
|
});
|
|
@@ -19,7 +19,26 @@ export function isFetchNetworkError(err) {
|
|
|
19
19
|
export function isRateLimitedError(error) {
|
|
20
20
|
return !!error && isRequestError(error) && error.attributes.statusCode === 429 || !!error && !!error.message && error.message.includes('429');
|
|
21
21
|
}
|
|
22
|
+
export const ZipkinHeaderKeys = {
|
|
23
|
+
traceId: 'x-b3-traceid',
|
|
24
|
+
spanId: 'x-b3-spanid',
|
|
25
|
+
parentSpanId: 'x-b3-parentspanid',
|
|
26
|
+
sampled: 'x-b3-sampled',
|
|
27
|
+
flags: 'x-b3-flags'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const mapTraceIdToRequestHeaders = traceContext => {
|
|
31
|
+
return traceContext ? {
|
|
32
|
+
[ZipkinHeaderKeys.traceId]: traceContext.traceId,
|
|
33
|
+
[ZipkinHeaderKeys.spanId]: traceContext.spanId
|
|
34
|
+
} : {};
|
|
35
|
+
};
|
|
36
|
+
|
|
22
37
|
export function mapAuthToRequestHeaders(auth) {
|
|
38
|
+
if (!auth) {
|
|
39
|
+
return {};
|
|
40
|
+
}
|
|
41
|
+
|
|
23
42
|
if (isClientBasedAuth(auth)) {
|
|
24
43
|
return {
|
|
25
44
|
'X-Client-Id': auth.clientId,
|
|
@@ -47,15 +66,14 @@ export function createUrl(url, {
|
|
|
47
66
|
parsedUrl.searchParams.sort();
|
|
48
67
|
return parsedUrl.toString();
|
|
49
68
|
}
|
|
50
|
-
export function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
...mapAuthToRequestHeaders(auth)
|
|
55
|
-
};
|
|
56
|
-
}
|
|
69
|
+
export function extendHeaders(headers, auth, traceContext) {
|
|
70
|
+
if (!auth && !traceContext && !headers) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
57
73
|
|
|
58
|
-
|
|
74
|
+
return { ...(headers !== null && headers !== void 0 ? headers : {}),
|
|
75
|
+
...mapAuthToRequestHeaders(auth),
|
|
76
|
+
...mapTraceIdToRequestHeaders(traceContext)
|
|
59
77
|
};
|
|
60
78
|
}
|
|
61
79
|
/**
|
|
@@ -250,4 +268,7 @@ export function extractMediaHeaders(response) {
|
|
|
250
268
|
mediaRegion,
|
|
251
269
|
mediaEnv
|
|
252
270
|
};
|
|
271
|
+
}
|
|
272
|
+
export function getRandomHex(size) {
|
|
273
|
+
return [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
253
274
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { RequestError, isRequestError } from './errors';
|
|
2
2
|
export { isRateLimitedError } from './helpers';
|
|
3
|
-
import { createUrl, fetchRetry, createProcessFetchResponse,
|
|
3
|
+
import { createUrl, fetchRetry, createProcessFetchResponse, extendHeaders } from './helpers';
|
|
4
4
|
export async function request(url, options = {}, controller) {
|
|
5
5
|
const {
|
|
6
6
|
method = 'GET',
|
|
@@ -9,7 +9,8 @@ export async function request(url, options = {}, controller) {
|
|
|
9
9
|
params,
|
|
10
10
|
headers,
|
|
11
11
|
body,
|
|
12
|
-
clientOptions = {}
|
|
12
|
+
clientOptions = {},
|
|
13
|
+
traceContext
|
|
13
14
|
} = options;
|
|
14
15
|
const {
|
|
15
16
|
retryOptions
|
|
@@ -24,7 +25,7 @@ export async function request(url, options = {}, controller) {
|
|
|
24
25
|
}), {
|
|
25
26
|
method,
|
|
26
27
|
body,
|
|
27
|
-
headers:
|
|
28
|
+
headers: extendHeaders(headers, auth, traceContext),
|
|
28
29
|
signal: controller && controller.signal
|
|
29
30
|
}).then(createProcessFetchResponse(metadata));
|
|
30
31
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -154,22 +154,23 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
154
154
|
key: "getFileBinaryURL",
|
|
155
155
|
value: function getFileBinaryURL(id, collectionName) {
|
|
156
156
|
return this.mediaStore.getFileBinaryURL(id, collectionName);
|
|
157
|
-
}
|
|
157
|
+
} // TODO: ----- ADD TICKET TO PASS TRACE ID to this.dataloader.load
|
|
158
|
+
|
|
158
159
|
}, {
|
|
159
160
|
key: "touchFiles",
|
|
160
|
-
value: function touchFiles(descriptors, collection) {
|
|
161
|
+
value: function touchFiles(descriptors, collection, traceContext) {
|
|
161
162
|
return this.mediaStore.touchFiles({
|
|
162
163
|
descriptors: descriptors
|
|
163
164
|
}, {
|
|
164
165
|
collection: collection
|
|
165
|
-
}).then(function (_ref2) {
|
|
166
|
+
}, traceContext).then(function (_ref2) {
|
|
166
167
|
var data = _ref2.data;
|
|
167
168
|
return data;
|
|
168
169
|
});
|
|
169
170
|
}
|
|
170
171
|
}, {
|
|
171
172
|
key: "generateUploadableFileUpfrontIds",
|
|
172
|
-
value: function generateUploadableFileUpfrontIds(collection) {
|
|
173
|
+
value: function generateUploadableFileUpfrontIds(collection, traceContext) {
|
|
173
174
|
var id = uuid();
|
|
174
175
|
var occurrenceKey = uuid();
|
|
175
176
|
var touchFileDescriptor = {
|
|
@@ -177,7 +178,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
177
178
|
occurrenceKey: occurrenceKey,
|
|
178
179
|
collection: collection
|
|
179
180
|
};
|
|
180
|
-
var deferredUploadId = this.touchFiles([touchFileDescriptor], collection).then(function (touchedFiles) {
|
|
181
|
+
var deferredUploadId = this.touchFiles([touchFileDescriptor], collection, traceContext).then(function (touchedFiles) {
|
|
181
182
|
return touchedFiles.created[0].uploadId;
|
|
182
183
|
});
|
|
183
184
|
return {
|
|
@@ -189,7 +190,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
189
190
|
}, {
|
|
190
191
|
key: "uploadExternal",
|
|
191
192
|
value: function () {
|
|
192
|
-
var _uploadExternal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url, collection) {
|
|
193
|
+
var _uploadExternal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(url, collection, traceContext) {
|
|
193
194
|
var _this3 = this;
|
|
194
195
|
|
|
195
196
|
var uploadableFileUpfrontIds, id, occurrenceKey, subject, deferredBlob, preview, name, fileState;
|
|
@@ -197,7 +198,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
197
198
|
while (1) {
|
|
198
199
|
switch (_context4.prev = _context4.next) {
|
|
199
200
|
case 0:
|
|
200
|
-
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection);
|
|
201
|
+
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection, traceContext);
|
|
201
202
|
id = uploadableFileUpfrontIds.id, occurrenceKey = uploadableFileUpfrontIds.occurrenceKey;
|
|
202
203
|
subject = createMediaSubject();
|
|
203
204
|
deferredBlob = fetch(url).then(function (response) {
|
|
@@ -235,7 +236,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
235
236
|
}, _callee2);
|
|
236
237
|
}));
|
|
237
238
|
|
|
238
|
-
return function (
|
|
239
|
+
return function (_x4, _x5) {
|
|
239
240
|
return _ref3.apply(this, arguments);
|
|
240
241
|
};
|
|
241
242
|
}());
|
|
@@ -295,7 +296,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
295
296
|
preview: preview
|
|
296
297
|
}); // we don't want to wait for the file to be upload
|
|
297
298
|
|
|
298
|
-
_this3.upload(file, undefined, uploadableFileUpfrontIds);
|
|
299
|
+
_this3.upload(file, undefined, uploadableFileUpfrontIds, traceContext);
|
|
299
300
|
|
|
300
301
|
_context3.next = 12;
|
|
301
302
|
return getDimensionsFromBlob(mediaType, blob);
|
|
@@ -315,7 +316,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
315
316
|
}, _callee3);
|
|
316
317
|
}));
|
|
317
318
|
|
|
318
|
-
return function (
|
|
319
|
+
return function (_x6, _x7) {
|
|
319
320
|
return _ref4.apply(this, arguments);
|
|
320
321
|
};
|
|
321
322
|
}()));
|
|
@@ -328,7 +329,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
328
329
|
}, _callee4, this);
|
|
329
330
|
}));
|
|
330
331
|
|
|
331
|
-
function uploadExternal(_x, _x2) {
|
|
332
|
+
function uploadExternal(_x, _x2, _x3) {
|
|
332
333
|
return _uploadExternal.apply(this, arguments);
|
|
333
334
|
}
|
|
334
335
|
|
|
@@ -336,7 +337,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
336
337
|
}()
|
|
337
338
|
}, {
|
|
338
339
|
key: "upload",
|
|
339
|
-
value: function upload(file, controller, uploadableFileUpfrontIds) {
|
|
340
|
+
value: function upload(file, controller, uploadableFileUpfrontIds, traceContext) {
|
|
340
341
|
var _this4 = this;
|
|
341
342
|
|
|
342
343
|
if (typeof file.content === 'string') {
|
|
@@ -349,7 +350,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
349
350
|
collection = file.collection;
|
|
350
351
|
|
|
351
352
|
if (!uploadableFileUpfrontIds) {
|
|
352
|
-
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection);
|
|
353
|
+
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection, traceContext);
|
|
353
354
|
}
|
|
354
355
|
|
|
355
356
|
var id = uploadableFileUpfrontIds.id;
|
|
@@ -414,7 +415,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
414
415
|
var _uploadFile = uploadFile(file, this.mediaStore, uploadableFileUpfrontIds, {
|
|
415
416
|
onUploadFinish: onUploadFinish,
|
|
416
417
|
onProgress: onProgress
|
|
417
|
-
}),
|
|
418
|
+
}, traceContext),
|
|
418
419
|
cancel = _uploadFile.cancel;
|
|
419
420
|
|
|
420
421
|
getFileStreamsCache().set(id, subject); // We should report progress asynchronously, since this is what consumer expects
|
|
@@ -432,7 +433,8 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
432
433
|
}
|
|
433
434
|
|
|
434
435
|
return fromObservable(subject);
|
|
435
|
-
}
|
|
436
|
+
} // TODO: ----- ADD TICKET
|
|
437
|
+
|
|
436
438
|
}, {
|
|
437
439
|
key: "downloadBinary",
|
|
438
440
|
value: function () {
|
|
@@ -469,7 +471,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
469
471
|
}, _callee5, this);
|
|
470
472
|
}));
|
|
471
473
|
|
|
472
|
-
function downloadBinary(
|
|
474
|
+
function downloadBinary(_x8) {
|
|
473
475
|
return _downloadBinary.apply(this, arguments);
|
|
474
476
|
}
|
|
475
477
|
|
|
@@ -480,6 +482,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
480
482
|
value: function () {
|
|
481
483
|
var _copyFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(source, destination) {
|
|
482
484
|
var options,
|
|
485
|
+
traceContext,
|
|
483
486
|
authProvider,
|
|
484
487
|
sourceCollection,
|
|
485
488
|
id,
|
|
@@ -513,6 +516,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
513
516
|
switch (_context6.prev = _context6.next) {
|
|
514
517
|
case 0:
|
|
515
518
|
options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
|
|
519
|
+
traceContext = _args6.length > 3 ? _args6[3] : undefined;
|
|
516
520
|
authProvider = source.authProvider, sourceCollection = source.collection, id = source.id;
|
|
517
521
|
destinationAuthProvider = destination.authProvider, destinationCollectionName = destination.collection, replaceFileId = destination.replaceFileId, occurrenceKey = destination.occurrenceKey;
|
|
518
522
|
preview = options.preview, mimeType = options.mimeType;
|
|
@@ -520,12 +524,12 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
520
524
|
authProvider: destinationAuthProvider
|
|
521
525
|
});
|
|
522
526
|
_context6.t0 = authToOwner;
|
|
523
|
-
_context6.next =
|
|
527
|
+
_context6.next = 9;
|
|
524
528
|
return authProvider({
|
|
525
529
|
collectionName: sourceCollection
|
|
526
530
|
});
|
|
527
531
|
|
|
528
|
-
case
|
|
532
|
+
case 9:
|
|
529
533
|
_context6.t1 = _context6.sent;
|
|
530
534
|
owner = (0, _context6.t0)(_context6.t1);
|
|
531
535
|
body = {
|
|
@@ -541,11 +545,11 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
541
545
|
occurrenceKey: occurrenceKey
|
|
542
546
|
};
|
|
543
547
|
cache = getFileStreamsCache();
|
|
544
|
-
_context6.prev =
|
|
545
|
-
_context6.next =
|
|
546
|
-
return mediaStore.copyFileWithToken(body, params);
|
|
548
|
+
_context6.prev = 14;
|
|
549
|
+
_context6.next = 17;
|
|
550
|
+
return mediaStore.copyFileWithToken(body, params, traceContext);
|
|
547
551
|
|
|
548
|
-
case
|
|
552
|
+
case 17:
|
|
549
553
|
_yield$mediaStore$cop = _context6.sent;
|
|
550
554
|
copiedFile = _yield$mediaStore$cop.data;
|
|
551
555
|
// if we were passed a "mimeType", we propagate it into copiedFileWithMimeType
|
|
@@ -570,19 +574,19 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
570
574
|
copiedMimeType;
|
|
571
575
|
|
|
572
576
|
if (!_context6.t2) {
|
|
573
|
-
_context6.next =
|
|
577
|
+
_context6.next = 31;
|
|
574
578
|
break;
|
|
575
579
|
}
|
|
576
580
|
|
|
577
|
-
_context6.next =
|
|
581
|
+
_context6.next = 30;
|
|
578
582
|
return shouldFetchRemoteFileStates(mediaType, copiedMimeType, preview);
|
|
579
583
|
|
|
580
|
-
case
|
|
584
|
+
case 30:
|
|
581
585
|
_context6.t2 = _context6.sent;
|
|
582
586
|
|
|
583
|
-
case
|
|
587
|
+
case 31:
|
|
584
588
|
if (!_context6.t2) {
|
|
585
|
-
_context6.next =
|
|
589
|
+
_context6.next = 36;
|
|
586
590
|
break;
|
|
587
591
|
}
|
|
588
592
|
|
|
@@ -598,24 +602,24 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
598
602
|
return subject.complete();
|
|
599
603
|
}
|
|
600
604
|
});
|
|
601
|
-
_context6.next =
|
|
605
|
+
_context6.next = 37;
|
|
602
606
|
break;
|
|
603
607
|
|
|
604
|
-
case
|
|
608
|
+
case 36:
|
|
605
609
|
if (!isProcessingFileState(copiedFileState)) {
|
|
606
610
|
subject.next(_objectSpread(_objectSpread({}, copiedFileState), !isErrorFileState(copiedFileState) && previewOverride));
|
|
607
611
|
}
|
|
608
612
|
|
|
609
|
-
case
|
|
613
|
+
case 37:
|
|
610
614
|
if (!cache.has(copiedId)) {
|
|
611
615
|
getFileStreamsCache().set(copiedId, subject);
|
|
612
616
|
}
|
|
613
617
|
|
|
614
618
|
return _context6.abrupt("return", copiedFile);
|
|
615
619
|
|
|
616
|
-
case
|
|
617
|
-
_context6.prev =
|
|
618
|
-
_context6.t3 = _context6["catch"](
|
|
620
|
+
case 41:
|
|
621
|
+
_context6.prev = 41;
|
|
622
|
+
_context6.t3 = _context6["catch"](14);
|
|
619
623
|
|
|
620
624
|
if (processingSubscription) {
|
|
621
625
|
processingSubscription.unsubscribe();
|
|
@@ -634,15 +638,15 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
634
638
|
|
|
635
639
|
throw _context6.t3;
|
|
636
640
|
|
|
637
|
-
case
|
|
641
|
+
case 46:
|
|
638
642
|
case "end":
|
|
639
643
|
return _context6.stop();
|
|
640
644
|
}
|
|
641
645
|
}
|
|
642
|
-
}, _callee6, this, [[
|
|
646
|
+
}, _callee6, this, [[14, 41]]);
|
|
643
647
|
}));
|
|
644
648
|
|
|
645
|
-
function copyFile(
|
|
649
|
+
function copyFile(_x9, _x10) {
|
|
646
650
|
return _copyFile.apply(this, arguments);
|
|
647
651
|
}
|
|
648
652
|
|
|
@@ -28,8 +28,8 @@ export var MediaClient = /*#__PURE__*/function () {
|
|
|
28
28
|
|
|
29
29
|
_createClass(MediaClient, [{
|
|
30
30
|
key: "getImage",
|
|
31
|
-
value: function getImage(id, params, controller, fetchMaxRes) {
|
|
32
|
-
return this.mediaStore.getImage(id, params, controller, fetchMaxRes);
|
|
31
|
+
value: function getImage(id, params, controller, fetchMaxRes, traceContext) {
|
|
32
|
+
return this.mediaStore.getImage(id, params, controller, fetchMaxRes, traceContext);
|
|
33
33
|
}
|
|
34
34
|
}, {
|
|
35
35
|
key: "getImageUrl",
|