@atlaskit/media-client 18.1.0 → 19.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -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 +69 -52
- package/dist/cjs/models/file-state.js +4 -2
- package/dist/cjs/uploader/index.js +40 -70
- package/dist/cjs/utils/createFileDataLoader.js +32 -15
- package/dist/cjs/utils/request/helpers.js +39 -22
- package/dist/cjs/utils/request/index.js +5 -3
- 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 +50 -41
- package/dist/es2019/models/file-state.js +4 -2
- package/dist/es2019/uploader/index.js +17 -21
- package/dist/es2019/utils/createFileDataLoader.js +13 -3
- package/dist/es2019/utils/request/helpers.js +26 -8
- package/dist/es2019/utils/request/index.js +6 -4
- 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 +68 -50
- package/dist/esm/models/file-state.js +4 -2
- package/dist/esm/uploader/index.js +40 -69
- package/dist/esm/utils/createFileDataLoader.js +31 -13
- package/dist/esm/utils/request/helpers.js +36 -20
- package/dist/esm/utils/request/index.js +6 -4
- 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 +16 -21
- package/dist/types/models/file-state.d.ts +9 -6
- package/dist/types/models/media.d.ts +3 -1
- package/dist/types/uploader/index.d.ts +2 -1
- package/dist/types/utils/request/helpers.d.ts +10 -2
- package/dist/types/utils/request/types.d.ts +3 -0
- package/package.json +7 -15
- package/report.api.md +116 -75
- 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 -174
- 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 -5
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 19.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`81573c1dfa7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/81573c1dfa7) - Items call creates a batched metadata trace Id
|
|
8
|
+
- [`0bccac57db6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0bccac57db6) - remove mediaUploadApiV2 Feature flag
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`a8eeb045e3a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a8eeb045e3a) - adding media only callouts to docs
|
|
13
|
+
- [`3d40d5e9b37`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3d40d5e9b37) - Adopt updated version of getRandomHex function for generating traceId
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 19.0.0
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- [`5eb06146a4e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5eb06146a4e) - Added support traceContext to be supplied to all request endpoint points.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [`358de54a124`](https://bitbucket.org/atlassian/atlassian-frontend/commits/358de54a124) - Allow collection-fetcher endpoints to pass traceContext
|
|
25
|
+
|
|
3
26
|
## 18.1.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
|
@@ -90,7 +90,7 @@ var CollectionFetcher = /*#__PURE__*/function () {
|
|
|
90
90
|
}
|
|
91
91
|
}, {
|
|
92
92
|
key: "getItems",
|
|
93
|
-
value: function getItems(collectionName, params) {
|
|
93
|
+
value: function getItems(collectionName, params, traceContext) {
|
|
94
94
|
var _this2 = this;
|
|
95
95
|
|
|
96
96
|
if (!collectionCache[collectionName]) {
|
|
@@ -101,7 +101,7 @@ var CollectionFetcher = /*#__PURE__*/function () {
|
|
|
101
101
|
var subject = collection.subject;
|
|
102
102
|
this.mediaStore.getCollectionItems(collectionName, _objectSpread(_objectSpread({}, params), {}, {
|
|
103
103
|
details: 'full'
|
|
104
|
-
})).then(function (items) {
|
|
104
|
+
}), traceContext).then(function (items) {
|
|
105
105
|
var _items$data = items.data,
|
|
106
106
|
contents = _items$data.contents,
|
|
107
107
|
nextInclusiveStartKey = _items$data.nextInclusiveStartKey;
|
|
@@ -121,14 +121,14 @@ var CollectionFetcher = /*#__PURE__*/function () {
|
|
|
121
121
|
}, {
|
|
122
122
|
key: "removeFile",
|
|
123
123
|
value: function () {
|
|
124
|
-
var _removeFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(id, collectionName, occurrenceKey) {
|
|
124
|
+
var _removeFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(id, collectionName, occurrenceKey, traceContext) {
|
|
125
125
|
var collection;
|
|
126
126
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
127
127
|
while (1) {
|
|
128
128
|
switch (_context.prev = _context.next) {
|
|
129
129
|
case 0:
|
|
130
130
|
_context.next = 2;
|
|
131
|
-
return this.mediaStore.removeCollectionFile(id, collectionName, occurrenceKey);
|
|
131
|
+
return this.mediaStore.removeCollectionFile(id, collectionName, occurrenceKey, traceContext);
|
|
132
132
|
|
|
133
133
|
case 2:
|
|
134
134
|
this.removeFromCache(id, collectionName);
|
|
@@ -143,7 +143,7 @@ var CollectionFetcher = /*#__PURE__*/function () {
|
|
|
143
143
|
}, _callee, this);
|
|
144
144
|
}));
|
|
145
145
|
|
|
146
|
-
function removeFile(_x, _x2, _x3) {
|
|
146
|
+
function removeFile(_x, _x2, _x3, _x4) {
|
|
147
147
|
return _removeFile.apply(this, arguments);
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -152,7 +152,7 @@ var CollectionFetcher = /*#__PURE__*/function () {
|
|
|
152
152
|
}, {
|
|
153
153
|
key: "loadNextPage",
|
|
154
154
|
value: function () {
|
|
155
|
-
var _loadNextPage = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(collectionName, params) {
|
|
155
|
+
var _loadNextPage = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(collectionName, params, traceContext) {
|
|
156
156
|
var collection, isLoading, _collectionCache$coll, inclusiveStartKey, currentItems, subject, response, _response$data, contents, nextInclusiveStartKey, newItems, items;
|
|
157
157
|
|
|
158
158
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
@@ -176,7 +176,7 @@ var CollectionFetcher = /*#__PURE__*/function () {
|
|
|
176
176
|
return this.mediaStore.getCollectionItems(collectionName, _objectSpread(_objectSpread({}, params), {}, {
|
|
177
177
|
inclusiveStartKey: inclusiveStartKey,
|
|
178
178
|
details: 'full'
|
|
179
|
-
}));
|
|
179
|
+
}), traceContext);
|
|
180
180
|
|
|
181
181
|
case 8:
|
|
182
182
|
response = _context2.sent;
|
|
@@ -200,7 +200,7 @@ var CollectionFetcher = /*#__PURE__*/function () {
|
|
|
200
200
|
}, _callee2, this);
|
|
201
201
|
}));
|
|
202
202
|
|
|
203
|
-
function loadNextPage(
|
|
203
|
+
function loadNextPage(_x5, _x6, _x7) {
|
|
204
204
|
return _loadNextPage.apply(this, arguments);
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -201,22 +201,23 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
201
201
|
key: "getFileBinaryURL",
|
|
202
202
|
value: function getFileBinaryURL(id, collectionName) {
|
|
203
203
|
return this.mediaStore.getFileBinaryURL(id, collectionName);
|
|
204
|
-
}
|
|
204
|
+
} // TODO: ----- ADD TICKET TO PASS TRACE ID to this.dataloader.load
|
|
205
|
+
|
|
205
206
|
}, {
|
|
206
207
|
key: "touchFiles",
|
|
207
|
-
value: function touchFiles(descriptors, collection) {
|
|
208
|
+
value: function touchFiles(descriptors, collection, traceContext) {
|
|
208
209
|
return this.mediaStore.touchFiles({
|
|
209
210
|
descriptors: descriptors
|
|
210
211
|
}, {
|
|
211
212
|
collection: collection
|
|
212
|
-
}).then(function (_ref2) {
|
|
213
|
+
}, traceContext).then(function (_ref2) {
|
|
213
214
|
var data = _ref2.data;
|
|
214
215
|
return data;
|
|
215
216
|
});
|
|
216
217
|
}
|
|
217
218
|
}, {
|
|
218
219
|
key: "generateUploadableFileUpfrontIds",
|
|
219
|
-
value: function generateUploadableFileUpfrontIds(collection) {
|
|
220
|
+
value: function generateUploadableFileUpfrontIds(collection, traceContext) {
|
|
220
221
|
var id = (0, _v.default)();
|
|
221
222
|
var occurrenceKey = (0, _v.default)();
|
|
222
223
|
var touchFileDescriptor = {
|
|
@@ -224,7 +225,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
224
225
|
occurrenceKey: occurrenceKey,
|
|
225
226
|
collection: collection
|
|
226
227
|
};
|
|
227
|
-
var deferredUploadId = this.touchFiles([touchFileDescriptor], collection).then(function (touchedFiles) {
|
|
228
|
+
var deferredUploadId = this.touchFiles([touchFileDescriptor], collection, traceContext).then(function (touchedFiles) {
|
|
228
229
|
return touchedFiles.created[0].uploadId;
|
|
229
230
|
});
|
|
230
231
|
return {
|
|
@@ -236,7 +237,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
236
237
|
}, {
|
|
237
238
|
key: "uploadExternal",
|
|
238
239
|
value: function () {
|
|
239
|
-
var _uploadExternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(url, collection) {
|
|
240
|
+
var _uploadExternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(url, collection, traceContext) {
|
|
240
241
|
var _this3 = this;
|
|
241
242
|
|
|
242
243
|
var uploadableFileUpfrontIds, id, occurrenceKey, subject, deferredBlob, preview, name, fileState;
|
|
@@ -244,7 +245,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
244
245
|
while (1) {
|
|
245
246
|
switch (_context4.prev = _context4.next) {
|
|
246
247
|
case 0:
|
|
247
|
-
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection);
|
|
248
|
+
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection, traceContext);
|
|
248
249
|
id = uploadableFileUpfrontIds.id, occurrenceKey = uploadableFileUpfrontIds.occurrenceKey;
|
|
249
250
|
subject = (0, _createMediaSubject.createMediaSubject)();
|
|
250
251
|
deferredBlob = fetch(url).then(function (response) {
|
|
@@ -282,7 +283,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
282
283
|
}, _callee2);
|
|
283
284
|
}));
|
|
284
285
|
|
|
285
|
-
return function (
|
|
286
|
+
return function (_x4, _x5) {
|
|
286
287
|
return _ref3.apply(this, arguments);
|
|
287
288
|
};
|
|
288
289
|
}());
|
|
@@ -342,7 +343,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
342
343
|
preview: preview
|
|
343
344
|
}); // we don't want to wait for the file to be upload
|
|
344
345
|
|
|
345
|
-
_this3.upload(file, undefined, uploadableFileUpfrontIds);
|
|
346
|
+
_this3.upload(file, undefined, uploadableFileUpfrontIds, traceContext);
|
|
346
347
|
|
|
347
348
|
_context3.next = 12;
|
|
348
349
|
return (0, _getDimensionsFromBlob.getDimensionsFromBlob)(mediaType, blob);
|
|
@@ -362,7 +363,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
362
363
|
}, _callee3);
|
|
363
364
|
}));
|
|
364
365
|
|
|
365
|
-
return function (
|
|
366
|
+
return function (_x6, _x7) {
|
|
366
367
|
return _ref4.apply(this, arguments);
|
|
367
368
|
};
|
|
368
369
|
}()));
|
|
@@ -375,7 +376,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
375
376
|
}, _callee4, this);
|
|
376
377
|
}));
|
|
377
378
|
|
|
378
|
-
function uploadExternal(_x, _x2) {
|
|
379
|
+
function uploadExternal(_x, _x2, _x3) {
|
|
379
380
|
return _uploadExternal.apply(this, arguments);
|
|
380
381
|
}
|
|
381
382
|
|
|
@@ -383,7 +384,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
383
384
|
}()
|
|
384
385
|
}, {
|
|
385
386
|
key: "upload",
|
|
386
|
-
value: function upload(file, controller, uploadableFileUpfrontIds) {
|
|
387
|
+
value: function upload(file, controller, uploadableFileUpfrontIds, traceContext) {
|
|
387
388
|
var _this4 = this;
|
|
388
389
|
|
|
389
390
|
if (typeof file.content === 'string') {
|
|
@@ -396,7 +397,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
396
397
|
collection = file.collection;
|
|
397
398
|
|
|
398
399
|
if (!uploadableFileUpfrontIds) {
|
|
399
|
-
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection);
|
|
400
|
+
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection, traceContext);
|
|
400
401
|
}
|
|
401
402
|
|
|
402
403
|
var id = uploadableFileUpfrontIds.id;
|
|
@@ -461,7 +462,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
461
462
|
var _uploadFile = (0, _uploader.uploadFile)(file, this.mediaStore, uploadableFileUpfrontIds, {
|
|
462
463
|
onUploadFinish: onUploadFinish,
|
|
463
464
|
onProgress: onProgress
|
|
464
|
-
}),
|
|
465
|
+
}, traceContext),
|
|
465
466
|
cancel = _uploadFile.cancel;
|
|
466
467
|
|
|
467
468
|
(0, _fileStreamsCache.getFileStreamsCache)().set(id, subject); // We should report progress asynchronously, since this is what consumer expects
|
|
@@ -479,7 +480,8 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
479
480
|
}
|
|
480
481
|
|
|
481
482
|
return (0, _mediaSubscribable.fromObservable)(subject);
|
|
482
|
-
}
|
|
483
|
+
} // TODO: ----- ADD TICKET
|
|
484
|
+
|
|
483
485
|
}, {
|
|
484
486
|
key: "downloadBinary",
|
|
485
487
|
value: function () {
|
|
@@ -517,7 +519,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
517
519
|
}, _callee5, this);
|
|
518
520
|
}));
|
|
519
521
|
|
|
520
|
-
function downloadBinary(
|
|
522
|
+
function downloadBinary(_x8) {
|
|
521
523
|
return _downloadBinary.apply(this, arguments);
|
|
522
524
|
}
|
|
523
525
|
|
|
@@ -528,6 +530,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
528
530
|
value: function () {
|
|
529
531
|
var _copyFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(source, destination) {
|
|
530
532
|
var options,
|
|
533
|
+
traceContext,
|
|
531
534
|
authProvider,
|
|
532
535
|
sourceCollection,
|
|
533
536
|
id,
|
|
@@ -561,6 +564,7 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
561
564
|
switch (_context6.prev = _context6.next) {
|
|
562
565
|
case 0:
|
|
563
566
|
options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
|
|
567
|
+
traceContext = _args6.length > 3 ? _args6[3] : undefined;
|
|
564
568
|
authProvider = source.authProvider, sourceCollection = source.collection, id = source.id;
|
|
565
569
|
destinationAuthProvider = destination.authProvider, destinationCollectionName = destination.collection, replaceFileId = destination.replaceFileId, occurrenceKey = destination.occurrenceKey;
|
|
566
570
|
preview = options.preview, mimeType = options.mimeType;
|
|
@@ -568,12 +572,12 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
568
572
|
authProvider: destinationAuthProvider
|
|
569
573
|
});
|
|
570
574
|
_context6.t0 = _mediaCore.authToOwner;
|
|
571
|
-
_context6.next =
|
|
575
|
+
_context6.next = 9;
|
|
572
576
|
return authProvider({
|
|
573
577
|
collectionName: sourceCollection
|
|
574
578
|
});
|
|
575
579
|
|
|
576
|
-
case
|
|
580
|
+
case 9:
|
|
577
581
|
_context6.t1 = _context6.sent;
|
|
578
582
|
owner = (0, _context6.t0)(_context6.t1);
|
|
579
583
|
body = {
|
|
@@ -589,11 +593,11 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
589
593
|
occurrenceKey: occurrenceKey
|
|
590
594
|
};
|
|
591
595
|
cache = (0, _fileStreamsCache.getFileStreamsCache)();
|
|
592
|
-
_context6.prev =
|
|
593
|
-
_context6.next =
|
|
594
|
-
return mediaStore.copyFileWithToken(body, params);
|
|
596
|
+
_context6.prev = 14;
|
|
597
|
+
_context6.next = 17;
|
|
598
|
+
return mediaStore.copyFileWithToken(body, params, traceContext);
|
|
595
599
|
|
|
596
|
-
case
|
|
600
|
+
case 17:
|
|
597
601
|
_yield$mediaStore$cop = _context6.sent;
|
|
598
602
|
copiedFile = _yield$mediaStore$cop.data;
|
|
599
603
|
// if we were passed a "mimeType", we propagate it into copiedFileWithMimeType
|
|
@@ -618,19 +622,19 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
618
622
|
copiedMimeType;
|
|
619
623
|
|
|
620
624
|
if (!_context6.t2) {
|
|
621
|
-
_context6.next =
|
|
625
|
+
_context6.next = 31;
|
|
622
626
|
break;
|
|
623
627
|
}
|
|
624
628
|
|
|
625
|
-
_context6.next =
|
|
629
|
+
_context6.next = 30;
|
|
626
630
|
return (0, _shouldFetchRemoteFileStates.shouldFetchRemoteFileStates)(mediaType, copiedMimeType, preview);
|
|
627
631
|
|
|
628
|
-
case
|
|
632
|
+
case 30:
|
|
629
633
|
_context6.t2 = _context6.sent;
|
|
630
634
|
|
|
631
|
-
case
|
|
635
|
+
case 31:
|
|
632
636
|
if (!_context6.t2) {
|
|
633
|
-
_context6.next =
|
|
637
|
+
_context6.next = 36;
|
|
634
638
|
break;
|
|
635
639
|
}
|
|
636
640
|
|
|
@@ -646,24 +650,24 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
646
650
|
return subject.complete();
|
|
647
651
|
}
|
|
648
652
|
});
|
|
649
|
-
_context6.next =
|
|
653
|
+
_context6.next = 37;
|
|
650
654
|
break;
|
|
651
655
|
|
|
652
|
-
case
|
|
656
|
+
case 36:
|
|
653
657
|
if (!(0, _fileState.isProcessingFileState)(copiedFileState)) {
|
|
654
658
|
subject.next(_objectSpread(_objectSpread({}, copiedFileState), !(0, _fileState.isErrorFileState)(copiedFileState) && previewOverride));
|
|
655
659
|
}
|
|
656
660
|
|
|
657
|
-
case
|
|
661
|
+
case 37:
|
|
658
662
|
if (!cache.has(copiedId)) {
|
|
659
663
|
(0, _fileStreamsCache.getFileStreamsCache)().set(copiedId, subject);
|
|
660
664
|
}
|
|
661
665
|
|
|
662
666
|
return _context6.abrupt("return", copiedFile);
|
|
663
667
|
|
|
664
|
-
case
|
|
665
|
-
_context6.prev =
|
|
666
|
-
_context6.t3 = _context6["catch"](
|
|
668
|
+
case 41:
|
|
669
|
+
_context6.prev = 41;
|
|
670
|
+
_context6.t3 = _context6["catch"](14);
|
|
667
671
|
|
|
668
672
|
if (processingSubscription) {
|
|
669
673
|
processingSubscription.unsubscribe();
|
|
@@ -682,15 +686,15 @@ var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
682
686
|
|
|
683
687
|
throw _context6.t3;
|
|
684
688
|
|
|
685
|
-
case
|
|
689
|
+
case 46:
|
|
686
690
|
case "end":
|
|
687
691
|
return _context6.stop();
|
|
688
692
|
}
|
|
689
693
|
}
|
|
690
|
-
}, _callee6, this, [[
|
|
694
|
+
}, _callee6, this, [[14, 41]]);
|
|
691
695
|
}));
|
|
692
696
|
|
|
693
|
-
function copyFile(
|
|
697
|
+
function copyFile(_x9, _x10) {
|
|
694
698
|
return _copyFile.apply(this, arguments);
|
|
695
699
|
}
|
|
696
700
|
|
|
@@ -51,8 +51,8 @@ var MediaClient = /*#__PURE__*/function () {
|
|
|
51
51
|
|
|
52
52
|
(0, _createClass2.default)(MediaClient, [{
|
|
53
53
|
key: "getImage",
|
|
54
|
-
value: function getImage(id, params, controller, fetchMaxRes,
|
|
55
|
-
return this.mediaStore.getImage(id, params, controller, fetchMaxRes,
|
|
54
|
+
value: function getImage(id, params, controller, fetchMaxRes, traceContext) {
|
|
55
|
+
return this.mediaStore.getImage(id, params, controller, fetchMaxRes, traceContext);
|
|
56
56
|
}
|
|
57
57
|
}, {
|
|
58
58
|
key: "getImageUrl",
|