@atlaskit/media-client 36.3.0 → 36.3.2
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 +18 -0
- package/dist/cjs/client/file-fetcher/index.js +181 -169
- package/dist/cjs/client/media-client.js +14 -14
- package/dist/cjs/client/media-store/MediaStore.js +79 -78
- package/dist/cjs/client/media-store/resolveAuth.js +20 -19
- package/dist/cjs/client/stargate-client.js +4 -4
- package/dist/cjs/models/file-state.js +4 -2
- package/dist/cjs/uploader/index.js +28 -35
- package/dist/cjs/utils/createCopyIntentRegisterationBatcher.js +16 -16
- package/dist/cjs/utils/createFileDataLoader.js +16 -16
- package/dist/cjs/utils/getDimensionsFromBlob.js +15 -15
- package/dist/cjs/utils/getVideoDimensionsFromBlob.js +1 -1
- package/dist/cjs/utils/hashing/hasherCreator.js +18 -18
- package/dist/cjs/utils/mobileUpload/helpers.js +15 -15
- package/dist/cjs/utils/mobileUpload/stateMachine/index.js +4 -4
- package/dist/cjs/utils/polling/index.js +18 -18
- package/dist/cjs/utils/request/helpers.js +52 -49
- package/dist/cjs/utils/request/index.js +17 -16
- package/dist/cjs/utils/shouldFetchRemoteFileStates.js +18 -18
- package/dist/es2019/client/file-fetcher/index.js +12 -4
- package/dist/es2019/models/file-state.js +4 -2
- package/dist/esm/client/file-fetcher/index.js +181 -169
- package/dist/esm/client/media-client.js +14 -14
- package/dist/esm/client/media-store/MediaStore.js +79 -78
- package/dist/esm/client/media-store/resolveAuth.js +20 -19
- package/dist/esm/client/stargate-client.js +4 -4
- package/dist/esm/models/file-state.js +4 -2
- package/dist/esm/uploader/index.js +28 -35
- package/dist/esm/utils/createCopyIntentRegisterationBatcher.js +16 -16
- package/dist/esm/utils/createFileDataLoader.js +16 -16
- package/dist/esm/utils/getDimensionsFromBlob.js +15 -15
- package/dist/esm/utils/getVideoDimensionsFromBlob.js +1 -1
- package/dist/esm/utils/hashing/hasherCreator.js +17 -17
- package/dist/esm/utils/mobileUpload/helpers.js +15 -15
- package/dist/esm/utils/mobileUpload/stateMachine/index.js +4 -4
- package/dist/esm/utils/polling/index.js +18 -18
- package/dist/esm/utils/request/helpers.js +52 -49
- package/dist/esm/utils/request/index.js +17 -16
- package/dist/esm/utils/shouldFetchRemoteFileStates.js +18 -18
- package/dist/types/models/file-state.d.ts +1 -0
- package/dist/types/models/media.d.ts +2 -0
- package/dist/types-ts4.5/models/file-state.d.ts +1 -0
- package/dist/types-ts4.5/models/media.d.ts +2 -0
- package/package.json +6 -6
|
@@ -87,8 +87,8 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
// TODO: ----- ADD TICKET TO PASS TRACE ID to this.dataloader.load
|
|
90
|
-
(0, _defineProperty2.default)(this, "createDownloadFileStream", function (id, collectionName, occurrenceKey, includeHashForDuplicateFiles, forceRefresh) {
|
|
91
|
-
var subject = (0, _createMediaSubject.createMediaSubject)();
|
|
90
|
+
(0, _defineProperty2.default)(this, "createDownloadFileStream", function (id, collectionName, occurrenceKey, includeHashForDuplicateFiles, forceRefresh, initialFileState) {
|
|
91
|
+
var subject = (0, _createMediaSubject.createMediaSubject)(initialFileState);
|
|
92
92
|
var poll = new _polling.PollingFunction();
|
|
93
93
|
|
|
94
94
|
// ensure subject errors if polling exceeds max iterations or uncaught exception in executor
|
|
@@ -96,10 +96,17 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
96
96
|
return subject.error(error);
|
|
97
97
|
};
|
|
98
98
|
poll.execute( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
99
|
-
var response, fileState;
|
|
100
|
-
return _regenerator.default.wrap(function
|
|
99
|
+
var response, fileState, _t;
|
|
100
|
+
return _regenerator.default.wrap(function (_context) {
|
|
101
101
|
while (1) switch (_context.prev = _context.next) {
|
|
102
102
|
case 0:
|
|
103
|
+
if (!(!forceRefresh && (initialFileState === null || initialFileState === void 0 ? void 0 : initialFileState.status) === 'processed')) {
|
|
104
|
+
_context.next = 1;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
subject.complete();
|
|
108
|
+
return _context.abrupt("return");
|
|
109
|
+
case 1:
|
|
103
110
|
if (forceRefresh) {
|
|
104
111
|
_this.dataloader.clear({
|
|
105
112
|
id: id,
|
|
@@ -107,16 +114,16 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
107
114
|
includeHashForDuplicateFiles: includeHashForDuplicateFiles
|
|
108
115
|
});
|
|
109
116
|
}
|
|
110
|
-
_context.next =
|
|
117
|
+
_context.next = 2;
|
|
111
118
|
return _this.dataloader.load({
|
|
112
119
|
id: id,
|
|
113
120
|
collectionName: collectionName,
|
|
114
121
|
includeHashForDuplicateFiles: includeHashForDuplicateFiles
|
|
115
122
|
});
|
|
116
|
-
case
|
|
123
|
+
case 2:
|
|
117
124
|
response = _context.sent;
|
|
118
125
|
if (!(0, _media.isNotFoundMediaItemDetails)(response)) {
|
|
119
|
-
_context.next =
|
|
126
|
+
_context.next = 3;
|
|
120
127
|
break;
|
|
121
128
|
}
|
|
122
129
|
throw new _error.FileFetcherError('emptyItems', {
|
|
@@ -125,9 +132,9 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
125
132
|
occurrenceKey: occurrenceKey,
|
|
126
133
|
traceContext: response.metadataTraceContext
|
|
127
134
|
});
|
|
128
|
-
case
|
|
135
|
+
case 3:
|
|
129
136
|
if (!(0, _detectEmptyFile.isEmptyFile)(response)) {
|
|
130
|
-
_context.next =
|
|
137
|
+
_context.next = 4;
|
|
131
138
|
break;
|
|
132
139
|
}
|
|
133
140
|
throw new _error.FileFetcherError('zeroVersionFile', {
|
|
@@ -136,20 +143,20 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
136
143
|
occurrenceKey: occurrenceKey,
|
|
137
144
|
traceContext: response.metadataTraceContext
|
|
138
145
|
});
|
|
139
|
-
case
|
|
146
|
+
case 4:
|
|
140
147
|
fileState = (0, _fileState2.mapMediaItemToFileState)(id, response);
|
|
141
148
|
subject.next(fileState);
|
|
142
|
-
|
|
143
|
-
_context.next =
|
|
149
|
+
_t = fileState.status;
|
|
150
|
+
_context.next = _t === 'processing' ? 5 : _t === 'processed' ? 6 : 7;
|
|
144
151
|
break;
|
|
145
|
-
case
|
|
152
|
+
case 5:
|
|
146
153
|
// the only case for continuing polling, otherwise this function is run once only
|
|
147
154
|
poll.next();
|
|
148
|
-
return _context.abrupt("
|
|
149
|
-
case
|
|
155
|
+
return _context.abrupt("continue", 7);
|
|
156
|
+
case 6:
|
|
150
157
|
subject.complete();
|
|
151
|
-
return _context.abrupt("
|
|
152
|
-
case
|
|
158
|
+
return _context.abrupt("continue", 7);
|
|
159
|
+
case 7:
|
|
153
160
|
case "end":
|
|
154
161
|
return _context.stop();
|
|
155
162
|
}
|
|
@@ -193,23 +200,23 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
193
200
|
(0, _defineProperty2.default)(this, "uploadArtifact", /*#__PURE__*/function () {
|
|
194
201
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(id, file, params, collectionName, traceContext) {
|
|
195
202
|
var _yield$_this$mediaApi, data, _yield$_this$mediaApi2, altData, itemDetails;
|
|
196
|
-
return _regenerator.default.wrap(function
|
|
203
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
197
204
|
while (1) switch (_context2.prev = _context2.next) {
|
|
198
205
|
case 0:
|
|
199
|
-
_context2.next =
|
|
206
|
+
_context2.next = 1;
|
|
200
207
|
return _this.mediaApi.uploadArtifact(id, file, params, collectionName, traceContext);
|
|
201
|
-
case
|
|
208
|
+
case 1:
|
|
202
209
|
_yield$_this$mediaApi = _context2.sent;
|
|
203
210
|
data = _yield$_this$mediaApi.data;
|
|
204
|
-
_context2.next =
|
|
211
|
+
_context2.next = 2;
|
|
205
212
|
return _this.mediaApi.getItems([id], collectionName, traceContext);
|
|
206
|
-
case
|
|
213
|
+
case 2:
|
|
207
214
|
_yield$_this$mediaApi2 = _context2.sent;
|
|
208
215
|
altData = _yield$_this$mediaApi2.data;
|
|
209
216
|
itemDetails = altData.items[0].details; // ------------------------------------------------------------
|
|
210
217
|
_this.setFileState(id, (0, _fileState2.mapMediaItemToFileState)(id, itemDetails));
|
|
211
218
|
return _context2.abrupt("return", data);
|
|
212
|
-
case
|
|
219
|
+
case 3:
|
|
213
220
|
case "end":
|
|
214
221
|
return _context2.stop();
|
|
215
222
|
}
|
|
@@ -222,12 +229,12 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
222
229
|
(0, _defineProperty2.default)(this, "deleteArtifact", /*#__PURE__*/function () {
|
|
223
230
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(id, artifactName, collectionName, traceContext) {
|
|
224
231
|
var file, updatedArtifacts, updatedFileState;
|
|
225
|
-
return _regenerator.default.wrap(function
|
|
232
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
226
233
|
while (1) switch (_context3.prev = _context3.next) {
|
|
227
234
|
case 0:
|
|
228
|
-
_context3.next =
|
|
235
|
+
_context3.next = 1;
|
|
229
236
|
return _this.mediaApi.deleteArtifact(id, artifactName, collectionName, traceContext);
|
|
230
|
-
case
|
|
237
|
+
case 1:
|
|
231
238
|
// Manually remove the artifact from file state instead of re-requesting the entire payload.
|
|
232
239
|
file = _this.store.getState().files[id];
|
|
233
240
|
if (file && file.status === 'processed' && file.artifacts) {
|
|
@@ -238,7 +245,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
238
245
|
});
|
|
239
246
|
_this.setFileState(id, updatedFileState);
|
|
240
247
|
}
|
|
241
|
-
case
|
|
248
|
+
case 2:
|
|
242
249
|
case "end":
|
|
243
250
|
return _context3.stop();
|
|
244
251
|
}
|
|
@@ -250,28 +257,28 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
250
257
|
}());
|
|
251
258
|
(0, _defineProperty2.default)(this, "getOrFetchFileState", /*#__PURE__*/function () {
|
|
252
259
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id, collectionName) {
|
|
253
|
-
var fileState;
|
|
254
|
-
return _regenerator.default.wrap(function
|
|
260
|
+
var fileState, _t2;
|
|
261
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
255
262
|
while (1) switch (_context4.prev = _context4.next) {
|
|
256
263
|
case 0:
|
|
257
264
|
fileState = _this.store.getState().files[id];
|
|
258
265
|
if (!(fileState !== null && fileState !== void 0)) {
|
|
259
|
-
_context4.next =
|
|
266
|
+
_context4.next = 1;
|
|
260
267
|
break;
|
|
261
268
|
}
|
|
262
|
-
|
|
263
|
-
_context4.next =
|
|
269
|
+
_t2 = fileState;
|
|
270
|
+
_context4.next = 3;
|
|
264
271
|
break;
|
|
265
|
-
case
|
|
266
|
-
_context4.next =
|
|
272
|
+
case 1:
|
|
273
|
+
_context4.next = 2;
|
|
267
274
|
return _this.getCurrentState(id, {
|
|
268
275
|
collectionName: collectionName
|
|
269
276
|
});
|
|
270
|
-
case
|
|
271
|
-
|
|
272
|
-
case
|
|
273
|
-
return _context4.abrupt("return",
|
|
274
|
-
case
|
|
277
|
+
case 2:
|
|
278
|
+
_t2 = _context4.sent;
|
|
279
|
+
case 3:
|
|
280
|
+
return _context4.abrupt("return", _t2);
|
|
281
|
+
case 4:
|
|
275
282
|
case "end":
|
|
276
283
|
return _context4.stop();
|
|
277
284
|
}
|
|
@@ -285,109 +292,109 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
285
292
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id, collectionName) {
|
|
286
293
|
var _fileState$mediaMetad;
|
|
287
294
|
var fileState, artifactUrlString, artifactUrl, artifactPath, res, arrayBuffer, uint8Array, mvhdBytes, mvhdIndex, i, j, dataView, start, timeScale, duration, videoLength;
|
|
288
|
-
return _regenerator.default.wrap(function
|
|
295
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
289
296
|
while (1) switch (_context5.prev = _context5.next) {
|
|
290
297
|
case 0:
|
|
291
|
-
_context5.next =
|
|
298
|
+
_context5.next = 1;
|
|
292
299
|
return _this.getOrFetchFileState(id, collectionName);
|
|
293
|
-
case
|
|
300
|
+
case 1:
|
|
294
301
|
fileState = _context5.sent;
|
|
295
302
|
if (!(fileState.status !== 'processed' || fileState.mediaType !== 'video' || !fileState.artifacts['video.mp4'])) {
|
|
296
|
-
_context5.next =
|
|
303
|
+
_context5.next = 2;
|
|
297
304
|
break;
|
|
298
305
|
}
|
|
299
306
|
throw new Error('File is not a video');
|
|
300
|
-
case
|
|
307
|
+
case 2:
|
|
301
308
|
if (!('mediaMetadata' in fileState && (_fileState$mediaMetad = fileState.mediaMetadata) !== null && _fileState$mediaMetad !== void 0 && _fileState$mediaMetad.duration)) {
|
|
302
|
-
_context5.next =
|
|
309
|
+
_context5.next = 3;
|
|
303
310
|
break;
|
|
304
311
|
}
|
|
305
312
|
return _context5.abrupt("return", fileState.mediaMetadata.duration);
|
|
306
|
-
case
|
|
307
|
-
_context5.next =
|
|
313
|
+
case 3:
|
|
314
|
+
_context5.next = 4;
|
|
308
315
|
return _this.getArtifactURL(fileState.artifacts, 'video.mp4', collectionName);
|
|
309
|
-
case
|
|
316
|
+
case 4:
|
|
310
317
|
artifactUrlString = _context5.sent;
|
|
311
318
|
artifactUrl = new URL(artifactUrlString);
|
|
312
319
|
artifactPath = "".concat(artifactUrl.pathname).concat(artifactUrl.search);
|
|
313
|
-
_context5.next =
|
|
320
|
+
_context5.next = 5;
|
|
314
321
|
return _this.mediaApi.request(artifactPath, {
|
|
315
322
|
headers: {
|
|
316
323
|
Range: 'bytes=0-199'
|
|
317
324
|
}
|
|
318
325
|
});
|
|
319
|
-
case
|
|
326
|
+
case 5:
|
|
320
327
|
res = _context5.sent;
|
|
321
|
-
_context5.next =
|
|
328
|
+
_context5.next = 6;
|
|
322
329
|
return res.arrayBuffer();
|
|
323
|
-
case
|
|
330
|
+
case 6:
|
|
324
331
|
arrayBuffer = _context5.sent;
|
|
325
332
|
uint8Array = new Uint8Array(arrayBuffer);
|
|
326
333
|
mvhdBytes = new Uint8Array([109, 118, 104, 100]); // "mvhd" in ASCII
|
|
327
334
|
mvhdIndex = -1;
|
|
328
335
|
i = 0;
|
|
329
|
-
case
|
|
336
|
+
case 7:
|
|
330
337
|
if (!(i <= uint8Array.length - mvhdBytes.length)) {
|
|
331
|
-
_context5.next =
|
|
338
|
+
_context5.next = 12;
|
|
332
339
|
break;
|
|
333
340
|
}
|
|
334
341
|
mvhdIndex = i;
|
|
335
342
|
j = 0;
|
|
336
|
-
case
|
|
343
|
+
case 8:
|
|
337
344
|
if (!(j < mvhdBytes.length)) {
|
|
338
|
-
_context5.next =
|
|
345
|
+
_context5.next = 10;
|
|
339
346
|
break;
|
|
340
347
|
}
|
|
341
348
|
if (!(uint8Array[i + j] !== mvhdBytes[j])) {
|
|
342
|
-
_context5.next =
|
|
349
|
+
_context5.next = 9;
|
|
343
350
|
break;
|
|
344
351
|
}
|
|
345
352
|
mvhdIndex = -1;
|
|
346
|
-
return _context5.abrupt("
|
|
347
|
-
case
|
|
353
|
+
return _context5.abrupt("continue", 10);
|
|
354
|
+
case 9:
|
|
348
355
|
j++;
|
|
349
|
-
_context5.next =
|
|
356
|
+
_context5.next = 8;
|
|
350
357
|
break;
|
|
351
|
-
case
|
|
358
|
+
case 10:
|
|
352
359
|
if (!(mvhdIndex !== -1)) {
|
|
353
|
-
_context5.next =
|
|
360
|
+
_context5.next = 11;
|
|
354
361
|
break;
|
|
355
362
|
}
|
|
356
|
-
return _context5.abrupt("
|
|
357
|
-
case
|
|
363
|
+
return _context5.abrupt("continue", 12);
|
|
364
|
+
case 11:
|
|
358
365
|
i++;
|
|
359
|
-
_context5.next =
|
|
366
|
+
_context5.next = 7;
|
|
360
367
|
break;
|
|
361
|
-
case
|
|
368
|
+
case 12:
|
|
362
369
|
if (!(mvhdIndex === -1)) {
|
|
363
|
-
_context5.next =
|
|
370
|
+
_context5.next = 13;
|
|
364
371
|
break;
|
|
365
372
|
}
|
|
366
373
|
throw new Error('Unable to find mvhd bytes');
|
|
367
|
-
case
|
|
374
|
+
case 13:
|
|
368
375
|
// Create DataView for reading big-endian integers
|
|
369
376
|
dataView = new DataView(arrayBuffer);
|
|
370
377
|
start = mvhdIndex + 16; // Skip atom header and version/flags
|
|
371
378
|
// Check if we have enough bytes to read timescale and duration
|
|
372
379
|
if (!(start + 8 > arrayBuffer.byteLength)) {
|
|
373
|
-
_context5.next =
|
|
380
|
+
_context5.next = 14;
|
|
374
381
|
break;
|
|
375
382
|
}
|
|
376
383
|
return _context5.abrupt("return", 0);
|
|
377
|
-
case
|
|
384
|
+
case 14:
|
|
378
385
|
// flase as second parameter indicates big-endian 32-bit integers
|
|
379
386
|
timeScale = dataView.getUint32(start, false);
|
|
380
387
|
duration = dataView.getUint32(start + 4, false);
|
|
381
388
|
if (!(timeScale === 0)) {
|
|
382
|
-
_context5.next =
|
|
389
|
+
_context5.next = 15;
|
|
383
390
|
break;
|
|
384
391
|
}
|
|
385
392
|
throw new Error('Timescale is invalid');
|
|
386
|
-
case
|
|
393
|
+
case 15:
|
|
387
394
|
// get the video length in seconds
|
|
388
395
|
videoLength = Math.floor(duration / timeScale);
|
|
389
396
|
return _context5.abrupt("return", videoLength);
|
|
390
|
-
case
|
|
397
|
+
case 16:
|
|
391
398
|
case "end":
|
|
392
399
|
return _context5.stop();
|
|
393
400
|
}
|
|
@@ -400,39 +407,39 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
400
407
|
(0, _defineProperty2.default)(this, "getVideoDurations", /*#__PURE__*/function () {
|
|
401
408
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(files) {
|
|
402
409
|
var promises, durations;
|
|
403
|
-
return _regenerator.default.wrap(function
|
|
410
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
404
411
|
while (1) switch (_context7.prev = _context7.next) {
|
|
405
412
|
case 0:
|
|
406
413
|
// get all the duration promises
|
|
407
414
|
promises = files.map( /*#__PURE__*/function () {
|
|
408
415
|
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(_ref7) {
|
|
409
|
-
var id, collectionName;
|
|
410
|
-
return _regenerator.default.wrap(function
|
|
416
|
+
var id, collectionName, _t3;
|
|
417
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
411
418
|
while (1) switch (_context6.prev = _context6.next) {
|
|
412
419
|
case 0:
|
|
413
420
|
id = _ref7.id, collectionName = _ref7.collectionName;
|
|
414
421
|
_context6.prev = 1;
|
|
415
|
-
_context6.next =
|
|
422
|
+
_context6.next = 2;
|
|
416
423
|
return _this.getDurationOfVideo(id, collectionName);
|
|
417
|
-
case
|
|
424
|
+
case 2:
|
|
418
425
|
return _context6.abrupt("return", _context6.sent);
|
|
419
|
-
case
|
|
420
|
-
_context6.prev =
|
|
421
|
-
|
|
426
|
+
case 3:
|
|
427
|
+
_context6.prev = 3;
|
|
428
|
+
_t3 = _context6["catch"](1);
|
|
422
429
|
return _context6.abrupt("return", -1);
|
|
423
|
-
case
|
|
430
|
+
case 4:
|
|
424
431
|
case "end":
|
|
425
432
|
return _context6.stop();
|
|
426
433
|
}
|
|
427
|
-
}, _callee6, null, [[1,
|
|
434
|
+
}, _callee6, null, [[1, 3]]);
|
|
428
435
|
}));
|
|
429
436
|
return function (_x13) {
|
|
430
437
|
return _ref8.apply(this, arguments);
|
|
431
438
|
};
|
|
432
439
|
}());
|
|
433
|
-
_context7.next =
|
|
440
|
+
_context7.next = 1;
|
|
434
441
|
return Promise.all(promises);
|
|
435
|
-
case
|
|
442
|
+
case 1:
|
|
436
443
|
durations = _context7.sent;
|
|
437
444
|
return _context7.abrupt("return", durations.reduce(function (acc, curr, i) {
|
|
438
445
|
if (curr !== -1) {
|
|
@@ -441,7 +448,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
441
448
|
}
|
|
442
449
|
return acc;
|
|
443
450
|
}, {}));
|
|
444
|
-
case
|
|
451
|
+
case 2:
|
|
445
452
|
case "end":
|
|
446
453
|
return _context7.stop();
|
|
447
454
|
}
|
|
@@ -464,8 +471,12 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
464
471
|
var collectionName = options.collectionName,
|
|
465
472
|
occurrenceKey = options.occurrenceKey,
|
|
466
473
|
includeHashForDuplicateFiles = options.includeHashForDuplicateFiles,
|
|
467
|
-
forceRefresh = options.forceRefresh
|
|
474
|
+
forceRefresh = options.forceRefresh,
|
|
475
|
+
initialFileState = options.initialFileState;
|
|
468
476
|
if (!(0, _isValidUuid.isValidUuid)(id)) {
|
|
477
|
+
// Do NOT pass initialFileState here — for an invalid UUID the SSR seed
|
|
478
|
+
// is meaningless and would cause subscribers to briefly see a
|
|
479
|
+
// valid-looking file state before the error is emitted.
|
|
469
480
|
var subject = (0, _createMediaSubject.createMediaSubject)();
|
|
470
481
|
var err = new _error.FileFetcherError('invalidFileId', {
|
|
471
482
|
id: id,
|
|
@@ -481,7 +492,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
481
492
|
(0, _fileStreamsCache.getFileStreamsCache)().remove(id);
|
|
482
493
|
}
|
|
483
494
|
return (0, _mediaSubscribable.fromObservable)((0, _fileStreamsCache.getFileStreamsCache)().getOrInsert(id, function () {
|
|
484
|
-
var subject = _this2.createDownloadFileStream(id, collectionName, undefined, includeHashForDuplicateFiles, forceRefresh);
|
|
495
|
+
var subject = _this2.createDownloadFileStream(id, collectionName, undefined, includeHashForDuplicateFiles, forceRefresh, initialFileState);
|
|
485
496
|
subject.subscribe({
|
|
486
497
|
next: function next(fileState) {
|
|
487
498
|
_this2.setFileState(id, fileState);
|
|
@@ -548,7 +559,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
548
559
|
var _uploadExternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0(url, collection, traceContext, anonymizeFilename) {
|
|
549
560
|
var _this3 = this;
|
|
550
561
|
var uploadableFileUpfrontIds, id, occurrenceKey, subject, deferredBlob, preview, name, fileState;
|
|
551
|
-
return _regenerator.default.wrap(function
|
|
562
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
552
563
|
while (1) switch (_context0.prev = _context0.next) {
|
|
553
564
|
case 0:
|
|
554
565
|
uploadableFileUpfrontIds = this.generateUploadableFileUpfrontIds(collection, traceContext);
|
|
@@ -562,12 +573,12 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
562
573
|
preview = new Promise( /*#__PURE__*/function () {
|
|
563
574
|
var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(resolve, reject) {
|
|
564
575
|
var blob;
|
|
565
|
-
return _regenerator.default.wrap(function
|
|
576
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
566
577
|
while (1) switch (_context8.prev = _context8.next) {
|
|
567
578
|
case 0:
|
|
568
|
-
_context8.next =
|
|
579
|
+
_context8.next = 1;
|
|
569
580
|
return deferredBlob;
|
|
570
|
-
case
|
|
581
|
+
case 1:
|
|
571
582
|
blob = _context8.sent;
|
|
572
583
|
if (!blob) {
|
|
573
584
|
reject('Could not fetch the blob');
|
|
@@ -576,7 +587,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
576
587
|
value: blob,
|
|
577
588
|
origin: 'remote'
|
|
578
589
|
});
|
|
579
|
-
case
|
|
590
|
+
case 2:
|
|
580
591
|
case "end":
|
|
581
592
|
return _context8.stop();
|
|
582
593
|
}
|
|
@@ -603,20 +614,20 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
603
614
|
this.setFileState(id, fileState);
|
|
604
615
|
return _context0.abrupt("return", new Promise( /*#__PURE__*/function () {
|
|
605
616
|
var _ref1 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(resolve, reject) {
|
|
606
|
-
var blob, type, size, file, mediaType, dimensions;
|
|
607
|
-
return _regenerator.default.wrap(function
|
|
617
|
+
var blob, type, size, file, mediaType, dimensions, _t4;
|
|
618
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
608
619
|
while (1) switch (_context9.prev = _context9.next) {
|
|
609
620
|
case 0:
|
|
610
|
-
_context9.next =
|
|
621
|
+
_context9.next = 1;
|
|
611
622
|
return deferredBlob;
|
|
612
|
-
case
|
|
623
|
+
case 1:
|
|
613
624
|
blob = _context9.sent;
|
|
614
625
|
if (blob) {
|
|
615
|
-
_context9.next =
|
|
626
|
+
_context9.next = 2;
|
|
616
627
|
break;
|
|
617
628
|
}
|
|
618
629
|
return _context9.abrupt("return", reject('Could not download remote file'));
|
|
619
|
-
case
|
|
630
|
+
case 2:
|
|
620
631
|
type = blob.type, size = blob.size;
|
|
621
632
|
file = {
|
|
622
633
|
content: blob,
|
|
@@ -638,35 +649,35 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
638
649
|
});
|
|
639
650
|
// we don't want to wait for the file to be upload
|
|
640
651
|
_this3.upload(file, undefined, uploadableFileUpfrontIds, traceContext);
|
|
641
|
-
_context9.prev =
|
|
642
|
-
_context9.next =
|
|
652
|
+
_context9.prev = 3;
|
|
653
|
+
_context9.next = 4;
|
|
643
654
|
return (0, _getDimensionsFromBlob.getDimensionsFromBlob)(mediaType, blob);
|
|
644
|
-
case
|
|
655
|
+
case 4:
|
|
645
656
|
dimensions = _context9.sent;
|
|
646
|
-
_context9.next =
|
|
657
|
+
_context9.next = 6;
|
|
647
658
|
break;
|
|
648
|
-
case
|
|
649
|
-
_context9.prev =
|
|
650
|
-
|
|
651
|
-
reject(
|
|
659
|
+
case 5:
|
|
660
|
+
_context9.prev = 5;
|
|
661
|
+
_t4 = _context9["catch"](3);
|
|
662
|
+
reject(_t4);
|
|
652
663
|
return _context9.abrupt("return");
|
|
653
|
-
case
|
|
664
|
+
case 6:
|
|
654
665
|
resolve({
|
|
655
666
|
dimensions: dimensions,
|
|
656
667
|
mimeType: type,
|
|
657
668
|
uploadableFileUpfrontIds: uploadableFileUpfrontIds
|
|
658
669
|
});
|
|
659
|
-
case
|
|
670
|
+
case 7:
|
|
660
671
|
case "end":
|
|
661
672
|
return _context9.stop();
|
|
662
673
|
}
|
|
663
|
-
}, _callee9, null, [[
|
|
674
|
+
}, _callee9, null, [[3, 5]]);
|
|
664
675
|
}));
|
|
665
676
|
return function (_x20, _x21) {
|
|
666
677
|
return _ref1.apply(this, arguments);
|
|
667
678
|
};
|
|
668
679
|
}()));
|
|
669
|
-
case
|
|
680
|
+
case 1:
|
|
670
681
|
case "end":
|
|
671
682
|
return _context0.stop();
|
|
672
683
|
}
|
|
@@ -745,15 +756,15 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
745
756
|
traceContext,
|
|
746
757
|
url,
|
|
747
758
|
_args1 = arguments;
|
|
748
|
-
return _regenerator.default.wrap(function
|
|
759
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
749
760
|
while (1) switch (_context1.prev = _context1.next) {
|
|
750
761
|
case 0:
|
|
751
762
|
name = _args1.length > 1 && _args1[1] !== undefined ? _args1[1] : 'download';
|
|
752
763
|
collectionName = _args1.length > 2 ? _args1[2] : undefined;
|
|
753
764
|
traceContext = _args1.length > 3 ? _args1[3] : undefined;
|
|
754
|
-
_context1.next =
|
|
765
|
+
_context1.next = 1;
|
|
755
766
|
return this.mediaApi.getFileBinaryURL(id, collectionName);
|
|
756
|
-
case
|
|
767
|
+
case 1:
|
|
757
768
|
url = _context1.sent;
|
|
758
769
|
(0, _downloadUrl.downloadUrl)(url, {
|
|
759
770
|
name: name
|
|
@@ -764,11 +775,11 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
764
775
|
viewingLevel: 'download'
|
|
765
776
|
});
|
|
766
777
|
// Test the download after initiated the Browser process to catch any potential errors.
|
|
767
|
-
_context1.next =
|
|
778
|
+
_context1.next = 2;
|
|
768
779
|
return this.mediaApi.testUrl(url, {
|
|
769
780
|
traceContext: traceContext
|
|
770
781
|
});
|
|
771
|
-
case
|
|
782
|
+
case 2:
|
|
772
783
|
case "end":
|
|
773
784
|
return _context1.stop();
|
|
774
785
|
}
|
|
@@ -784,26 +795,26 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
784
795
|
value: function () {
|
|
785
796
|
var _registerCopyIntent = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(id, collectionName) {
|
|
786
797
|
var auth, key, error;
|
|
787
|
-
return _regenerator.default.wrap(function
|
|
798
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
788
799
|
while (1) switch (_context10.prev = _context10.next) {
|
|
789
800
|
case 0:
|
|
790
|
-
_context10.next =
|
|
801
|
+
_context10.next = 1;
|
|
791
802
|
return this.mediaApi.resolveAuth({
|
|
792
803
|
collectionName: collectionName
|
|
793
804
|
});
|
|
794
|
-
case
|
|
805
|
+
case 1:
|
|
795
806
|
auth = _context10.sent;
|
|
796
807
|
key = {
|
|
797
808
|
id: id,
|
|
798
809
|
collectionName: collectionName,
|
|
799
810
|
resolvedAuth: auth
|
|
800
811
|
};
|
|
801
|
-
_context10.next =
|
|
812
|
+
_context10.next = 2;
|
|
802
813
|
return this.copyIntentRegisterationBatcher.load(key);
|
|
803
|
-
case
|
|
814
|
+
case 2:
|
|
804
815
|
error = _context10.sent;
|
|
805
816
|
if (!error) {
|
|
806
|
-
_context10.next =
|
|
817
|
+
_context10.next = 3;
|
|
807
818
|
break;
|
|
808
819
|
}
|
|
809
820
|
// if the error is retryable then it should not be cached
|
|
@@ -811,7 +822,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
811
822
|
this.copyIntentRegisterationBatcher.clear(key);
|
|
812
823
|
}
|
|
813
824
|
throw error;
|
|
814
|
-
case
|
|
825
|
+
case 3:
|
|
815
826
|
case "end":
|
|
816
827
|
return _context10.stop();
|
|
817
828
|
}
|
|
@@ -826,8 +837,8 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
826
837
|
key: "copyFileWithToken",
|
|
827
838
|
value: function () {
|
|
828
839
|
var _copyFileWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(source, destination, traceContext) {
|
|
829
|
-
var authProvider, sourceCollection, id, destinationAuthProvider, destinationCollectionName, replaceFileId, occurrenceKey, mediaStore, owner, body, params, _yield$mediaStore$cop, data;
|
|
830
|
-
return _regenerator.default.wrap(function
|
|
840
|
+
var authProvider, sourceCollection, id, destinationAuthProvider, destinationCollectionName, replaceFileId, occurrenceKey, mediaStore, owner, body, params, _yield$mediaStore$cop, data, _t5;
|
|
841
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
831
842
|
while (1) switch (_context11.prev = _context11.next) {
|
|
832
843
|
case 0:
|
|
833
844
|
authProvider = source.authProvider, sourceCollection = source.collection, id = source.id;
|
|
@@ -835,14 +846,13 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
835
846
|
mediaStore = destination.mediaStore || new _mediaStore.MediaStore({
|
|
836
847
|
authProvider: destinationAuthProvider
|
|
837
848
|
});
|
|
838
|
-
|
|
839
|
-
_context11.next =
|
|
849
|
+
_t5 = _mediaCore.authToOwner;
|
|
850
|
+
_context11.next = 1;
|
|
840
851
|
return authProvider({
|
|
841
852
|
collectionName: sourceCollection
|
|
842
853
|
});
|
|
843
|
-
case
|
|
844
|
-
|
|
845
|
-
owner = (0, _context11.t0)(_context11.t1);
|
|
854
|
+
case 1:
|
|
855
|
+
owner = _t5(_context11.sent);
|
|
846
856
|
body = {
|
|
847
857
|
sourceFile: {
|
|
848
858
|
id: id,
|
|
@@ -855,13 +865,13 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
855
865
|
replaceFileId: replaceFileId,
|
|
856
866
|
occurrenceKey: occurrenceKey
|
|
857
867
|
};
|
|
858
|
-
_context11.next =
|
|
868
|
+
_context11.next = 2;
|
|
859
869
|
return mediaStore.copyFileWithToken(body, params, traceContext);
|
|
860
|
-
case
|
|
870
|
+
case 2:
|
|
861
871
|
_yield$mediaStore$cop = _context11.sent;
|
|
862
872
|
data = _yield$mediaStore$cop.data;
|
|
863
873
|
return _context11.abrupt("return", data);
|
|
864
|
-
case
|
|
874
|
+
case 3:
|
|
865
875
|
case "end":
|
|
866
876
|
return _context11.stop();
|
|
867
877
|
}
|
|
@@ -877,20 +887,20 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
877
887
|
value: function () {
|
|
878
888
|
var _copyFileWithIntent = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(source, destination, traceContext) {
|
|
879
889
|
var res, data;
|
|
880
|
-
return _regenerator.default.wrap(function
|
|
890
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
881
891
|
while (1) switch (_context12.prev = _context12.next) {
|
|
882
892
|
case 0:
|
|
883
|
-
_context12.next =
|
|
893
|
+
_context12.next = 1;
|
|
884
894
|
return this.mediaApi.copyFile(source.id, {
|
|
885
895
|
sourceCollection: source.collection,
|
|
886
896
|
collection: destination.collection,
|
|
887
897
|
replaceFileId: destination.replaceFileId
|
|
888
898
|
}, traceContext, source.clientId);
|
|
889
|
-
case
|
|
899
|
+
case 1:
|
|
890
900
|
res = _context12.sent;
|
|
891
901
|
data = res.data;
|
|
892
902
|
return _context12.abrupt("return", data);
|
|
893
|
-
case
|
|
903
|
+
case 2:
|
|
894
904
|
case "end":
|
|
895
905
|
return _context12.stop();
|
|
896
906
|
}
|
|
@@ -931,8 +941,10 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
931
941
|
replaceFileState,
|
|
932
942
|
key,
|
|
933
943
|
errorFileState,
|
|
934
|
-
_args13 = arguments
|
|
935
|
-
|
|
944
|
+
_args13 = arguments,
|
|
945
|
+
_t6,
|
|
946
|
+
_t7;
|
|
947
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
936
948
|
while (1) switch (_context13.prev = _context13.next) {
|
|
937
949
|
case 0:
|
|
938
950
|
options = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : {};
|
|
@@ -941,23 +953,23 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
941
953
|
destinationCollectionName = destination.collection, replaceFileId = destination.replaceFileId, occurrenceKey = destination.occurrenceKey;
|
|
942
954
|
preview = options.preview, mimeType = options.mimeType;
|
|
943
955
|
cache = (0, _fileStreamsCache.getFileStreamsCache)();
|
|
944
|
-
_context13.prev =
|
|
956
|
+
_context13.prev = 1;
|
|
945
957
|
if (!(isCopySourceFileWithToken(source) && isCopyDestinationWithToken(destination))) {
|
|
946
|
-
_context13.next =
|
|
958
|
+
_context13.next = 3;
|
|
947
959
|
break;
|
|
948
960
|
}
|
|
949
|
-
_context13.next =
|
|
961
|
+
_context13.next = 2;
|
|
950
962
|
return this.copyFileWithToken(source, destination, traceContext);
|
|
951
|
-
case
|
|
963
|
+
case 2:
|
|
952
964
|
copiedFile = _context13.sent;
|
|
953
|
-
_context13.next =
|
|
965
|
+
_context13.next = 5;
|
|
954
966
|
break;
|
|
955
|
-
case
|
|
956
|
-
_context13.next =
|
|
967
|
+
case 3:
|
|
968
|
+
_context13.next = 4;
|
|
957
969
|
return this.copyFileWithIntent(source, destination, traceContext);
|
|
958
|
-
case
|
|
970
|
+
case 4:
|
|
959
971
|
copiedFile = _context13.sent;
|
|
960
|
-
case
|
|
972
|
+
case 5:
|
|
961
973
|
// if we were passed a "mimeType", we propagate it into copiedFileWithMimeType
|
|
962
974
|
copiedFileWithMimeType = _objectSpread(_objectSpread({}, copiedFile), mimeType ? {
|
|
963
975
|
mimeType: mimeType
|
|
@@ -973,21 +985,21 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
973
985
|
previewOverride = !(0, _fileState2.isErrorFileState)(copiedFileState) && !!preview ? {
|
|
974
986
|
preview: preview
|
|
975
987
|
} : {};
|
|
976
|
-
|
|
988
|
+
_t6 = !(0, _fileState2.isFinalFileState)(copiedFileState) &&
|
|
977
989
|
// mimeType should always be returned by "copyFileWithToken"
|
|
978
990
|
// but in case it's not, we don't want to penalize "copyFile"
|
|
979
991
|
copiedMimeType;
|
|
980
|
-
if (!
|
|
981
|
-
_context13.next =
|
|
992
|
+
if (!_t6) {
|
|
993
|
+
_context13.next = 7;
|
|
982
994
|
break;
|
|
983
995
|
}
|
|
984
|
-
_context13.next =
|
|
996
|
+
_context13.next = 6;
|
|
985
997
|
return (0, _shouldFetchRemoteFileStates.shouldFetchRemoteFileStates)(mediaType, copiedMimeType, preview);
|
|
986
|
-
case
|
|
987
|
-
|
|
988
|
-
case
|
|
989
|
-
if (!
|
|
990
|
-
_context13.next =
|
|
998
|
+
case 6:
|
|
999
|
+
_t6 = _context13.sent;
|
|
1000
|
+
case 7:
|
|
1001
|
+
if (!_t6) {
|
|
1002
|
+
_context13.next = 8;
|
|
991
1003
|
break;
|
|
992
1004
|
}
|
|
993
1005
|
fileState = _objectSpread(_objectSpread(_objectSpread({}, copiedFileState), (0, _overrideMediaTypeIfUnknown.overrideMediaTypeIfUnknown)(copiedFileState, mediaType)), previewOverride);
|
|
@@ -1008,22 +1020,22 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
1008
1020
|
return subject.complete();
|
|
1009
1021
|
}
|
|
1010
1022
|
});
|
|
1011
|
-
_context13.next =
|
|
1023
|
+
_context13.next = 9;
|
|
1012
1024
|
break;
|
|
1013
|
-
case
|
|
1025
|
+
case 8:
|
|
1014
1026
|
if (!(0, _fileState2.isProcessingFileState)(copiedFileState)) {
|
|
1015
1027
|
_fileState = _objectSpread(_objectSpread({}, copiedFileState), !(0, _fileState2.isErrorFileState)(copiedFileState) && previewOverride);
|
|
1016
1028
|
subject.next(_fileState);
|
|
1017
1029
|
this.setFileState(copiedId, _fileState);
|
|
1018
1030
|
}
|
|
1019
|
-
case
|
|
1031
|
+
case 9:
|
|
1020
1032
|
if (!cache.has(copiedId)) {
|
|
1021
1033
|
(0, _fileStreamsCache.getFileStreamsCache)().set(copiedId, subject);
|
|
1022
1034
|
}
|
|
1023
1035
|
return _context13.abrupt("return", copiedFile);
|
|
1024
|
-
case
|
|
1025
|
-
_context13.prev =
|
|
1026
|
-
|
|
1036
|
+
case 10:
|
|
1037
|
+
_context13.prev = 10;
|
|
1038
|
+
_t7 = _context13["catch"](1);
|
|
1027
1039
|
if (processingSubscription) {
|
|
1028
1040
|
processingSubscription.unsubscribe();
|
|
1029
1041
|
}
|
|
@@ -1031,21 +1043,21 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
1031
1043
|
_fileCache = cache.get(replaceFileId);
|
|
1032
1044
|
replaceFileState = this.store.getState().files[replaceFileId];
|
|
1033
1045
|
if (_fileCache) {
|
|
1034
|
-
_fileCache.error(
|
|
1046
|
+
_fileCache.error(_t7);
|
|
1035
1047
|
} else {
|
|
1036
1048
|
// Create a new subject with the error state for new subscriptions
|
|
1037
|
-
cache.set(id, (0, _createMediaSubject.createMediaSubject)(
|
|
1049
|
+
cache.set(id, (0, _createMediaSubject.createMediaSubject)(_t7));
|
|
1038
1050
|
}
|
|
1039
1051
|
key = replaceFileState ? replaceFileId : id;
|
|
1040
|
-
errorFileState = this.getErrorFileState(
|
|
1052
|
+
errorFileState = this.getErrorFileState(_t7, id, occurrenceKey);
|
|
1041
1053
|
this.setFileState(key, errorFileState);
|
|
1042
1054
|
}
|
|
1043
|
-
throw
|
|
1044
|
-
case
|
|
1055
|
+
throw _t7;
|
|
1056
|
+
case 11:
|
|
1045
1057
|
case "end":
|
|
1046
1058
|
return _context13.stop();
|
|
1047
1059
|
}
|
|
1048
|
-
}, _callee13, this, [[
|
|
1060
|
+
}, _callee13, this, [[1, 10]]);
|
|
1049
1061
|
}));
|
|
1050
1062
|
function copyFile(_x31, _x32) {
|
|
1051
1063
|
return _copyFile.apply(this, arguments);
|