@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
|
@@ -39,13 +39,6 @@ var jsonHeaders = {
|
|
|
39
39
|
Accept: 'application/json',
|
|
40
40
|
'Content-Type': 'application/json'
|
|
41
41
|
};
|
|
42
|
-
export var ZipkinHeaderKeys = {
|
|
43
|
-
traceId: 'x-b3-traceid',
|
|
44
|
-
spanId: 'x-b3-spanid',
|
|
45
|
-
parentSpanId: 'x-b3-parentspanid',
|
|
46
|
-
sampled: 'x-b3-sampled',
|
|
47
|
-
flags: 'x-b3-flags'
|
|
48
|
-
};
|
|
49
42
|
export var MediaStore = /*#__PURE__*/function () {
|
|
50
43
|
function MediaStore(config, featureFlags) {
|
|
51
44
|
var _this = this;
|
|
@@ -67,7 +60,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
67
60
|
_createClass(MediaStore, [{
|
|
68
61
|
key: "getCollectionItems",
|
|
69
62
|
value: function () {
|
|
70
|
-
var _getCollectionItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(collectionName, params) {
|
|
63
|
+
var _getCollectionItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(collectionName, params, traceContext) {
|
|
71
64
|
var metadata, options, response, _yield$createMapRespo, _yield$createMapRespo2, contents, nextInclusiveStartKey, contentsWithoutEmptyFiles;
|
|
72
65
|
|
|
73
66
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -85,7 +78,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
85
78
|
params: _objectSpread(_objectSpread({}, defaultGetCollectionItems), params),
|
|
86
79
|
headers: {
|
|
87
80
|
Accept: 'application/json'
|
|
88
|
-
}
|
|
81
|
+
},
|
|
82
|
+
traceContext: traceContext
|
|
89
83
|
});
|
|
90
84
|
_context.next = 4;
|
|
91
85
|
return this.request("/collection/".concat(collectionName, "/items"), options);
|
|
@@ -120,7 +114,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
120
114
|
}, _callee, this);
|
|
121
115
|
}));
|
|
122
116
|
|
|
123
|
-
function getCollectionItems(_x, _x2) {
|
|
117
|
+
function getCollectionItems(_x, _x2, _x3) {
|
|
124
118
|
return _getCollectionItems.apply(this, arguments);
|
|
125
119
|
}
|
|
126
120
|
|
|
@@ -129,7 +123,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
129
123
|
}, {
|
|
130
124
|
key: "removeCollectionFile",
|
|
131
125
|
value: function () {
|
|
132
|
-
var _removeCollectionFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, collectionName, occurrenceKey) {
|
|
126
|
+
var _removeCollectionFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, collectionName, occurrenceKey, traceContext) {
|
|
133
127
|
var metadata, body, options;
|
|
134
128
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
135
129
|
while (1) {
|
|
@@ -157,7 +151,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
157
151
|
Accept: 'application/json',
|
|
158
152
|
'Content-Type': 'application/json'
|
|
159
153
|
},
|
|
160
|
-
body: JSON.stringify(body)
|
|
154
|
+
body: JSON.stringify(body),
|
|
155
|
+
traceContext: traceContext
|
|
161
156
|
});
|
|
162
157
|
_context2.next = 5;
|
|
163
158
|
return this.request("/collection/".concat(collectionName), options);
|
|
@@ -170,7 +165,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
170
165
|
}, _callee2, this);
|
|
171
166
|
}));
|
|
172
167
|
|
|
173
|
-
function removeCollectionFile(
|
|
168
|
+
function removeCollectionFile(_x4, _x5, _x6, _x7) {
|
|
174
169
|
return _removeCollectionFile.apply(this, arguments);
|
|
175
170
|
}
|
|
176
171
|
|
|
@@ -181,6 +176,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
181
176
|
value: function createUpload() {
|
|
182
177
|
var createUpTo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
183
178
|
var collectionName = arguments.length > 1 ? arguments[1] : undefined;
|
|
179
|
+
var traceContext = arguments.length > 2 ? arguments[2] : undefined;
|
|
184
180
|
var metadata = {
|
|
185
181
|
method: 'POST',
|
|
186
182
|
endpoint: '/upload'
|
|
@@ -195,7 +191,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
195
191
|
},
|
|
196
192
|
headers: {
|
|
197
193
|
Accept: 'application/json'
|
|
198
|
-
}
|
|
194
|
+
},
|
|
195
|
+
traceContext: traceContext
|
|
199
196
|
});
|
|
200
197
|
|
|
201
198
|
return this.request("/upload", options).then(createMapResponseToJson(metadata));
|
|
@@ -208,6 +205,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
208
205
|
collectionName,
|
|
209
206
|
uploadId,
|
|
210
207
|
partNumber,
|
|
208
|
+
traceContext,
|
|
211
209
|
metadata,
|
|
212
210
|
options,
|
|
213
211
|
_args3 = arguments;
|
|
@@ -217,6 +215,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
217
215
|
switch (_context3.prev = _context3.next) {
|
|
218
216
|
case 0:
|
|
219
217
|
_ref = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {}, collectionName = _ref.collectionName, uploadId = _ref.uploadId, partNumber = _ref.partNumber;
|
|
218
|
+
traceContext = _args3.length > 3 ? _args3[3] : undefined;
|
|
220
219
|
metadata = {
|
|
221
220
|
method: 'PUT',
|
|
222
221
|
endpoint: '/chunk/{etag}'
|
|
@@ -229,12 +228,13 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
229
228
|
authContext: {
|
|
230
229
|
collectionName: collectionName
|
|
231
230
|
},
|
|
232
|
-
body: blob
|
|
231
|
+
body: blob,
|
|
232
|
+
traceContext: traceContext
|
|
233
233
|
});
|
|
234
|
-
_context3.next =
|
|
234
|
+
_context3.next = 6;
|
|
235
235
|
return this.request("/chunk/".concat(etag), options);
|
|
236
236
|
|
|
237
|
-
case
|
|
237
|
+
case 6:
|
|
238
238
|
case "end":
|
|
239
239
|
return _context3.stop();
|
|
240
240
|
}
|
|
@@ -242,7 +242,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
242
242
|
}, _callee3, this);
|
|
243
243
|
}));
|
|
244
244
|
|
|
245
|
-
function uploadChunk(
|
|
245
|
+
function uploadChunk(_x8, _x9) {
|
|
246
246
|
return _uploadChunk.apply(this, arguments);
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -255,6 +255,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
255
255
|
collectionName = _ref2.collectionName,
|
|
256
256
|
uploadId = _ref2.uploadId;
|
|
257
257
|
|
|
258
|
+
var traceContext = arguments.length > 2 ? arguments[2] : undefined;
|
|
258
259
|
var metadata = {
|
|
259
260
|
method: 'POST',
|
|
260
261
|
endpoint: '/chunk/probe'
|
|
@@ -270,7 +271,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
270
271
|
headers: jsonHeaders,
|
|
271
272
|
body: JSON.stringify({
|
|
272
273
|
chunks: chunks
|
|
273
|
-
})
|
|
274
|
+
}),
|
|
275
|
+
traceContext: traceContext
|
|
274
276
|
});
|
|
275
277
|
|
|
276
278
|
return this.request("/chunk/probe", options).then(createMapResponseToJson(metadata));
|
|
@@ -279,6 +281,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
279
281
|
key: "createFileFromUpload",
|
|
280
282
|
value: function createFileFromUpload(body) {
|
|
281
283
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
284
|
+
var traceContext = arguments.length > 2 ? arguments[2] : undefined;
|
|
282
285
|
var metadata = {
|
|
283
286
|
method: 'POST',
|
|
284
287
|
endpoint: '/file/upload'
|
|
@@ -290,7 +293,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
290
293
|
},
|
|
291
294
|
params: params,
|
|
292
295
|
headers: jsonHeaders,
|
|
293
|
-
body: JSON.stringify(body)
|
|
296
|
+
body: JSON.stringify(body),
|
|
297
|
+
traceContext: traceContext
|
|
294
298
|
});
|
|
295
299
|
|
|
296
300
|
return this.request('/file/upload', options).then(createMapResponseToJson(metadata));
|
|
@@ -299,6 +303,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
299
303
|
key: "touchFiles",
|
|
300
304
|
value: function touchFiles(body) {
|
|
301
305
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
306
|
+
var traceContext = arguments.length > 2 ? arguments[2] : undefined;
|
|
302
307
|
var metadata = {
|
|
303
308
|
method: 'POST',
|
|
304
309
|
endpoint: '/upload/createWithFiles'
|
|
@@ -309,7 +314,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
309
314
|
collectionName: params.collection
|
|
310
315
|
},
|
|
311
316
|
headers: jsonHeaders,
|
|
312
|
-
body: JSON.stringify(body)
|
|
317
|
+
body: JSON.stringify(body),
|
|
318
|
+
traceContext: traceContext
|
|
313
319
|
});
|
|
314
320
|
|
|
315
321
|
return this.request('/upload/createWithFiles', options).then(createMapResponseToJson(metadata));
|
|
@@ -318,6 +324,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
318
324
|
key: "getFile",
|
|
319
325
|
value: function getFile(fileId) {
|
|
320
326
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
327
|
+
var traceContext = arguments.length > 2 ? arguments[2] : undefined;
|
|
321
328
|
var metadata = {
|
|
322
329
|
method: 'GET',
|
|
323
330
|
endpoint: '/file/{fileId}'
|
|
@@ -327,7 +334,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
327
334
|
authContext: {
|
|
328
335
|
collectionName: params.collection
|
|
329
336
|
},
|
|
330
|
-
params: params
|
|
337
|
+
params: params,
|
|
338
|
+
traceContext: traceContext
|
|
331
339
|
});
|
|
332
340
|
|
|
333
341
|
return this.request("/file/".concat(fileId), options).then(createMapResponseToJson(metadata));
|
|
@@ -360,12 +368,13 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
360
368
|
}, _callee4, this);
|
|
361
369
|
}));
|
|
362
370
|
|
|
363
|
-
function getFileImageURL(
|
|
371
|
+
function getFileImageURL(_x10, _x11) {
|
|
364
372
|
return _getFileImageURL.apply(this, arguments);
|
|
365
373
|
}
|
|
366
374
|
|
|
367
375
|
return getFileImageURL;
|
|
368
|
-
}()
|
|
376
|
+
}() // TODO Create ticket in case Trace Id can be supported through query params
|
|
377
|
+
|
|
369
378
|
}, {
|
|
370
379
|
key: "getFileImageURLSync",
|
|
371
380
|
value: function getFileImageURLSync(id, params) {
|
|
@@ -415,7 +424,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
415
424
|
}, _callee5, this);
|
|
416
425
|
}));
|
|
417
426
|
|
|
418
|
-
function getFileBinaryURL(
|
|
427
|
+
function getFileBinaryURL(_x12, _x13) {
|
|
419
428
|
return _getFileBinaryURL.apply(this, arguments);
|
|
420
429
|
}
|
|
421
430
|
|
|
@@ -464,7 +473,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
464
473
|
}, _callee6, this);
|
|
465
474
|
}));
|
|
466
475
|
|
|
467
|
-
function getArtifactURL(
|
|
476
|
+
function getArtifactURL(_x14, _x15, _x16) {
|
|
468
477
|
return _getArtifactURL.apply(this, arguments);
|
|
469
478
|
}
|
|
470
479
|
|
|
@@ -473,9 +482,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
473
482
|
}, {
|
|
474
483
|
key: "getImage",
|
|
475
484
|
value: function () {
|
|
476
|
-
var _getImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, params, controller, fetchMaxRes,
|
|
477
|
-
var _ref4;
|
|
478
|
-
|
|
485
|
+
var _getImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, params, controller, fetchMaxRes, traceContext) {
|
|
479
486
|
var isWebpSupported, headers, metadata, options;
|
|
480
487
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
481
488
|
while (1) {
|
|
@@ -483,7 +490,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
483
490
|
case 0:
|
|
484
491
|
// TODO add checkWebpSupport() back https://product-fabric.atlassian.net/browse/MPT-584
|
|
485
492
|
isWebpSupported = false;
|
|
486
|
-
headers =
|
|
493
|
+
headers = {};
|
|
487
494
|
|
|
488
495
|
if (isWebpSupported) {
|
|
489
496
|
headers.accept = 'image/webp,image/*,*/*;q=0.8';
|
|
@@ -498,7 +505,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
498
505
|
collectionName: params && params.collection
|
|
499
506
|
},
|
|
500
507
|
params: extendImageParams(params, fetchMaxRes),
|
|
501
|
-
headers: headers
|
|
508
|
+
headers: headers,
|
|
509
|
+
traceContext: traceContext
|
|
502
510
|
});
|
|
503
511
|
return _context7.abrupt("return", this.request("/file/".concat(id, "/image"), options, controller).then(createMapResponseToBlob(metadata)));
|
|
504
512
|
|
|
@@ -510,7 +518,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
510
518
|
}, _callee7, this);
|
|
511
519
|
}));
|
|
512
520
|
|
|
513
|
-
function getImage(
|
|
521
|
+
function getImage(_x17, _x18, _x19, _x20, _x21) {
|
|
514
522
|
return _getImage.apply(this, arguments);
|
|
515
523
|
}
|
|
516
524
|
|
|
@@ -519,7 +527,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
519
527
|
}, {
|
|
520
528
|
key: "getItems",
|
|
521
529
|
value: function () {
|
|
522
|
-
var _getItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(ids, collectionName) {
|
|
530
|
+
var _getItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(ids, collectionName, traceContext) {
|
|
523
531
|
var descriptors, metadata, options;
|
|
524
532
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
525
533
|
while (1) {
|
|
@@ -543,7 +551,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
543
551
|
headers: jsonHeaders,
|
|
544
552
|
body: JSON.stringify({
|
|
545
553
|
descriptors: descriptors
|
|
546
|
-
})
|
|
554
|
+
}),
|
|
555
|
+
traceContext: traceContext
|
|
547
556
|
});
|
|
548
557
|
return _context8.abrupt("return", this.request('/items', options).then(createMapResponseToJson(metadata)));
|
|
549
558
|
|
|
@@ -555,7 +564,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
555
564
|
}, _callee8, this);
|
|
556
565
|
}));
|
|
557
566
|
|
|
558
|
-
function getItems(
|
|
567
|
+
function getItems(_x22, _x23, _x24) {
|
|
559
568
|
return _getItems.apply(this, arguments);
|
|
560
569
|
}
|
|
561
570
|
|
|
@@ -564,7 +573,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
564
573
|
}, {
|
|
565
574
|
key: "getImageMetadata",
|
|
566
575
|
value: function () {
|
|
567
|
-
var _getImageMetadata = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(id, params) {
|
|
576
|
+
var _getImageMetadata = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(id, params, traceContext) {
|
|
568
577
|
var metadata, options;
|
|
569
578
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
570
579
|
while (1) {
|
|
@@ -578,7 +587,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
578
587
|
authContext: {
|
|
579
588
|
collectionName: params && params.collection
|
|
580
589
|
},
|
|
581
|
-
params: params
|
|
590
|
+
params: params,
|
|
591
|
+
traceContext: traceContext
|
|
582
592
|
});
|
|
583
593
|
return _context9.abrupt("return", this.request("/file/".concat(id, "/image/metadata"), options).then(createMapResponseToJson(metadata)));
|
|
584
594
|
|
|
@@ -590,7 +600,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
590
600
|
}, _callee9, this);
|
|
591
601
|
}));
|
|
592
602
|
|
|
593
|
-
function getImageMetadata(
|
|
603
|
+
function getImageMetadata(_x25, _x26, _x27) {
|
|
594
604
|
return _getImageMetadata.apply(this, arguments);
|
|
595
605
|
}
|
|
596
606
|
|
|
@@ -599,7 +609,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
599
609
|
}, {
|
|
600
610
|
key: "appendChunksToUpload",
|
|
601
611
|
value: function () {
|
|
602
|
-
var _appendChunksToUpload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(uploadId, body, collectionName) {
|
|
612
|
+
var _appendChunksToUpload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(uploadId, body, collectionName, traceContext) {
|
|
603
613
|
var metadata, options;
|
|
604
614
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
605
615
|
while (1) {
|
|
@@ -614,7 +624,8 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
614
624
|
collectionName: collectionName
|
|
615
625
|
},
|
|
616
626
|
headers: jsonHeaders,
|
|
617
|
-
body: JSON.stringify(body)
|
|
627
|
+
body: JSON.stringify(body),
|
|
628
|
+
traceContext: traceContext
|
|
618
629
|
});
|
|
619
630
|
_context10.next = 4;
|
|
620
631
|
return this.request("/upload/".concat(uploadId, "/chunks"), options);
|
|
@@ -627,7 +638,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
627
638
|
}, _callee10, this);
|
|
628
639
|
}));
|
|
629
640
|
|
|
630
|
-
function appendChunksToUpload(
|
|
641
|
+
function appendChunksToUpload(_x28, _x29, _x30, _x31) {
|
|
631
642
|
return _appendChunksToUpload.apply(this, arguments);
|
|
632
643
|
}
|
|
633
644
|
|
|
@@ -635,7 +646,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
635
646
|
}()
|
|
636
647
|
}, {
|
|
637
648
|
key: "copyFileWithToken",
|
|
638
|
-
value: function copyFileWithToken(body, params) {
|
|
649
|
+
value: function copyFileWithToken(body, params, traceContext) {
|
|
639
650
|
var metadata = {
|
|
640
651
|
method: 'POST',
|
|
641
652
|
endpoint: '/file/copy/withToken'
|
|
@@ -649,8 +660,9 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
649
660
|
params: params,
|
|
650
661
|
// Contains collection name to write to
|
|
651
662
|
headers: jsonHeaders,
|
|
652
|
-
body: JSON.stringify(body)
|
|
653
|
-
|
|
663
|
+
body: JSON.stringify(body),
|
|
664
|
+
// Contains collection name to read from
|
|
665
|
+
traceContext: traceContext
|
|
654
666
|
});
|
|
655
667
|
|
|
656
668
|
return this.request('/file/copy/withToken', options).then(createMapResponseToJson(metadata));
|
|
@@ -668,7 +680,9 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
668
680
|
headers,
|
|
669
681
|
body,
|
|
670
682
|
clientOptions,
|
|
683
|
+
traceContext,
|
|
671
684
|
auth,
|
|
685
|
+
extendedTraceContext,
|
|
672
686
|
response,
|
|
673
687
|
_args11 = arguments;
|
|
674
688
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
@@ -681,13 +695,16 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
681
695
|
authContext: {}
|
|
682
696
|
};
|
|
683
697
|
controller = _args11.length > 2 ? _args11[2] : undefined;
|
|
684
|
-
method = options.method, endpoint = options.endpoint, authContext = options.authContext, params = options.params, headers = options.headers, body = options.body, clientOptions = options.clientOptions;
|
|
698
|
+
method = options.method, endpoint = options.endpoint, authContext = options.authContext, params = options.params, headers = options.headers, body = options.body, clientOptions = options.clientOptions, traceContext = options.traceContext;
|
|
685
699
|
_context11.next = 5;
|
|
686
700
|
return this.resolveAuth(authContext);
|
|
687
701
|
|
|
688
702
|
case 5:
|
|
689
703
|
auth = _context11.sent;
|
|
690
|
-
|
|
704
|
+
extendedTraceContext = traceContext ? _objectSpread(_objectSpread({}, traceContext), {}, {
|
|
705
|
+
spanId: (traceContext === null || traceContext === void 0 ? void 0 : traceContext.spanId) || getRandomHex(8)
|
|
706
|
+
}) : undefined;
|
|
707
|
+
_context11.next = 9;
|
|
691
708
|
return _request("".concat(auth.baseUrl).concat(path), {
|
|
692
709
|
method: method,
|
|
693
710
|
endpoint: endpoint,
|
|
@@ -695,16 +712,17 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
695
712
|
params: params,
|
|
696
713
|
headers: headers,
|
|
697
714
|
body: body,
|
|
698
|
-
clientOptions: clientOptions
|
|
715
|
+
clientOptions: clientOptions,
|
|
716
|
+
traceContext: extendedTraceContext
|
|
699
717
|
}, controller);
|
|
700
718
|
|
|
701
|
-
case
|
|
719
|
+
case 9:
|
|
702
720
|
response = _context11.sent;
|
|
703
721
|
setKeyValueInSessionStorage(MEDIA_API_REGION, response.headers.get('x-media-region'));
|
|
704
722
|
setKeyValueInSessionStorage(MEDIA_API_ENVIRONMENT, response.headers.get('x-media-env'));
|
|
705
723
|
return _context11.abrupt("return", response);
|
|
706
724
|
|
|
707
|
-
case
|
|
725
|
+
case 13:
|
|
708
726
|
case "end":
|
|
709
727
|
return _context11.stop();
|
|
710
728
|
}
|
|
@@ -712,7 +730,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
712
730
|
}, _callee11, this);
|
|
713
731
|
}));
|
|
714
732
|
|
|
715
|
-
function request(
|
|
733
|
+
function request(_x32) {
|
|
716
734
|
return _request2.apply(this, arguments);
|
|
717
735
|
}
|
|
718
736
|
|
|
@@ -43,7 +43,8 @@ export var mapMediaFileToFileState = function mapMediaFileToFileState(mediaFile)
|
|
|
43
43
|
mediaType = _mediaFile$data.mediaType,
|
|
44
44
|
mimeType = _mediaFile$data.mimeType,
|
|
45
45
|
representations = _mediaFile$data.representations,
|
|
46
|
-
createdAt = _mediaFile$data.createdAt
|
|
46
|
+
createdAt = _mediaFile$data.createdAt,
|
|
47
|
+
metadataTraceContext = _mediaFile$data.metadataTraceContext;
|
|
47
48
|
var baseState = {
|
|
48
49
|
id: id,
|
|
49
50
|
name: name,
|
|
@@ -52,7 +53,8 @@ export var mapMediaFileToFileState = function mapMediaFileToFileState(mediaFile)
|
|
|
52
53
|
mimeType: mimeType,
|
|
53
54
|
artifacts: artifacts,
|
|
54
55
|
representations: representations,
|
|
55
|
-
createdAt: createdAt
|
|
56
|
+
createdAt: createdAt,
|
|
57
|
+
metadataTraceContext: metadataTraceContext
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
switch (processingStatus) {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
-
|
|
8
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
3
|
import { chunkinator } from '@atlaskit/chunkinator';
|
|
10
4
|
import { from } from 'rxjs/observable/from';
|
|
@@ -13,7 +7,6 @@ import { createHasher } from '../utils/hashing/hasherCreator';
|
|
|
13
7
|
import { UploaderError } from './error';
|
|
14
8
|
import { CHUNK_SIZE, PROCESSING_BATCH_SIZE } from '../constants';
|
|
15
9
|
import { calculateChunkSize, fileSizeError } from './calculateChunkSize';
|
|
16
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common'; // TODO: Allow to pass multiple files
|
|
17
10
|
|
|
18
11
|
var hashingFunction = /*#__PURE__*/function () {
|
|
19
12
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(blob) {
|
|
@@ -42,7 +35,7 @@ var hashingFunction = /*#__PURE__*/function () {
|
|
|
42
35
|
};
|
|
43
36
|
}();
|
|
44
37
|
|
|
45
|
-
var createProbingFunction = function createProbingFunction(store, deferredUploadId, collectionName) {
|
|
38
|
+
var createProbingFunction = function createProbingFunction(store, deferredUploadId, collectionName, traceContext) {
|
|
46
39
|
return /*#__PURE__*/function () {
|
|
47
40
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(chunks) {
|
|
48
41
|
var response, results;
|
|
@@ -53,40 +46,27 @@ var createProbingFunction = function createProbingFunction(store, deferredUpload
|
|
|
53
46
|
_context2.t0 = store;
|
|
54
47
|
_context2.t1 = hashedChunks(chunks);
|
|
55
48
|
_context2.t2 = collectionName;
|
|
56
|
-
|
|
57
|
-
if (!getMediaFeatureFlag('mediaUploadApiV2', store.featureFlags)) {
|
|
58
|
-
_context2.next = 9;
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
_context2.next = 6;
|
|
49
|
+
_context2.next = 5;
|
|
63
50
|
return deferredUploadId;
|
|
64
51
|
|
|
65
|
-
case
|
|
52
|
+
case 5:
|
|
66
53
|
_context2.t3 = _context2.sent;
|
|
67
|
-
_context2.
|
|
68
|
-
break;
|
|
69
|
-
|
|
70
|
-
case 9:
|
|
71
|
-
_context2.t3 = undefined;
|
|
72
|
-
|
|
73
|
-
case 10:
|
|
74
|
-
_context2.t4 = _context2.t3;
|
|
75
|
-
_context2.t5 = {
|
|
54
|
+
_context2.t4 = {
|
|
76
55
|
collectionName: _context2.t2,
|
|
77
|
-
uploadId: _context2.
|
|
56
|
+
uploadId: _context2.t3
|
|
78
57
|
};
|
|
79
|
-
_context2.
|
|
80
|
-
|
|
58
|
+
_context2.t5 = traceContext;
|
|
59
|
+
_context2.next = 10;
|
|
60
|
+
return _context2.t0.probeChunks.call(_context2.t0, _context2.t1, _context2.t4, _context2.t5);
|
|
81
61
|
|
|
82
|
-
case
|
|
62
|
+
case 10:
|
|
83
63
|
response = _context2.sent;
|
|
84
64
|
results = response.data.results;
|
|
85
65
|
return _context2.abrupt("return", Object.values(results).map(function (result) {
|
|
86
66
|
return result.exists;
|
|
87
67
|
}));
|
|
88
68
|
|
|
89
|
-
case
|
|
69
|
+
case 13:
|
|
90
70
|
case "end":
|
|
91
71
|
return _context2.stop();
|
|
92
72
|
}
|
|
@@ -100,41 +80,31 @@ var createProbingFunction = function createProbingFunction(store, deferredUpload
|
|
|
100
80
|
}();
|
|
101
81
|
};
|
|
102
82
|
|
|
103
|
-
var createUploadingFunction = function createUploadingFunction(store, deferredUploadId, collectionName) {
|
|
83
|
+
var createUploadingFunction = function createUploadingFunction(store, deferredUploadId, collectionName, traceContext) {
|
|
104
84
|
return /*#__PURE__*/function () {
|
|
105
85
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(chunk) {
|
|
106
|
-
var options;
|
|
107
86
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
108
87
|
while (1) {
|
|
109
88
|
switch (_context3.prev = _context3.next) {
|
|
110
89
|
case 0:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
_context3.
|
|
117
|
-
_context3.next = 4;
|
|
90
|
+
_context3.t0 = store;
|
|
91
|
+
_context3.t1 = chunk.hash;
|
|
92
|
+
_context3.t2 = chunk.blob;
|
|
93
|
+
_context3.t3 = collectionName;
|
|
94
|
+
_context3.t4 = chunk.partNumber;
|
|
95
|
+
_context3.next = 7;
|
|
118
96
|
return deferredUploadId;
|
|
119
97
|
|
|
120
|
-
case
|
|
121
|
-
_context3.
|
|
122
|
-
_context3.
|
|
123
|
-
|
|
124
|
-
|
|
98
|
+
case 7:
|
|
99
|
+
_context3.t5 = _context3.sent;
|
|
100
|
+
_context3.t6 = {
|
|
101
|
+
collectionName: _context3.t3,
|
|
102
|
+
partNumber: _context3.t4,
|
|
103
|
+
uploadId: _context3.t5
|
|
125
104
|
};
|
|
126
|
-
_context3.
|
|
127
|
-
break;
|
|
128
|
-
|
|
129
|
-
case 8:
|
|
130
|
-
_context3.t0 = {};
|
|
131
|
-
|
|
132
|
-
case 9:
|
|
133
|
-
options = _context3.t0;
|
|
105
|
+
_context3.t7 = traceContext;
|
|
134
106
|
_context3.next = 12;
|
|
135
|
-
return
|
|
136
|
-
collectionName: collectionName
|
|
137
|
-
}, options));
|
|
107
|
+
return _context3.t0.uploadChunk.call(_context3.t0, _context3.t1, _context3.t2, _context3.t6, _context3.t7);
|
|
138
108
|
|
|
139
109
|
case 12:
|
|
140
110
|
return _context3.abrupt("return", _context3.sent);
|
|
@@ -153,7 +123,7 @@ var createUploadingFunction = function createUploadingFunction(store, deferredUp
|
|
|
153
123
|
}();
|
|
154
124
|
};
|
|
155
125
|
|
|
156
|
-
var createProcessingFunction = function createProcessingFunction(store, deferredUploadId, collection) {
|
|
126
|
+
var createProcessingFunction = function createProcessingFunction(store, deferredUploadId, collection, traceContext) {
|
|
157
127
|
var offset = 0;
|
|
158
128
|
return /*#__PURE__*/function () {
|
|
159
129
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(chunks) {
|
|
@@ -172,13 +142,14 @@ var createProcessingFunction = function createProcessingFunction(store, deferred
|
|
|
172
142
|
offset: offset
|
|
173
143
|
};
|
|
174
144
|
_context4.t3 = collection;
|
|
175
|
-
_context4.
|
|
176
|
-
|
|
145
|
+
_context4.t4 = traceContext;
|
|
146
|
+
_context4.next = 9;
|
|
147
|
+
return _context4.t0.appendChunksToUpload.call(_context4.t0, _context4.t1, _context4.t2, _context4.t3, _context4.t4);
|
|
177
148
|
|
|
178
|
-
case
|
|
149
|
+
case 9:
|
|
179
150
|
offset += chunks.length;
|
|
180
151
|
|
|
181
|
-
case
|
|
152
|
+
case 10:
|
|
182
153
|
case "end":
|
|
183
154
|
return _context4.stop();
|
|
184
155
|
}
|
|
@@ -193,7 +164,7 @@ var createProcessingFunction = function createProcessingFunction(store, deferred
|
|
|
193
164
|
};
|
|
194
165
|
|
|
195
166
|
var createFileFromUpload = /*#__PURE__*/function () {
|
|
196
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(file, store, uploadableFileUpfrontIds, uploadId) {
|
|
167
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(file, store, uploadableFileUpfrontIds, uploadId, traceContext) {
|
|
197
168
|
var collection, name, mimeType, id, occurrenceKey;
|
|
198
169
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
199
170
|
while (1) {
|
|
@@ -209,7 +180,7 @@ var createFileFromUpload = /*#__PURE__*/function () {
|
|
|
209
180
|
occurrenceKey: occurrenceKey,
|
|
210
181
|
collection: collection,
|
|
211
182
|
replaceFileId: id
|
|
212
|
-
}));
|
|
183
|
+
}, traceContext));
|
|
213
184
|
|
|
214
185
|
case 3:
|
|
215
186
|
case "end":
|
|
@@ -219,12 +190,12 @@ var createFileFromUpload = /*#__PURE__*/function () {
|
|
|
219
190
|
}, _callee5);
|
|
220
191
|
}));
|
|
221
192
|
|
|
222
|
-
return function createFileFromUpload(_x5, _x6, _x7, _x8) {
|
|
193
|
+
return function createFileFromUpload(_x5, _x6, _x7, _x8, _x9) {
|
|
223
194
|
return _ref5.apply(this, arguments);
|
|
224
195
|
};
|
|
225
196
|
}();
|
|
226
197
|
|
|
227
|
-
export var uploadFile = function uploadFile(file, store, uploadableFileUpfrontIds, callbacks) {
|
|
198
|
+
export var uploadFile = function uploadFile(file, store, uploadableFileUpfrontIds, callbacks, traceContext) {
|
|
228
199
|
var content = file.content,
|
|
229
200
|
collection = file.collection;
|
|
230
201
|
var deferredUploadId = uploadableFileUpfrontIds.deferredUploadId,
|
|
@@ -233,7 +204,7 @@ export var uploadFile = function uploadFile(file, store, uploadableFileUpfrontId
|
|
|
233
204
|
var chunkSize = CHUNK_SIZE;
|
|
234
205
|
|
|
235
206
|
try {
|
|
236
|
-
if (content instanceof Blob
|
|
207
|
+
if (content instanceof Blob) {
|
|
237
208
|
chunkSize = calculateChunkSize(content.size);
|
|
238
209
|
}
|
|
239
210
|
} catch (err) {
|
|
@@ -257,10 +228,10 @@ export var uploadFile = function uploadFile(file, store, uploadableFileUpfrontId
|
|
|
257
228
|
probingBatchSize: 100,
|
|
258
229
|
chunkSize: chunkSize,
|
|
259
230
|
uploadingConcurrency: 3,
|
|
260
|
-
uploadingFunction: createUploadingFunction(store, deferredUploadId, collection),
|
|
261
|
-
probingFunction: createProbingFunction(store, deferredUploadId, collection),
|
|
231
|
+
uploadingFunction: createUploadingFunction(store, deferredUploadId, collection, traceContext),
|
|
232
|
+
probingFunction: createProbingFunction(store, deferredUploadId, collection, traceContext),
|
|
262
233
|
processingBatchSize: PROCESSING_BATCH_SIZE,
|
|
263
|
-
processingFunction: createProcessingFunction(store, deferredUploadId, collection)
|
|
234
|
+
processingFunction: createProcessingFunction(store, deferredUploadId, collection, traceContext)
|
|
264
235
|
}, {
|
|
265
236
|
onProgress: function onProgress(progress) {
|
|
266
237
|
if (callbacks) {
|
|
@@ -273,7 +244,7 @@ export var uploadFile = function uploadFile(file, store, uploadableFileUpfrontId
|
|
|
273
244
|
|
|
274
245
|
var subscription = from(deferredUploadId).pipe(concatMap(function (uploadId) {
|
|
275
246
|
return chunkinatorObservable.pipe(concatMap(function () {
|
|
276
|
-
return from(createFileFromUpload(file, store, uploadableFileUpfrontIds, uploadId));
|
|
247
|
+
return from(createFileFromUpload(file, store, uploadableFileUpfrontIds, uploadId, traceContext));
|
|
277
248
|
}));
|
|
278
249
|
})).subscribe({
|
|
279
250
|
error: function error(err) {
|