@atlaskit/media-client 38.1.17 → 38.1.19
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 +12 -0
- package/dist/cjs/client/file-fetcher/index.js +13 -13
- package/dist/cjs/client/media-client.js +1 -1
- package/dist/cjs/client/media-store/MediaStore.js +1 -1
- package/dist/cjs/uploader/calculateChunkSize.js +1 -1
- package/dist/cjs/uploader/index.js +1 -1
- package/dist/cjs/utils/request/createMapResponseToBlob.js +1 -1
- package/dist/cjs/utils/request/createMapResponseToJson.js +1 -1
- package/dist/cjs/utils/request/createRequestErrorFromResponse.js +1 -1
- package/dist/cjs/utils/request/fetchRetry.js +1 -1
- package/dist/cjs/utils/request/index.js +3 -3
- package/dist/cjs/utils/url.js +1 -0
- package/dist/es2019/client/file-fetcher/error.js +1 -0
- package/dist/es2019/client/file-fetcher/index.js +14 -13
- package/dist/es2019/client/media-client.js +1 -1
- package/dist/es2019/client/media-store/MediaStore.js +1 -1
- package/dist/es2019/client/media-store/error.js +1 -0
- package/dist/es2019/media-core.js +1 -0
- package/dist/es2019/uploader/calculateChunkSize.js +1 -1
- package/dist/es2019/uploader/index.js +1 -1
- package/dist/es2019/utils/polling/errors.js +1 -0
- package/dist/es2019/utils/polling/index.js +1 -0
- package/dist/es2019/utils/request/createMapResponseToBlob.js +1 -1
- package/dist/es2019/utils/request/createMapResponseToJson.js +1 -1
- package/dist/es2019/utils/request/createRequestErrorFromResponse.js +1 -1
- package/dist/es2019/utils/request/errors.js +1 -0
- package/dist/es2019/utils/request/fetchRetry.js +1 -1
- package/dist/es2019/utils/request/index.js +3 -3
- package/dist/es2019/utils/url.js +1 -0
- package/dist/esm/client/file-fetcher/error.js +1 -0
- package/dist/esm/client/file-fetcher/index.js +14 -13
- package/dist/esm/client/media-client.js +1 -1
- package/dist/esm/client/media-store/MediaStore.js +1 -1
- package/dist/esm/client/media-store/error.js +1 -0
- package/dist/esm/media-core.js +1 -0
- package/dist/esm/uploader/calculateChunkSize.js +1 -1
- package/dist/esm/uploader/index.js +1 -1
- package/dist/esm/utils/polling/errors.js +1 -0
- package/dist/esm/utils/polling/index.js +1 -0
- package/dist/esm/utils/request/createMapResponseToBlob.js +1 -1
- package/dist/esm/utils/request/createMapResponseToJson.js +1 -1
- package/dist/esm/utils/request/createRequestErrorFromResponse.js +1 -1
- package/dist/esm/utils/request/errors.js +1 -0
- package/dist/esm/utils/request/fetchRetry.js +1 -1
- package/dist/esm/utils/request/index.js +3 -3
- package/dist/esm/utils/url.js +1 -0
- package/dist/types/client/events.d.ts +1 -1
- package/dist/types/client/file-fetcher/index.d.ts +3 -3
- package/dist/types/client/media-client.d.ts +2 -2
- package/dist/types/client/media-store/types.d.ts +3 -3
- package/dist/types/models/item.d.ts +1 -1
- package/dist/types/utils/createCopyIntentRegisterationBatcher.d.ts +1 -1
- package/dist/types/utils/hashing/hasherCreator.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/toPromise.d.ts +1 -1
- package/dist/types/utils/request/types.d.ts +1 -1
- package/example-helpers/styles.ts +3 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -22,18 +22,23 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
22
22
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
23
23
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
24
24
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
var _mime = require("mime");
|
|
25
26
|
var _map = require("rxjs/operators/map");
|
|
26
27
|
var _Subscription = require("rxjs/Subscription");
|
|
27
28
|
var _uuid = require("uuid");
|
|
28
|
-
var _mime = require("mime");
|
|
29
|
-
var _authToOwner = require("@atlaskit/media-core/auth-to-owner");
|
|
30
|
-
var _isValidUuid = require("@atlaskit/media-common/isValidUuid");
|
|
31
29
|
var _downloadUrl = require("@atlaskit/media-common/downloadUrl");
|
|
30
|
+
var _isValidUuid = require("@atlaskit/media-common/isValidUuid");
|
|
31
|
+
var _mediaTypeUtils = require("@atlaskit/media-common/mediaTypeUtils");
|
|
32
|
+
var _authToOwner = require("@atlaskit/media-core/auth-to-owner");
|
|
33
|
+
var _mediaStore = require("@atlaskit/media-state/media-store");
|
|
32
34
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
33
35
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
34
36
|
var _constants = require("../../constants");
|
|
35
37
|
var _fileStreamsCache = require("../../file-streams-cache");
|
|
36
38
|
var _globalMediaEventEmitter = require("../../globalMediaEventEmitter");
|
|
39
|
+
var _CommonMediaClientError = require("../../models/errors/CommonMediaClientError");
|
|
40
|
+
var _fromCommonMediaClientError = require("../../models/errors/fromCommonMediaClientError");
|
|
41
|
+
var _isCommonMediaClientError = require("../../models/errors/isCommonMediaClientError");
|
|
37
42
|
var _isErrorFileState = require("../../models/is-error-file-state");
|
|
38
43
|
var _isFinalFileState = require("../../models/is-final-file-state");
|
|
39
44
|
var _isNotFoundMediaItemDetails = require("../../models/is-not-found-media-item-details");
|
|
@@ -42,25 +47,20 @@ var _mapMediaFileToFileState = require("../../models/map-media-file-to-file-stat
|
|
|
42
47
|
var _mapMediaItemToFileState = require("../../models/map-media-item-to-file-state");
|
|
43
48
|
var _uploader = require("../../uploader");
|
|
44
49
|
var _convertBase64ToBlob = require("../../utils/convertBase64ToBlob");
|
|
50
|
+
var _createCopyIntentRegisterationBatcher = require("../../utils/createCopyIntentRegisterationBatcher");
|
|
45
51
|
var _createFileDataloader = require("../../utils/createFileDataloader-2");
|
|
46
52
|
var _createMediaSubject = require("../../utils/createMediaSubject");
|
|
53
|
+
var _detectEmptyFile = require("../../utils/detectEmptyFile");
|
|
47
54
|
var _getDimensionsFromBlob = require("../../utils/getDimensionsFromBlob");
|
|
48
55
|
var _getMediaTypeFromUploadableFile = require("../../utils/getMediaTypeFromUploadableFile");
|
|
49
56
|
var _fromObservable = require("../../utils/mediaSubscribable/fromObservable");
|
|
50
57
|
var _toPromise = require("../../utils/mediaSubscribable/toPromise");
|
|
51
58
|
var _overrideMediaTypeIfUnknown = require("../../utils/overrideMediaTypeIfUnknown");
|
|
52
|
-
var _MediaStore = require("../media-store/MediaStore");
|
|
53
|
-
var _FileFetcherError = require("./FileFetcherError");
|
|
54
|
-
var _mediaTypeUtils = require("@atlaskit/media-common/mediaTypeUtils");
|
|
55
|
-
var _detectEmptyFile = require("../../utils/detectEmptyFile");
|
|
56
59
|
var _polling = require("../../utils/polling");
|
|
57
|
-
var _shouldFetchRemoteFileStates = require("../../utils/shouldFetchRemoteFileStates");
|
|
58
|
-
var _mediaStore = require("@atlaskit/media-state/media-store");
|
|
59
|
-
var _createCopyIntentRegisterationBatcher = require("../../utils/createCopyIntentRegisterationBatcher");
|
|
60
|
-
var _CommonMediaClientError = require("../../models/errors/CommonMediaClientError");
|
|
61
|
-
var _fromCommonMediaClientError = require("../../models/errors/fromCommonMediaClientError");
|
|
62
|
-
var _isCommonMediaClientError = require("../../models/errors/isCommonMediaClientError");
|
|
63
60
|
var _defaultShouldRetryError = require("../../utils/request/defaultShouldRetryError");
|
|
61
|
+
var _shouldFetchRemoteFileStates = require("../../utils/shouldFetchRemoteFileStates");
|
|
62
|
+
var _MediaStore = require("../media-store/MediaStore");
|
|
63
|
+
var _FileFetcherError = require("./FileFetcherError");
|
|
64
64
|
var _isFileFetcherError = require("./isFileFetcherError");
|
|
65
65
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
66
66
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
@@ -12,10 +12,10 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
var _eventemitter = require("eventemitter2");
|
|
14
14
|
var _chunkHashAlgorithm = require("@atlaskit/media-core/chunk-hash-algorithm");
|
|
15
|
+
var _mediaStore = require("@atlaskit/media-state/media-store");
|
|
15
16
|
var _fileFetcher = require("./file-fetcher");
|
|
16
17
|
var _MediaStore = require("./media-store/MediaStore");
|
|
17
18
|
var _stargateClient = require("./stargate-client");
|
|
18
|
-
var _mediaStore = require("@atlaskit/media-state/media-store");
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var MediaClient = exports.MediaClient = /*#__PURE__*/function () {
|
|
21
21
|
// mobile upload is lazily loaded
|
|
@@ -28,8 +28,8 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
28
28
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
29
29
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
30
30
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
31
|
-
var _isClientBasedAuth = require("@atlaskit/media-core/is-client-based-auth");
|
|
32
31
|
var _chunkHashAlgorithm = require("@atlaskit/media-core/chunk-hash-algorithm");
|
|
32
|
+
var _isClientBasedAuth = require("@atlaskit/media-core/is-client-based-auth");
|
|
33
33
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
34
34
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
35
35
|
var _constants = require("../../constants");
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.fileSizeError = exports.calculateChunkSize = void 0;
|
|
7
|
-
var _media = require("../models/media");
|
|
8
7
|
var _constants = require("../constants");
|
|
8
|
+
var _media = require("../models/media");
|
|
9
9
|
var fileSizeError = exports.fileSizeError = 'fileSizeExceedsLimit';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -12,8 +12,8 @@ var _concatMap = require("rxjs/operators/concatMap");
|
|
|
12
12
|
var _chunkinator = require("@atlaskit/chunkinator/chunkinator");
|
|
13
13
|
var _constants = require("../constants");
|
|
14
14
|
var _hasherCreator = require("../utils/hashing/hasherCreator");
|
|
15
|
-
var _UploaderError = require("./UploaderError");
|
|
16
15
|
var _calculateChunkSize = require("./calculateChunkSize");
|
|
16
|
+
var _UploaderError = require("./UploaderError");
|
|
17
17
|
// TODO: Allow to pass multiple files
|
|
18
18
|
|
|
19
19
|
var _hashingFunction = /*#__PURE__*/function () {
|
|
@@ -8,8 +8,8 @@ exports.createMapResponseToBlob = createMapResponseToBlob;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _RequestError = require("./RequestError");
|
|
12
11
|
var _extractMediaHeaders = require("./extractMediaHeaders");
|
|
12
|
+
var _RequestError = require("./RequestError");
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
function createMapResponseToBlob(metadata) {
|
|
@@ -8,8 +8,8 @@ exports.createMapResponseToJson = createMapResponseToJson;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _RequestError = require("./RequestError");
|
|
12
11
|
var _extractMediaHeaders = require("./extractMediaHeaders");
|
|
12
|
+
var _RequestError = require("./RequestError");
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
function createMapResponseToJson(metadata) {
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createRequestErrorFromResponse = createRequestErrorFromResponse;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _RequestError = require("./RequestError");
|
|
10
9
|
var _createRequestErrorReason = require("./createRequestErrorReason");
|
|
11
10
|
var _extractMediaHeaders = require("./extractMediaHeaders");
|
|
11
|
+
var _RequestError = require("./RequestError");
|
|
12
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
function createRequestErrorFromResponse(metadata, response) {
|
|
@@ -8,12 +8,12 @@ exports.fetchRetry = fetchRetry;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _RequestError = require("./RequestError");
|
|
12
11
|
var _cloneRequestError = require("./cloneRequestError");
|
|
13
12
|
var _defaultShouldRetryError = require("./defaultShouldRetryError");
|
|
14
13
|
var _helpers = require("./helpers");
|
|
15
14
|
var _isAbortedRequestError = require("./isAbortedRequestError");
|
|
16
15
|
var _isRequestError = require("./isRequestError");
|
|
16
|
+
var _RequestError = require("./RequestError");
|
|
17
17
|
var _waitPromise = require("./waitPromise");
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -36,15 +36,15 @@ var _RequestError = require("./RequestError");
|
|
|
36
36
|
var _isRequestError = require("./isRequestError");
|
|
37
37
|
var _createRequestErrorReason = require("./createRequestErrorReason");
|
|
38
38
|
var _isRateLimitedError = require("./isRateLimitedError");
|
|
39
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
40
|
+
var _getNavigator3 = _interopRequireDefault(require("../getNavigator"));
|
|
41
|
+
var _mapRetryUrlToPathBasedUrl = require("../mapRetryUrlToPathBasedUrl");
|
|
39
42
|
var _createProcessFetchResponse = require("./createProcessFetchResponse");
|
|
40
43
|
var _createUrl = require("./createUrl");
|
|
41
44
|
var _defaultShouldRetryError = require("./defaultShouldRetryError");
|
|
42
45
|
var _extendHeaders = require("./extendHeaders");
|
|
43
46
|
var _fetchRetry = require("./fetchRetry");
|
|
44
47
|
var _isFetchNetworkError = require("./isFetchNetworkError");
|
|
45
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
46
|
-
var _getNavigator3 = _interopRequireDefault(require("../getNavigator"));
|
|
47
|
-
var _mapRetryUrlToPathBasedUrl = require("../mapRetryUrlToPathBasedUrl");
|
|
48
48
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
49
49
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */ /**
|
|
50
50
|
* @deprecated Use `import { RequestError } from '@atlaskit/media-client/request/errors'` instead.
|
package/dist/cjs/utils/url.js
CHANGED
|
@@ -33,6 +33,7 @@ var _getAttrsFromUrl = require("./getAttrsFromUrl");
|
|
|
33
33
|
var _objectToQueryString = require("./objectToQueryString");
|
|
34
34
|
var _addFileAttrsToUrl = require("./addFileAttrsToUrl");
|
|
35
35
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
36
|
+
|
|
36
37
|
var mediaBlobUrlIdentifier = exports.mediaBlobUrlIdentifier = 'media-blob-url';
|
|
37
38
|
|
|
38
39
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Use `import { FileFetcherError } from '@atlaskit/media-client/file-fetcher'` instead.
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
export { FileFetcherError } from './FileFetcherError';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated Use `import { isFileFetcherError } from '@atlaskit/media-client/file-fetcher'` instead.
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
3
|
+
|
|
4
|
+
import { getExtension } from 'mime';
|
|
3
5
|
import { map } from 'rxjs/operators/map';
|
|
4
6
|
import { Subscription } from 'rxjs/Subscription';
|
|
5
7
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
6
8
|
import { v4 as uuid } from 'uuid';
|
|
7
|
-
import { getExtension } from 'mime';
|
|
8
|
-
import { authToOwner } from '@atlaskit/media-core/auth-to-owner';
|
|
9
|
-
import { isValidUuid } from '@atlaskit/media-common/isValidUuid';
|
|
10
9
|
import { downloadUrl } from '@atlaskit/media-common/downloadUrl';
|
|
10
|
+
import { isValidUuid } from '@atlaskit/media-common/isValidUuid';
|
|
11
|
+
import { getMediaTypeFromMimeType } from '@atlaskit/media-common/mediaTypeUtils';
|
|
12
|
+
import { authToOwner } from '@atlaskit/media-core/auth-to-owner';
|
|
13
|
+
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
11
14
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
12
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
16
|
import { RECENTS_COLLECTION } from '../../constants';
|
|
14
17
|
import { getFileStreamsCache } from '../../file-streams-cache';
|
|
15
18
|
import { globalMediaEventEmitter } from '../../globalMediaEventEmitter';
|
|
19
|
+
import { CommonMediaClientError } from '../../models/errors/CommonMediaClientError';
|
|
20
|
+
import { fromCommonMediaClientError } from '../../models/errors/fromCommonMediaClientError';
|
|
21
|
+
import { isCommonMediaClientError } from '../../models/errors/isCommonMediaClientError';
|
|
16
22
|
import { isErrorFileState } from '../../models/is-error-file-state';
|
|
17
23
|
import { isFinalFileState } from '../../models/is-final-file-state';
|
|
18
24
|
import { isNotFoundMediaItemDetails } from '../../models/is-not-found-media-item-details';
|
|
@@ -21,25 +27,20 @@ import { mapMediaFileToFileState } from '../../models/map-media-file-to-file-sta
|
|
|
21
27
|
import { mapMediaItemToFileState } from '../../models/map-media-item-to-file-state';
|
|
22
28
|
import { uploadFile } from '../../uploader';
|
|
23
29
|
import { convertBase64ToBlob } from '../../utils/convertBase64ToBlob';
|
|
30
|
+
import { createCopyIntentRegisterationBatcher } from '../../utils/createCopyIntentRegisterationBatcher';
|
|
24
31
|
import { createFileDataloader } from '../../utils/createFileDataloader-2';
|
|
25
32
|
import { createMediaSubject } from '../../utils/createMediaSubject';
|
|
33
|
+
import { isEmptyFile } from '../../utils/detectEmptyFile';
|
|
26
34
|
import { getDimensionsFromBlob } from '../../utils/getDimensionsFromBlob';
|
|
27
35
|
import { getMediaTypeFromUploadableFile } from '../../utils/getMediaTypeFromUploadableFile';
|
|
28
36
|
import { fromObservable } from '../../utils/mediaSubscribable/fromObservable';
|
|
29
37
|
import { toPromise } from '../../utils/mediaSubscribable/toPromise';
|
|
30
38
|
import { overrideMediaTypeIfUnknown } from '../../utils/overrideMediaTypeIfUnknown';
|
|
31
|
-
import { MediaStore as MediaApi } from '../media-store/MediaStore';
|
|
32
|
-
import { FileFetcherError } from './FileFetcherError';
|
|
33
|
-
import { getMediaTypeFromMimeType } from '@atlaskit/media-common/mediaTypeUtils';
|
|
34
|
-
import { isEmptyFile } from '../../utils/detectEmptyFile';
|
|
35
39
|
import { PollingFunction } from '../../utils/polling';
|
|
36
|
-
import { shouldFetchRemoteFileStates } from '../../utils/shouldFetchRemoteFileStates';
|
|
37
|
-
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
38
|
-
import { createCopyIntentRegisterationBatcher } from '../../utils/createCopyIntentRegisterationBatcher';
|
|
39
|
-
import { CommonMediaClientError } from '../../models/errors/CommonMediaClientError';
|
|
40
|
-
import { fromCommonMediaClientError } from '../../models/errors/fromCommonMediaClientError';
|
|
41
|
-
import { isCommonMediaClientError } from '../../models/errors/isCommonMediaClientError';
|
|
42
40
|
import { defaultShouldRetryError } from '../../utils/request/defaultShouldRetryError';
|
|
41
|
+
import { shouldFetchRemoteFileStates } from '../../utils/shouldFetchRemoteFileStates';
|
|
42
|
+
import { MediaStore as MediaApi } from '../media-store/MediaStore';
|
|
43
|
+
import { FileFetcherError } from './FileFetcherError';
|
|
43
44
|
/**
|
|
44
45
|
* @deprecated Use `import { FileFetcherError } from '@atlaskit/media-client/file-fetcher/error'` instead.
|
|
45
46
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EventEmitter2 } from 'eventemitter2';
|
|
2
2
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
3
|
+
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
3
4
|
import { FileFetcherImpl } from './file-fetcher';
|
|
4
5
|
import { MediaStore as MediaApi } from './media-store/MediaStore';
|
|
5
6
|
import { StargateClient } from './stargate-client';
|
|
6
|
-
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
7
7
|
export class MediaClient {
|
|
8
8
|
// mobile upload is lazily loaded
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
3
3
|
|
|
4
|
-
import { isClientBasedAuth } from '@atlaskit/media-core/is-client-based-auth';
|
|
5
4
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
5
|
+
import { isClientBasedAuth } from '@atlaskit/media-core/is-client-based-auth';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
8
|
import { FILE_CACHE_MAX_AGE } from '../../constants';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Use `import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm'` instead.
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
export { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated Use `import type { MediaClientConfig } from '@atlaskit/media-core/auth'` instead.
|
|
@@ -3,8 +3,8 @@ import { concatMap } from 'rxjs/operators/concatMap';
|
|
|
3
3
|
import { chunkinator } from '@atlaskit/chunkinator/chunkinator';
|
|
4
4
|
import { CHUNK_SIZE, PROCESSING_BATCH_SIZE } from '../constants';
|
|
5
5
|
import { createHasher } from '../utils/hashing/hasherCreator';
|
|
6
|
-
import { UploaderError } from './UploaderError';
|
|
7
6
|
import { calculateChunkSize, fileSizeError } from './calculateChunkSize';
|
|
7
|
+
import { UploaderError } from './UploaderError';
|
|
8
8
|
|
|
9
9
|
// TODO: Allow to pass multiple files
|
|
10
10
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
3
|
+
|
|
3
4
|
import { PollingError } from './PollingError';
|
|
4
5
|
/**
|
|
5
6
|
* @deprecated Use `import { PollingError } from '@atlaskit/media-client/polling/errors'` instead.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RequestError } from './RequestError';
|
|
2
1
|
import { createRequestErrorReason } from './createRequestErrorReason';
|
|
3
2
|
import { extractMediaHeaders } from './extractMediaHeaders';
|
|
3
|
+
import { RequestError } from './RequestError';
|
|
4
4
|
export function createRequestErrorFromResponse(metadata, response) {
|
|
5
5
|
const {
|
|
6
6
|
status: statusCode
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { RequestError } from './RequestError';
|
|
2
1
|
import { cloneRequestError } from './cloneRequestError';
|
|
3
2
|
import { defaultShouldRetryError } from './defaultShouldRetryError';
|
|
4
3
|
import { DEFAULT_RETRY_OPTIONS } from './helpers';
|
|
5
4
|
import { isAbortedRequestError } from './isAbortedRequestError';
|
|
6
5
|
import { isRequestError } from './isRequestError';
|
|
6
|
+
import { RequestError } from './RequestError';
|
|
7
7
|
import { waitPromise } from './waitPromise';
|
|
8
8
|
export async function fetchRetry(functionToRetry, metadata, overwriteOptions = {}) {
|
|
9
9
|
const options = {
|
|
@@ -16,15 +16,15 @@ export { createRequestErrorReason } from './createRequestErrorReason';
|
|
|
16
16
|
* @deprecated Use `import { isRateLimitedError } from '@atlaskit/media-client/request/helpers'` instead.
|
|
17
17
|
*/
|
|
18
18
|
export { isRateLimitedError } from './isRateLimitedError';
|
|
19
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
20
|
+
import getNavigator from '../getNavigator';
|
|
21
|
+
import { mapRetryUrlToPathBasedUrl } from '../mapRetryUrlToPathBasedUrl';
|
|
19
22
|
import { createProcessFetchResponse } from './createProcessFetchResponse';
|
|
20
23
|
import { createUrl } from './createUrl';
|
|
21
24
|
import { defaultShouldRetryError } from './defaultShouldRetryError';
|
|
22
25
|
import { extendHeaders } from './extendHeaders';
|
|
23
26
|
import { fetchRetry } from './fetchRetry';
|
|
24
27
|
import { isFetchNetworkError } from './isFetchNetworkError';
|
|
25
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
26
|
-
import getNavigator from '../getNavigator';
|
|
27
|
-
import { mapRetryUrlToPathBasedUrl } from '../mapRetryUrlToPathBasedUrl';
|
|
28
28
|
export async function request(url, options = {}, controller) {
|
|
29
29
|
const {
|
|
30
30
|
method = 'GET',
|
package/dist/es2019/utils/url.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
|
|
2
3
|
export const mediaBlobUrlIdentifier = 'media-blob-url';
|
|
3
4
|
/**
|
|
4
5
|
* @deprecated Use `import { isMediaBlobUrl } from '@atlaskit/media-client'` instead.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Use `import { FileFetcherError } from '@atlaskit/media-client/file-fetcher'` instead.
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
export { FileFetcherError } from './FileFetcherError';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated Use `import { isFileFetcherError } from '@atlaskit/media-client/file-fetcher'` instead.
|
|
@@ -6,19 +6,25 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
9
|
+
|
|
10
|
+
import { getExtension } from 'mime';
|
|
9
11
|
import { map } from 'rxjs/operators/map';
|
|
10
12
|
import { Subscription } from 'rxjs/Subscription';
|
|
11
13
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
12
14
|
import { v4 as uuid } from 'uuid';
|
|
13
|
-
import { getExtension } from 'mime';
|
|
14
|
-
import { authToOwner } from '@atlaskit/media-core/auth-to-owner';
|
|
15
|
-
import { isValidUuid } from '@atlaskit/media-common/isValidUuid';
|
|
16
15
|
import { downloadUrl } from '@atlaskit/media-common/downloadUrl';
|
|
16
|
+
import { isValidUuid } from '@atlaskit/media-common/isValidUuid';
|
|
17
|
+
import { getMediaTypeFromMimeType } from '@atlaskit/media-common/mediaTypeUtils';
|
|
18
|
+
import { authToOwner } from '@atlaskit/media-core/auth-to-owner';
|
|
19
|
+
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
17
20
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
18
21
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
22
|
import { RECENTS_COLLECTION } from '../../constants';
|
|
20
23
|
import { getFileStreamsCache } from '../../file-streams-cache';
|
|
21
24
|
import { globalMediaEventEmitter } from '../../globalMediaEventEmitter';
|
|
25
|
+
import { CommonMediaClientError } from '../../models/errors/CommonMediaClientError';
|
|
26
|
+
import { fromCommonMediaClientError } from '../../models/errors/fromCommonMediaClientError';
|
|
27
|
+
import { isCommonMediaClientError } from '../../models/errors/isCommonMediaClientError';
|
|
22
28
|
import { isErrorFileState } from '../../models/is-error-file-state';
|
|
23
29
|
import { isFinalFileState } from '../../models/is-final-file-state';
|
|
24
30
|
import { isNotFoundMediaItemDetails } from '../../models/is-not-found-media-item-details';
|
|
@@ -27,25 +33,20 @@ import { mapMediaFileToFileState } from '../../models/map-media-file-to-file-sta
|
|
|
27
33
|
import { mapMediaItemToFileState } from '../../models/map-media-item-to-file-state';
|
|
28
34
|
import { uploadFile } from '../../uploader';
|
|
29
35
|
import { convertBase64ToBlob } from '../../utils/convertBase64ToBlob';
|
|
36
|
+
import { createCopyIntentRegisterationBatcher } from '../../utils/createCopyIntentRegisterationBatcher';
|
|
30
37
|
import { createFileDataloader } from '../../utils/createFileDataloader-2';
|
|
31
38
|
import { createMediaSubject } from '../../utils/createMediaSubject';
|
|
39
|
+
import { isEmptyFile } from '../../utils/detectEmptyFile';
|
|
32
40
|
import { getDimensionsFromBlob } from '../../utils/getDimensionsFromBlob';
|
|
33
41
|
import { getMediaTypeFromUploadableFile } from '../../utils/getMediaTypeFromUploadableFile';
|
|
34
42
|
import { fromObservable } from '../../utils/mediaSubscribable/fromObservable';
|
|
35
43
|
import { toPromise } from '../../utils/mediaSubscribable/toPromise';
|
|
36
44
|
import { overrideMediaTypeIfUnknown } from '../../utils/overrideMediaTypeIfUnknown';
|
|
37
|
-
import { MediaStore as MediaApi } from '../media-store/MediaStore';
|
|
38
|
-
import { FileFetcherError } from './FileFetcherError';
|
|
39
|
-
import { getMediaTypeFromMimeType } from '@atlaskit/media-common/mediaTypeUtils';
|
|
40
|
-
import { isEmptyFile } from '../../utils/detectEmptyFile';
|
|
41
45
|
import { PollingFunction } from '../../utils/polling';
|
|
42
|
-
import { shouldFetchRemoteFileStates } from '../../utils/shouldFetchRemoteFileStates';
|
|
43
|
-
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
44
|
-
import { createCopyIntentRegisterationBatcher } from '../../utils/createCopyIntentRegisterationBatcher';
|
|
45
|
-
import { CommonMediaClientError } from '../../models/errors/CommonMediaClientError';
|
|
46
|
-
import { fromCommonMediaClientError } from '../../models/errors/fromCommonMediaClientError';
|
|
47
|
-
import { isCommonMediaClientError } from '../../models/errors/isCommonMediaClientError';
|
|
48
46
|
import { defaultShouldRetryError } from '../../utils/request/defaultShouldRetryError';
|
|
47
|
+
import { shouldFetchRemoteFileStates } from '../../utils/shouldFetchRemoteFileStates';
|
|
48
|
+
import { MediaStore as MediaApi } from '../media-store/MediaStore';
|
|
49
|
+
import { FileFetcherError } from './FileFetcherError';
|
|
49
50
|
/**
|
|
50
51
|
* @deprecated Use `import { FileFetcherError } from '@atlaskit/media-client/file-fetcher/error'` instead.
|
|
51
52
|
*/
|
|
@@ -4,10 +4,10 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import { EventEmitter2 } from 'eventemitter2';
|
|
6
6
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
7
|
+
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
7
8
|
import { FileFetcherImpl } from './file-fetcher';
|
|
8
9
|
import { MediaStore as MediaApi } from './media-store/MediaStore';
|
|
9
10
|
import { StargateClient } from './stargate-client';
|
|
10
|
-
import { mediaStore } from '@atlaskit/media-state/media-store';
|
|
11
11
|
export var MediaClient = /*#__PURE__*/function () {
|
|
12
12
|
// mobile upload is lazily loaded
|
|
13
13
|
|
|
@@ -7,8 +7,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
9
9
|
|
|
10
|
-
import { isClientBasedAuth } from '@atlaskit/media-core/is-client-based-auth';
|
|
11
10
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
11
|
+
import { isClientBasedAuth } from '@atlaskit/media-core/is-client-based-auth';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
13
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
14
|
import { FILE_CACHE_MAX_AGE } from '../../constants';
|
package/dist/esm/media-core.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated Use `import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm'` instead.
|
|
4
4
|
*/
|
|
5
|
+
|
|
5
6
|
export { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated Use `import type { MediaClientConfig } from '@atlaskit/media-core/auth'` instead.
|
|
@@ -5,8 +5,8 @@ import { concatMap } from 'rxjs/operators/concatMap';
|
|
|
5
5
|
import { chunkinator } from '@atlaskit/chunkinator/chunkinator';
|
|
6
6
|
import { CHUNK_SIZE, PROCESSING_BATCH_SIZE } from '../constants';
|
|
7
7
|
import { createHasher } from '../utils/hashing/hasherCreator';
|
|
8
|
-
import { UploaderError } from './UploaderError';
|
|
9
8
|
import { calculateChunkSize, fileSizeError } from './calculateChunkSize';
|
|
9
|
+
import { UploaderError } from './UploaderError';
|
|
10
10
|
|
|
11
11
|
// TODO: Allow to pass multiple files
|
|
12
12
|
|
|
@@ -6,6 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
9
|
+
|
|
9
10
|
import { PollingError } from './PollingError';
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated Use `import { PollingError } from '@atlaskit/media-client/polling/errors'` instead.
|
|
@@ -3,8 +3,8 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
import { RequestError } from './RequestError';
|
|
7
6
|
import { extractMediaHeaders } from './extractMediaHeaders';
|
|
7
|
+
import { RequestError } from './RequestError';
|
|
8
8
|
export function createMapResponseToBlob(metadata) {
|
|
9
9
|
return /*#__PURE__*/function () {
|
|
10
10
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
@@ -3,8 +3,8 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
import { RequestError } from './RequestError';
|
|
7
6
|
import { extractMediaHeaders } from './extractMediaHeaders';
|
|
7
|
+
import { RequestError } from './RequestError';
|
|
8
8
|
export function createMapResponseToJson(metadata) {
|
|
9
9
|
return /*#__PURE__*/function () {
|
|
10
10
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { RequestError } from './RequestError';
|
|
5
4
|
import { createRequestErrorReason } from './createRequestErrorReason';
|
|
6
5
|
import { extractMediaHeaders } from './extractMediaHeaders';
|
|
6
|
+
import { RequestError } from './RequestError';
|
|
7
7
|
export function createRequestErrorFromResponse(metadata, response) {
|
|
8
8
|
var statusCode = response.status;
|
|
9
9
|
var reason = createRequestErrorReason(statusCode);
|
|
@@ -3,12 +3,12 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
import { RequestError } from './RequestError';
|
|
7
6
|
import { cloneRequestError } from './cloneRequestError';
|
|
8
7
|
import { defaultShouldRetryError } from './defaultShouldRetryError';
|
|
9
8
|
import { DEFAULT_RETRY_OPTIONS } from './helpers';
|
|
10
9
|
import { isAbortedRequestError } from './isAbortedRequestError';
|
|
11
10
|
import { isRequestError } from './isRequestError';
|
|
11
|
+
import { RequestError } from './RequestError';
|
|
12
12
|
import { waitPromise } from './waitPromise';
|
|
13
13
|
export function fetchRetry(_x, _x2) {
|
|
14
14
|
return _fetchRetry.apply(this, arguments);
|
|
@@ -21,15 +21,15 @@ export { createRequestErrorReason } from './createRequestErrorReason';
|
|
|
21
21
|
* @deprecated Use `import { isRateLimitedError } from '@atlaskit/media-client/request/helpers'` instead.
|
|
22
22
|
*/
|
|
23
23
|
export { isRateLimitedError } from './isRateLimitedError';
|
|
24
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
25
|
+
import getNavigator from '../getNavigator';
|
|
26
|
+
import { mapRetryUrlToPathBasedUrl } from '../mapRetryUrlToPathBasedUrl';
|
|
24
27
|
import { createProcessFetchResponse } from './createProcessFetchResponse';
|
|
25
28
|
import { createUrl } from './createUrl';
|
|
26
29
|
import { defaultShouldRetryError } from './defaultShouldRetryError';
|
|
27
30
|
import { extendHeaders } from './extendHeaders';
|
|
28
31
|
import { fetchRetry } from './fetchRetry';
|
|
29
32
|
import { isFetchNetworkError } from './isFetchNetworkError';
|
|
30
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
31
|
-
import getNavigator from '../getNavigator';
|
|
32
|
-
import { mapRetryUrlToPathBasedUrl } from '../mapRetryUrlToPathBasedUrl';
|
|
33
33
|
export function request(_x) {
|
|
34
34
|
return _request.apply(this, arguments);
|
|
35
35
|
}
|
package/dist/esm/utils/url.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
|
|
2
3
|
export var mediaBlobUrlIdentifier = 'media-blob-url';
|
|
3
4
|
/**
|
|
4
5
|
* @deprecated Use `import { isMediaBlobUrl } from '@atlaskit/media-client'` instead.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FileState } from '@atlaskit/media-state/file-state';
|
|
2
1
|
import type { AuthContext } from '@atlaskit/media-core/auth';
|
|
2
|
+
import type { FileState } from '@atlaskit/media-state/file-state';
|
|
3
3
|
export type EventPayloadMap<P> = {
|
|
4
4
|
readonly [event: string]: P;
|
|
5
5
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { AuthProvider } from '@atlaskit/media-core/auth';
|
|
2
1
|
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
2
|
+
import type { AuthProvider } from '@atlaskit/media-core/auth';
|
|
3
3
|
import type { MediaFileArtifacts } from '@atlaskit/media-state/file-state';
|
|
4
|
+
import type { FilePreview, FileState } from '@atlaskit/media-state/file-state';
|
|
5
|
+
import { type MediaStore } from '@atlaskit/media-state/media-store';
|
|
4
6
|
import type { GetFileOptions } from '../../models/file-state';
|
|
5
7
|
import type { MediaItemDetails, MediaFile } from '../../models/media';
|
|
6
8
|
import { type UploadController } from '../../upload-controller';
|
|
@@ -9,8 +11,6 @@ import { type Dimensions } from '../../utils/getDimensionsFromBlob';
|
|
|
9
11
|
import type { MediaSubscribable } from '../../utils/mediaSubscribable/types';
|
|
10
12
|
import { MediaStore as MediaApi } from '../media-store/MediaStore';
|
|
11
13
|
import type { MediaStoreCopyFileWithTokenParams, TouchedFiles, TouchFileDescriptor } from '../media-store/types';
|
|
12
|
-
import type { FilePreview, FileState } from '@atlaskit/media-state/file-state';
|
|
13
|
-
import { type MediaStore } from '@atlaskit/media-state/media-store';
|
|
14
14
|
import { type UploadArtifactParams } from '../media-store/types';
|
|
15
15
|
export type { FileFetcherErrorAttributes, FileFetcherErrorReason } from './FileFetcherError';
|
|
16
16
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
2
1
|
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
2
|
+
import type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
3
|
+
import { type MediaStore } from '@atlaskit/media-state/media-store';
|
|
3
4
|
import { type MobileUpload } from '../models/mobile-upload';
|
|
4
5
|
import { type UploadEventPayloadMap, type EventPayloadListener } from './events';
|
|
5
6
|
import { type FileFetcher } from './file-fetcher';
|
|
6
7
|
import { MediaStore as MediaApi } from './media-store/MediaStore';
|
|
7
8
|
import type { MediaStoreGetFileImageParams, ImageMetadata } from './media-store/types';
|
|
8
9
|
import { StargateClient } from './stargate-client';
|
|
9
|
-
import { type MediaStore } from '@atlaskit/media-state/media-store';
|
|
10
10
|
export declare class MediaClient {
|
|
11
11
|
readonly mediaClientConfig: MediaClientConfig;
|
|
12
12
|
private readonly store;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Auth, AsapBasedAuth, AuthContext, ClientAltBasedAuth } from '@atlaskit/media-core/auth';
|
|
2
1
|
import { type SSR, type MediaTraceContext } from '@atlaskit/media-common';
|
|
2
|
+
import type { Auth, AsapBasedAuth, AuthContext, ClientAltBasedAuth } from '@atlaskit/media-core/auth';
|
|
3
|
+
import type { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
3
4
|
import type { MediaFileArtifacts } from '@atlaskit/media-state/file-state';
|
|
5
|
+
import { type DocumentPageRangeContent, type GetDocumentPageImage, type GetDocumentContentOptions } from '../../models/document';
|
|
4
6
|
import { type MediaItemDetails, type MediaFile, type MediaUpload } from '../../models/media';
|
|
5
7
|
import { type ClientOptions, type RequestHeaders, type RequestMethod, type RequestParams, type RequestMetadata } from '../../utils/request/types';
|
|
6
|
-
import type { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
7
|
-
import { type DocumentPageRangeContent, type GetDocumentPageImage, type GetDocumentContentOptions } from '../../models/document';
|
|
8
8
|
export interface ResponseFileItem {
|
|
9
9
|
id: string;
|
|
10
10
|
type: 'file';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Dataloader from 'dataloader';
|
|
2
|
+
import type { Auth } from '@atlaskit/media-core/auth';
|
|
2
3
|
import type { MediaStore } from '../client/media-store/MediaStore';
|
|
3
4
|
import { type NotFoundMediaItemDetails, type MediaItemDetails } from '../models/media';
|
|
4
|
-
import type { Auth } from '@atlaskit/media-core/auth';
|
|
5
5
|
export declare const MAX_BATCH_SIZE = 100;
|
|
6
6
|
export type CopyIntentKey = {
|
|
7
7
|
readonly id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Hasher } from './hasher';
|
|
2
1
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
2
|
+
import { type Hasher } from './hasher';
|
|
3
3
|
export declare const destroyHashers: () => void;
|
|
4
4
|
export declare const createHasher: (algorithm: ChunkHashAlgorithm) => Promise<Hasher>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Subscription } from 'rxjs/Subscription';
|
|
2
|
-
import { type MediaSubscribable } from './types';
|
|
3
2
|
import type { FileState } from '@atlaskit/media-state/file-state';
|
|
3
|
+
import { type MediaSubscribable } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* This is a helper to transform the first value emitted by an MediaSubscribable into a Promise.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Auth } from '@atlaskit/media-core/auth';
|
|
2
1
|
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
2
|
+
import type { Auth } from '@atlaskit/media-core/auth';
|
|
3
3
|
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD';
|
|
4
4
|
export type RequestParams = {
|
|
5
5
|
[key: string]: any;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { token } from '@atlaskit/tokens';
|
|
2
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
2
|
import { css, type SerializedStyles } from '@emotion/react';
|
|
3
|
+
|
|
4
|
+
import { token } from '@atlaskit/tokens';
|
|
5
|
+
|
|
4
6
|
import { type FileStatus } from '../src';
|
|
5
7
|
|
|
6
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "38.1.
|
|
3
|
+
"version": "38.1.19",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@atlaskit/media-common": "^14.6.0",
|
|
27
27
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
28
28
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
29
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
29
|
+
"@atlaskit/tmp-editor-statsig": "^201.0.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0",
|
|
31
31
|
"dataloader": "^2.1.0",
|
|
32
32
|
"deep-equal": "^1.0.1",
|
|
@@ -48,10 +48,11 @@
|
|
|
48
48
|
"@atlaskit/media-core": "^38.2.0",
|
|
49
49
|
"@atlaskit/media-state": "^3.2.0",
|
|
50
50
|
"@atlaskit/ssr": "workspace:^",
|
|
51
|
-
"@atlaskit/tokens": "^18.
|
|
51
|
+
"@atlaskit/tokens": "^18.2.0",
|
|
52
52
|
"@atlassian/a11y-jest-testing": "^0.17.0",
|
|
53
53
|
"@atlassian/experiment-test-utils": "^0.2.0",
|
|
54
54
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
55
|
+
"@atlassian/workbench": "workspace:^",
|
|
55
56
|
"@emotion/react": "^11.7.1",
|
|
56
57
|
"@types/deep-equal": "^1.0.1",
|
|
57
58
|
"fetch-mock": "^8.0.0",
|