@atlaskit/media-client 20.2.1 → 21.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 +35 -0
- package/dist/cjs/client/file-fetcher/error.js +4 -4
- package/dist/cjs/client/file-fetcher/index.js +275 -287
- package/dist/cjs/client/media-client.js +48 -34
- package/dist/cjs/client/media-store/index.js +367 -314
- package/dist/cjs/client/media-store/resolveAuth.js +30 -32
- package/dist/cjs/client/stargate-client.js +14 -16
- package/dist/cjs/index.js +6 -13
- package/dist/cjs/models/media.js +8 -9
- package/dist/cjs/uploader/error.js +4 -4
- package/dist/cjs/uploader/index.js +88 -96
- package/dist/cjs/utils/convertBase64ToBlob.js +2 -2
- package/dist/cjs/utils/createFileDataLoader.js +67 -70
- package/dist/cjs/utils/getDimensionsFromBlob.js +23 -25
- package/dist/cjs/utils/getVideoDimensionsFromBlob.js +24 -26
- package/dist/cjs/utils/hashing/hasherCreator.js +32 -34
- package/dist/cjs/utils/mediaSubscribable/fromObservable.js +2 -2
- package/dist/cjs/utils/mobileUpload/error.js +4 -4
- package/dist/cjs/utils/mobileUpload/helpers.js +41 -43
- package/dist/cjs/utils/mobileUpload/stateMachine/index.js +14 -16
- package/dist/cjs/utils/parseJwt.js +52 -0
- package/dist/cjs/utils/polling/index.js +40 -42
- package/dist/cjs/utils/request/errors.js +9 -9
- package/dist/cjs/utils/request/helpers.js +143 -155
- package/dist/cjs/utils/request/index.js +24 -26
- package/dist/cjs/utils/shouldFetchRemoteFileStates.js +39 -41
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/file-fetcher/index.js +1 -3
- package/dist/es2019/client/media-client.js +3 -2
- package/dist/es2019/client/media-store/index.js +58 -15
- package/dist/es2019/index.js +2 -3
- package/dist/es2019/models/media.js +6 -4
- package/dist/es2019/uploader/index.js +3 -0
- package/dist/es2019/utils/mediaSubscribable/fromObservable.js +2 -2
- package/dist/es2019/utils/mediaSubscribable/toPromise.js +10 -12
- package/dist/es2019/utils/parseJwt.js +46 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/file-fetcher/error.js +4 -4
- package/dist/esm/client/file-fetcher/index.js +273 -286
- package/dist/esm/client/media-client.js +46 -32
- package/dist/esm/client/media-store/index.js +367 -314
- package/dist/esm/client/media-store/resolveAuth.js +30 -32
- package/dist/esm/client/stargate-client.js +14 -16
- package/dist/esm/index.js +2 -3
- package/dist/esm/models/media.js +6 -6
- package/dist/esm/uploader/error.js +4 -4
- package/dist/esm/uploader/index.js +89 -96
- package/dist/esm/utils/convertBase64ToBlob.js +2 -2
- package/dist/esm/utils/createFileDataLoader.js +65 -69
- package/dist/esm/utils/getDimensionsFromBlob.js +23 -25
- package/dist/esm/utils/getVideoDimensionsFromBlob.js +24 -26
- package/dist/esm/utils/hashing/hasherCreator.js +28 -30
- package/dist/esm/utils/mediaSubscribable/fromObservable.js +2 -2
- package/dist/esm/utils/mobileUpload/error.js +4 -4
- package/dist/esm/utils/mobileUpload/helpers.js +41 -43
- package/dist/esm/utils/mobileUpload/stateMachine/index.js +14 -16
- package/dist/esm/utils/parseJwt.js +46 -0
- package/dist/esm/utils/polling/index.js +40 -42
- package/dist/esm/utils/request/errors.js +9 -9
- package/dist/esm/utils/request/helpers.js +143 -155
- package/dist/esm/utils/request/index.js +24 -26
- package/dist/esm/utils/shouldFetchRemoteFileStates.js +39 -41
- package/dist/esm/version.json +1 -1
- package/dist/types/client/__mocks__/media-client.d.ts +0 -2
- package/dist/types/client/file-fetcher/index.d.ts +4 -4
- package/dist/types/client/media-client.d.ts +1 -2
- package/dist/types/client/media-store/index.d.ts +17 -13
- package/dist/types/index.d.ts +4 -6
- package/dist/types/models/file-state.d.ts +2 -2
- package/dist/types/models/media.d.ts +1 -21
- package/dist/types/utils/createFileDataLoader.d.ts +2 -2
- package/dist/types/utils/createMediaSubject.d.ts +2 -2
- package/dist/types/utils/detectEmptyFile.d.ts +2 -2
- package/dist/types/utils/mediaSubscribable/fromObservable.d.ts +3 -3
- package/dist/types/utils/mediaSubscribable/toPromise.d.ts +2 -2
- package/dist/types/utils/mediaSubscribable/types.d.ts +9 -8
- package/dist/types/utils/parseJwt.d.ts +1 -0
- package/package.json +2 -2
- package/report.api.md +77 -126
- package/dist/cjs/client/collection-fetcher.js +0 -98
- package/dist/cjs/models/media-subscribable.js +0 -5
- package/dist/cjs/utils/deprecatedEndpointError.js +0 -43
- package/dist/es2019/client/collection-fetcher.js +0 -38
- package/dist/es2019/models/media-subscribable.js +0 -1
- package/dist/es2019/utils/deprecatedEndpointError.js +0 -20
- package/dist/esm/client/collection-fetcher.js +0 -89
- package/dist/esm/models/media-subscribable.js +0 -1
- package/dist/esm/utils/deprecatedEndpointError.js +0 -34
- package/dist/types/client/collection-fetcher.d.ts +0 -42
- package/dist/types/models/media-subscribable.d.ts +0 -3
- package/dist/types/utils/deprecatedEndpointError.d.ts +0 -16
|
@@ -3,34 +3,32 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
3
3
|
export var getVideoDimensionsFromBlob = /*#__PURE__*/function () {
|
|
4
4
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(blob) {
|
|
5
5
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6
|
-
while (1) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
video.muted = true;
|
|
6
|
+
while (1) switch (_context.prev = _context.next) {
|
|
7
|
+
case 0:
|
|
8
|
+
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
9
|
+
var url = URL.createObjectURL(blob);
|
|
10
|
+
var video = document.createElement('video');
|
|
11
|
+
video.preload = 'metadata';
|
|
12
|
+
video.src = url;
|
|
13
|
+
video.muted = true;
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
URL.revokeObjectURL(url);
|
|
15
|
+
// loadedmetadata, loadeddata, play, playing
|
|
16
|
+
video.addEventListener('loadedmetadata', function timeupdateHandler() {
|
|
17
|
+
video.removeEventListener('loadedmetadata', timeupdateHandler);
|
|
18
|
+
resolve({
|
|
19
|
+
width: video.videoWidth,
|
|
20
|
+
height: video.videoHeight
|
|
24
21
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
URL.revokeObjectURL(url);
|
|
23
|
+
});
|
|
24
|
+
video.addEventListener('error', function () {
|
|
25
|
+
reject(new Error('failed to load video'));
|
|
26
|
+
URL.revokeObjectURL(url);
|
|
27
|
+
});
|
|
28
|
+
}));
|
|
29
|
+
case 1:
|
|
30
|
+
case "end":
|
|
31
|
+
return _context.stop();
|
|
34
32
|
}
|
|
35
33
|
}, _callee);
|
|
36
34
|
}));
|
|
@@ -8,38 +8,36 @@ export var createHasher = /*#__PURE__*/function () {
|
|
|
8
8
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
9
9
|
var numWorkers, _yield$import, WorkerHasher, _yield$import2, SimpleHasher;
|
|
10
10
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
11
|
-
while (1) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (hasher) {
|
|
16
|
-
_context.next = 17;
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
_context.prev = 2;
|
|
20
|
-
_context.next = 5;
|
|
21
|
-
return import('./workerHasher');
|
|
22
|
-
case 5:
|
|
23
|
-
_yield$import = _context.sent;
|
|
24
|
-
WorkerHasher = _yield$import.WorkerHasher;
|
|
25
|
-
hasher = new WorkerHasher(numWorkers);
|
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
|
12
|
+
case 0:
|
|
13
|
+
numWorkers = 3;
|
|
14
|
+
if (hasher) {
|
|
26
15
|
_context.next = 17;
|
|
27
16
|
break;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
17
|
+
}
|
|
18
|
+
_context.prev = 2;
|
|
19
|
+
_context.next = 5;
|
|
20
|
+
return import('./workerHasher');
|
|
21
|
+
case 5:
|
|
22
|
+
_yield$import = _context.sent;
|
|
23
|
+
WorkerHasher = _yield$import.WorkerHasher;
|
|
24
|
+
hasher = new WorkerHasher(numWorkers);
|
|
25
|
+
_context.next = 17;
|
|
26
|
+
break;
|
|
27
|
+
case 10:
|
|
28
|
+
_context.prev = 10;
|
|
29
|
+
_context.t0 = _context["catch"](2);
|
|
30
|
+
_context.next = 14;
|
|
31
|
+
return import('./simpleHasher');
|
|
32
|
+
case 14:
|
|
33
|
+
_yield$import2 = _context.sent;
|
|
34
|
+
SimpleHasher = _yield$import2.SimpleHasher;
|
|
35
|
+
hasher = new SimpleHasher();
|
|
36
|
+
case 17:
|
|
37
|
+
return _context.abrupt("return", hasher);
|
|
38
|
+
case 18:
|
|
39
|
+
case "end":
|
|
40
|
+
return _context.stop();
|
|
43
41
|
}
|
|
44
42
|
}, _callee, null, [[2, 10]]);
|
|
45
43
|
}));
|
|
@@ -14,6 +14,6 @@ export function fromObservable(observable) {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
export function createMediaSubscribable(
|
|
18
|
-
return fromObservable(createMediaSubject(
|
|
17
|
+
export function createMediaSubscribable(item) {
|
|
18
|
+
return fromObservable(createMediaSubject(item));
|
|
19
19
|
}
|
|
@@ -23,10 +23,10 @@ export var MobileUploadError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
|
23
23
|
get: function get() {
|
|
24
24
|
var reason = this.reason,
|
|
25
25
|
id = this.id,
|
|
26
|
-
_this$metadata = this.metadata
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
occurrenceKey = _this$
|
|
26
|
+
_this$metadata = this.metadata,
|
|
27
|
+
_this$metadata2 = _this$metadata === void 0 ? {} : _this$metadata,
|
|
28
|
+
collectionName = _this$metadata2.collectionName,
|
|
29
|
+
occurrenceKey = _this$metadata2.occurrenceKey;
|
|
30
30
|
return {
|
|
31
31
|
reason: reason,
|
|
32
32
|
id: id,
|
|
@@ -26,50 +26,48 @@ export var createMobileDownloadFileStream = function createMobileDownloadFileStr
|
|
|
26
26
|
poll.execute( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27
27
|
var response, fileState;
|
|
28
28
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29
|
-
while (1) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_context.next = 5;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
throw new MobileUploadError('emptyItems', id, {
|
|
44
|
-
collectionName: collectionName,
|
|
45
|
-
occurrenceKey: occurrenceKey
|
|
46
|
-
});
|
|
47
|
-
case 5:
|
|
48
|
-
if (!isEmptyFile(response)) {
|
|
49
|
-
_context.next = 7;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
throw new MobileUploadError('zeroVersionFile', id, {
|
|
53
|
-
collectionName: collectionName,
|
|
54
|
-
occurrenceKey: occurrenceKey
|
|
55
|
-
});
|
|
56
|
-
case 7:
|
|
57
|
-
fileState = mapMediaItemToFileState(id, response);
|
|
58
|
-
subject.next(fileState);
|
|
59
|
-
_context.t0 = fileState.status;
|
|
60
|
-
_context.next = _context.t0 === 'processing' ? 12 : _context.t0 === 'processed' ? 14 : 16;
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
_context.next = 2;
|
|
32
|
+
return dataloader.load({
|
|
33
|
+
id: id,
|
|
34
|
+
collectionName: collectionName
|
|
35
|
+
});
|
|
36
|
+
case 2:
|
|
37
|
+
response = _context.sent;
|
|
38
|
+
if (response) {
|
|
39
|
+
_context.next = 5;
|
|
61
40
|
break;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
}
|
|
42
|
+
throw new MobileUploadError('emptyItems', id, {
|
|
43
|
+
collectionName: collectionName,
|
|
44
|
+
occurrenceKey: occurrenceKey
|
|
45
|
+
});
|
|
46
|
+
case 5:
|
|
47
|
+
if (!isEmptyFile(response)) {
|
|
48
|
+
_context.next = 7;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
throw new MobileUploadError('zeroVersionFile', id, {
|
|
52
|
+
collectionName: collectionName,
|
|
53
|
+
occurrenceKey: occurrenceKey
|
|
54
|
+
});
|
|
55
|
+
case 7:
|
|
56
|
+
fileState = mapMediaItemToFileState(id, response);
|
|
57
|
+
subject.next(fileState);
|
|
58
|
+
_context.t0 = fileState.status;
|
|
59
|
+
_context.next = _context.t0 === 'processing' ? 12 : _context.t0 === 'processed' ? 14 : 16;
|
|
60
|
+
break;
|
|
61
|
+
case 12:
|
|
62
|
+
// the only case for continuing polling, otherwise this function is run once only
|
|
63
|
+
poll.next();
|
|
64
|
+
return _context.abrupt("break", 16);
|
|
65
|
+
case 14:
|
|
66
|
+
subject.complete();
|
|
67
|
+
return _context.abrupt("break", 16);
|
|
68
|
+
case 16:
|
|
69
|
+
case "end":
|
|
70
|
+
return _context.stop();
|
|
73
71
|
}
|
|
74
72
|
}, _callee);
|
|
75
73
|
})));
|
|
@@ -32,22 +32,20 @@ export var createMobileUploadStateMachine = function createMobileUploadStateMach
|
|
|
32
32
|
var _shouldFetchRemoteFileStates2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ctx) {
|
|
33
33
|
var currentFileState, mediaType, mimeType, preview;
|
|
34
34
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
35
|
-
while (1) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return _context.stop();
|
|
50
|
-
}
|
|
35
|
+
while (1) switch (_context.prev = _context.next) {
|
|
36
|
+
case 0:
|
|
37
|
+
currentFileState = ctx.currentFileState;
|
|
38
|
+
if (!isProcessingFileState(currentFileState)) {
|
|
39
|
+
_context.next = 4;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
mediaType = currentFileState.mediaType, mimeType = currentFileState.mimeType, preview = currentFileState.preview;
|
|
43
|
+
return _context.abrupt("return", _shouldFetchRemoteFileStates(mediaType, mimeType, preview));
|
|
44
|
+
case 4:
|
|
45
|
+
return _context.abrupt("return", false);
|
|
46
|
+
case 5:
|
|
47
|
+
case "end":
|
|
48
|
+
return _context.stop();
|
|
51
49
|
}
|
|
52
50
|
}, _callee);
|
|
53
51
|
}));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Implementation obtained from https://github.com/auth0/jwt-decode
|
|
2
|
+
// Copied from https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/13080
|
|
3
|
+
|
|
4
|
+
/* Decodes base64 string into unicode */
|
|
5
|
+
var b64DecodeUnicode = function b64DecodeUnicode(str) {
|
|
6
|
+
return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) {
|
|
7
|
+
var code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
8
|
+
if (code.length < 2) {
|
|
9
|
+
code = '0' + code;
|
|
10
|
+
}
|
|
11
|
+
return '%' + code;
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/* Decodes base64url string into unicode */
|
|
16
|
+
var b64Decode = function b64Decode(str) {
|
|
17
|
+
var output = str.replace(/-/g, '+').replace(/_/g, '/');
|
|
18
|
+
switch (output.length % 4) {
|
|
19
|
+
case 0:
|
|
20
|
+
break;
|
|
21
|
+
case 2:
|
|
22
|
+
output += '==';
|
|
23
|
+
break;
|
|
24
|
+
case 3:
|
|
25
|
+
output += '=';
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
throw new Error('Illegal base64url string!');
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
return b64DecodeUnicode(output);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
return atob(output);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export default function (token) {
|
|
37
|
+
try {
|
|
38
|
+
var body = token.split('.')[1];
|
|
39
|
+
return JSON.parse(b64Decode(body));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
if (e instanceof Error) {
|
|
42
|
+
throw new Error('Invalid token specified: ' + e.message);
|
|
43
|
+
}
|
|
44
|
+
throw e;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -42,49 +42,47 @@ export var PollingFunction = /*#__PURE__*/function () {
|
|
|
42
42
|
var _this = this;
|
|
43
43
|
var poll_maxAttempts;
|
|
44
44
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
45
|
-
while (1) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_context.next = 3;
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
return _context.abrupt("return", this.fail(new PollingError('pollingMaxAttemptsExceeded', this.attempt)));
|
|
54
|
-
case 3:
|
|
55
|
-
_context.prev = 3;
|
|
56
|
-
// executor must explicitly call this.next() for triggering next iteration (pull)
|
|
57
|
-
this.shouldIterate = false;
|
|
58
|
-
_context.next = 7;
|
|
59
|
-
return executor();
|
|
60
|
-
case 7:
|
|
61
|
-
if (this.shouldIterate) {
|
|
62
|
-
_context.next = 9;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
return _context.abrupt("return");
|
|
66
|
-
case 9:
|
|
67
|
-
if (!(this.attempt >= poll_maxAttempts)) {
|
|
68
|
-
_context.next = 11;
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
return _context.abrupt("return", this.fail(new PollingError('pollingMaxAttemptsExceeded', this.attempt)));
|
|
72
|
-
case 11:
|
|
73
|
-
this.poll_intervalMs = this.getIntervalMsForIteration(this.attempt);
|
|
74
|
-
this.attempt++;
|
|
75
|
-
this.timeoutId = window.setTimeout(function () {
|
|
76
|
-
return _this.execute(executor);
|
|
77
|
-
}, this.poll_intervalMs);
|
|
78
|
-
_context.next = 19;
|
|
45
|
+
while (1) switch (_context.prev = _context.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
poll_maxAttempts = this.options.poll_maxAttempts;
|
|
48
|
+
if (!(poll_maxAttempts === 0)) {
|
|
49
|
+
_context.next = 3;
|
|
79
50
|
break;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
51
|
+
}
|
|
52
|
+
return _context.abrupt("return", this.fail(new PollingError('pollingMaxAttemptsExceeded', this.attempt)));
|
|
53
|
+
case 3:
|
|
54
|
+
_context.prev = 3;
|
|
55
|
+
// executor must explicitly call this.next() for triggering next iteration (pull)
|
|
56
|
+
this.shouldIterate = false;
|
|
57
|
+
_context.next = 7;
|
|
58
|
+
return executor();
|
|
59
|
+
case 7:
|
|
60
|
+
if (this.shouldIterate) {
|
|
61
|
+
_context.next = 9;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
return _context.abrupt("return");
|
|
65
|
+
case 9:
|
|
66
|
+
if (!(this.attempt >= poll_maxAttempts)) {
|
|
67
|
+
_context.next = 11;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return _context.abrupt("return", this.fail(new PollingError('pollingMaxAttemptsExceeded', this.attempt)));
|
|
71
|
+
case 11:
|
|
72
|
+
this.poll_intervalMs = this.getIntervalMsForIteration(this.attempt);
|
|
73
|
+
this.attempt++;
|
|
74
|
+
this.timeoutId = window.setTimeout(function () {
|
|
75
|
+
return _this.execute(executor);
|
|
76
|
+
}, this.poll_intervalMs);
|
|
77
|
+
_context.next = 19;
|
|
78
|
+
break;
|
|
79
|
+
case 16:
|
|
80
|
+
_context.prev = 16;
|
|
81
|
+
_context.t0 = _context["catch"](3);
|
|
82
|
+
this.fail(_context.t0);
|
|
83
|
+
case 19:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context.stop();
|
|
88
86
|
}
|
|
89
87
|
}, _callee, this, [[3, 16]]);
|
|
90
88
|
}));
|
|
@@ -22,15 +22,15 @@ export var RequestError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
|
22
22
|
key: "attributes",
|
|
23
23
|
get: function get() {
|
|
24
24
|
var reason = this.reason,
|
|
25
|
-
_this$metadata = this.metadata
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
endpoint = _this$
|
|
29
|
-
mediaRegion = _this$
|
|
30
|
-
mediaEnv = _this$
|
|
31
|
-
attempts = _this$
|
|
32
|
-
clientExhaustedRetries = _this$
|
|
33
|
-
statusCode = _this$
|
|
25
|
+
_this$metadata = this.metadata,
|
|
26
|
+
_this$metadata2 = _this$metadata === void 0 ? {} : _this$metadata,
|
|
27
|
+
method = _this$metadata2.method,
|
|
28
|
+
endpoint = _this$metadata2.endpoint,
|
|
29
|
+
mediaRegion = _this$metadata2.mediaRegion,
|
|
30
|
+
mediaEnv = _this$metadata2.mediaEnv,
|
|
31
|
+
attempts = _this$metadata2.attempts,
|
|
32
|
+
clientExhaustedRetries = _this$metadata2.clientExhaustedRetries,
|
|
33
|
+
statusCode = _this$metadata2.statusCode,
|
|
34
34
|
innerError = this.innerError;
|
|
35
35
|
return {
|
|
36
36
|
reason: reason,
|