@atlaskit/media-client 37.4.1 → 37.5.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/client/media-client.js +2 -2
  3. package/dist/cjs/client/media-store/MediaStore.js +8 -7
  4. package/dist/cjs/client/media-store/resolveAuth.js +4 -4
  5. package/dist/cjs/file-streams-cache.js +1 -1
  6. package/dist/cjs/globalMediaEventEmitter.js +7 -7
  7. package/dist/cjs/utils/hashing/hasherCreator.js +2 -2
  8. package/dist/cjs/utils/hashing/sha256SimpleHasher.js +2 -2
  9. package/dist/cjs/utils/hashing/simpleHasher.js +2 -2
  10. package/dist/cjs/utils/request/index.js +2 -2
  11. package/dist/es2019/client/media-client.js +1 -1
  12. package/dist/es2019/client/media-store/MediaStore.js +2 -2
  13. package/dist/es2019/client/media-store/resolveAuth.js +1 -1
  14. package/dist/es2019/file-streams-cache.js +1 -1
  15. package/dist/es2019/globalMediaEventEmitter.js +1 -1
  16. package/dist/es2019/utils/hashing/hasherCreator.js +1 -1
  17. package/dist/es2019/utils/hashing/sha256SimpleHasher.js +1 -1
  18. package/dist/es2019/utils/hashing/simpleHasher.js +1 -1
  19. package/dist/es2019/utils/request/index.js +1 -1
  20. package/dist/esm/client/media-client.js +1 -1
  21. package/dist/esm/client/media-store/MediaStore.js +2 -2
  22. package/dist/esm/client/media-store/resolveAuth.js +1 -1
  23. package/dist/esm/file-streams-cache.js +1 -1
  24. package/dist/esm/globalMediaEventEmitter.js +1 -1
  25. package/dist/esm/utils/hashing/hasherCreator.js +1 -1
  26. package/dist/esm/utils/hashing/sha256SimpleHasher.js +1 -1
  27. package/dist/esm/utils/hashing/simpleHasher.js +1 -1
  28. package/dist/esm/utils/request/index.js +1 -1
  29. package/dist/types/client/__mocks__/media-client.d.ts +1 -1
  30. package/dist/types/client/events.d.ts +1 -1
  31. package/dist/types/client/file-fetcher/index.d.ts +1 -1
  32. package/dist/types/client/media-client.d.ts +1 -1
  33. package/dist/types/client/media-store/MediaStore.d.ts +2 -2
  34. package/dist/types/client/media-store/resolveAuth.d.ts +1 -1
  35. package/dist/types/client/media-store/types.d.ts +2 -2
  36. package/dist/types/models/auth-headers.d.ts +1 -1
  37. package/dist/types/models/auth-query-parameters.d.ts +1 -1
  38. package/dist/types/utils/createCopyIntentRegisterationBatcher.d.ts +1 -1
  39. package/dist/types/utils/hashing/hasherCreator.d.ts +1 -1
  40. package/dist/types/utils/request/types.d.ts +1 -1
  41. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/media-client
2
2
 
3
+ ## 37.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d82e6f76528ab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d82e6f76528ab) -
8
+ Add direct subpath package exports as part of the linking-platform, search, media, and
9
+ design-system barrel-removal (de-barrel) migration.
10
+
11
+ These packages now expose their individual modules via explicit `package.json` `exports` subpaths
12
+ so that consumers can import directly from the leaf module (e.g. `@atlaskit/pkg/thing`) instead of
13
+ the package barrel/index. This adds new public entry points without changing or removing any
14
+ existing exports, so it is a backwards-compatible additive change.
15
+
16
+ No runtime behaviour changes; this is an API-surface (entry-point) addition to support
17
+ tree-shaking and to unblock removal of the barrel index files.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 37.4.1
4
24
 
5
25
  ### Patch Changes
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
11
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
12
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
13
  var _eventemitter = require("eventemitter2");
14
- var _mediaCore = require("@atlaskit/media-core");
14
+ var _chunkHashAlgorithm = require("@atlaskit/media-core/chunk-hash-algorithm");
15
15
  var _fileFetcher = require("./file-fetcher");
16
16
  var _MediaStore = require("./media-store/MediaStore");
17
17
  var _stargateClient = require("./stargate-client");
@@ -31,7 +31,7 @@ var MediaClient = exports.MediaClient = /*#__PURE__*/function () {
31
31
  this.mediaStore = mediaApi !== null && mediaApi !== void 0 ? mediaApi : new _MediaStore.MediaStore({
32
32
  authProvider: mediaClientConfig.authProvider,
33
33
  initialAuth: mediaClientConfig.initialAuth,
34
- chunkHashAlgorithm: _mediaCore.ChunkHashAlgorithm.Sha256,
34
+ chunkHashAlgorithm: _chunkHashAlgorithm.ChunkHashAlgorithm.Sha256,
35
35
  authProviderTimeout: mediaClientConfig.authProviderTimeoutMs
36
36
  });
37
37
  this.config = mediaClientConfig;
@@ -29,7 +29,8 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
29
29
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
30
30
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
31
31
  var _mediaCore = require("@atlaskit/media-core");
32
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
32
+ var _chunkHashAlgorithm = require("@atlaskit/media-core/chunk-hash-algorithm");
33
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
33
34
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
34
35
  var _constants = require("../../constants");
35
36
  var _artifacts = require("../../models/artifacts");
@@ -179,7 +180,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
179
180
  return (0, _resolveInitialAuth.resolveInitialAuth)(_this.config.initialAuth);
180
181
  });
181
182
  this.config = config;
182
- this._chunkHashAlgorithm = config.chunkHashAlgorithm || _mediaCore.ChunkHashAlgorithm.Sha256;
183
+ this._chunkHashAlgorithm = config.chunkHashAlgorithm || _chunkHashAlgorithm.ChunkHashAlgorithm.Sha256;
183
184
  }
184
185
  return (0, _createClass2.default)(MediaStore, [{
185
186
  key: "getClientId",
@@ -336,7 +337,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
336
337
  endpoint: '/file/upload'
337
338
  };
338
339
  var headers = _objectSpread({}, _jsonHeaders.jsonHeaders);
339
- if ((options === null || options === void 0 ? void 0 : options.expectedFileSize) !== undefined && (0, _platformFeatureFlags.fg)('platform_media_upload_expected_size_header')) {
340
+ if ((options === null || options === void 0 ? void 0 : options.expectedFileSize) !== undefined && (0, _fg.fg)('platform_media_upload_expected_size_header')) {
340
341
  headers['x-expected-size'] = options.expectedFileSize.toString();
341
342
  }
342
343
  var requestOptions = _objectSpread(_objectSpread({}, metadata), {}, {
@@ -386,7 +387,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
386
387
  endpoint: '/upload/createWithFiles'
387
388
  };
388
389
  headers = _objectSpread({}, _jsonHeaders.jsonHeaders);
389
- if ((options === null || options === void 0 ? void 0 : options.expectedFileSize) !== undefined && (0, _platformFeatureFlags.fg)('platform_media_upload_expected_size_header')) {
390
+ if ((options === null || options === void 0 ? void 0 : options.expectedFileSize) !== undefined && (0, _fg.fg)('platform_media_upload_expected_size_header')) {
390
391
  headers['x-expected-size'] = options.expectedFileSize.toString();
391
392
  }
392
393
  requestOptions = _objectSpread(_objectSpread({}, metadata), {}, {
@@ -466,7 +467,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
466
467
  }, {
467
468
  key: "createFileImageURL",
468
469
  value: function createFileImageURL(id, auth, params) {
469
- var wmv = (0, _platformFeatureFlags.fg)('confluence_watermark_admin_ui') ? (0, _watermarkVersion.getWatermarkVersionFromToken)(auth.token) : undefined;
470
+ var wmv = (0, _fg.fg)('confluence_watermark_admin_ui') ? (0, _watermarkVersion.getWatermarkVersionFromToken)(auth.token) : undefined;
470
471
  var options = {
471
472
  params: _objectSpread(_objectSpread({}, (0, _extendImageParams.extendImageParams)(params)), wmv ? {
472
473
  wmv: wmv
@@ -661,7 +662,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
661
662
  collectionName: params && params.collection
662
663
  }
663
664
  };
664
- if (!(0, _platformFeatureFlags.fg)('confluence_watermark_admin_ui')) {
665
+ if (!(0, _fg.fg)('confluence_watermark_admin_ui')) {
665
666
  _context10.next = 2;
666
667
  break;
667
668
  }
@@ -873,7 +874,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
873
874
  endpoint: '/upload/{uploadId}/chunks'
874
875
  };
875
876
  headers = _objectSpread({}, _jsonHeaders.jsonHeaders);
876
- if ((options === null || options === void 0 ? void 0 : options.expectedFileSize) !== undefined && (0, _platformFeatureFlags.fg)('platform_media_upload_expected_size_header')) {
877
+ if ((options === null || options === void 0 ? void 0 : options.expectedFileSize) !== undefined && (0, _fg.fg)('platform_media_upload_expected_size_header')) {
877
878
  headers['x-expected-size'] = options.expectedFileSize.toString();
878
879
  }
879
880
  requestOptions = _objectSpread(_objectSpread({}, metadata), {}, {
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.resolveAuth = exports.DEFAULT_AUTH_PROVIDER_TIMEOUT = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
11
11
  var _globalMediaEventEmitter = require("../../globalMediaEventEmitter");
12
12
  var _rejectTimeout = require("../../utils/rejectTimeout");
13
13
  var _MediaStoreError = require("./MediaStoreError");
@@ -27,7 +27,7 @@ var resolveAuth = exports.resolveAuth = /*#__PURE__*/function () {
27
27
  authProviderTimeout = _args.length > 2 && _args[2] !== undefined ? _args[2] : DEFAULT_AUTH_PROVIDER_TIMEOUT;
28
28
  startTime = performance.now();
29
29
  eventEmitted = false; // Feature flag: wrap authProvider with analytics event emission
30
- authProviderPromise = (0, _platformFeatureFlags.fg)('platform_media_auth_provider_analytics') ? authProvider(authContext).then(function (result) {
30
+ authProviderPromise = (0, _fg.fg)('platform_media_auth_provider_analytics') ? authProvider(authContext).then(function (result) {
31
31
  var durationMs = performance.now() - startTime;
32
32
  if (!eventEmitted) {
33
33
  eventEmitted = true;
@@ -69,7 +69,7 @@ var resolveAuth = exports.resolveAuth = /*#__PURE__*/function () {
69
69
  _context.prev = 3;
70
70
  _t = _context["catch"](1);
71
71
  // Mark as emitted so late arrivals are handled correctly by .then()/.catch()
72
- if (!eventEmitted && (0, _platformFeatureFlags.fg)('platform_media_auth_provider_analytics')) {
72
+ if (!eventEmitted && (0, _fg.fg)('platform_media_auth_provider_analytics')) {
73
73
  eventEmitted = true;
74
74
  }
75
75
  // PRESERVE ORIGINAL ERROR HANDLING
@@ -87,7 +87,7 @@ var resolveAuth = exports.resolveAuth = /*#__PURE__*/function () {
87
87
  }
88
88
  throw new _MediaStoreError.MediaStoreError('emptyAuth');
89
89
  case 6:
90
- if (!('clientId' in auth && !auth.clientId && (0, _platformFeatureFlags.fg)('platform_media_validate_client_id'))) {
90
+ if (!('clientId' in auth && !auth.clientId && (0, _fg.fg)('platform_media_validate_client_id'))) {
91
91
  _context.next = 7;
92
92
  break;
93
93
  }
@@ -57,7 +57,7 @@ var getFileStreamsCache = exports.getFileStreamsCache = function getFileStreamsC
57
57
  if (!streamCache) {
58
58
  // TODO: we can move this into a static import like
59
59
  // import {mediaState} from '@atlaskit/media-core'
60
- var mediaState = require('@atlaskit/media-core').mediaState;
60
+ var mediaState = require('@atlaskit/media-core/cache').mediaState;
61
61
  streamCache = new StreamsCache(mediaState.streams);
62
62
  }
63
63
  return streamCache;
@@ -4,21 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.globalMediaEventEmitter = void 0;
7
- var _mediaCore = require("@atlaskit/media-core");
7
+ var _cache = require("@atlaskit/media-core/cache");
8
8
  var globalMediaEventEmitter = exports.globalMediaEventEmitter = {
9
9
  on: function on(event, listener) {
10
- if (_mediaCore.mediaState.eventEmitter) {
11
- _mediaCore.mediaState.eventEmitter.on(event, listener);
10
+ if (_cache.mediaState.eventEmitter) {
11
+ _cache.mediaState.eventEmitter.on(event, listener);
12
12
  }
13
13
  },
14
14
  off: function off(event, listener) {
15
- if (_mediaCore.mediaState.eventEmitter) {
16
- _mediaCore.mediaState.eventEmitter.off(event, listener);
15
+ if (_cache.mediaState.eventEmitter) {
16
+ _cache.mediaState.eventEmitter.off(event, listener);
17
17
  }
18
18
  },
19
19
  emit: function emit(event, payload) {
20
- if (_mediaCore.mediaState.eventEmitter) {
21
- return _mediaCore.mediaState.eventEmitter.emit(event, payload);
20
+ if (_cache.mediaState.eventEmitter) {
21
+ return _cache.mediaState.eventEmitter.emit(event, payload);
22
22
  }
23
23
  return undefined;
24
24
  }
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.destroyHashers = exports.createHasher = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
- var _mediaCore = require("@atlaskit/media-core");
11
+ var _chunkHashAlgorithm = require("@atlaskit/media-core/chunk-hash-algorithm");
12
12
  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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
13
13
  var hasher = null;
14
14
  var sha256Hasher = null;
@@ -23,7 +23,7 @@ var createHasher = exports.createHasher = /*#__PURE__*/function () {
23
23
  while (1) switch (_context.prev = _context.next) {
24
24
  case 0:
25
25
  _context.prev = 0;
26
- if (!(algorithm === _mediaCore.ChunkHashAlgorithm.Sha256)) {
26
+ if (!(algorithm === _chunkHashAlgorithm.ChunkHashAlgorithm.Sha256)) {
27
27
  _context.next = 3;
28
28
  break;
29
29
  }
@@ -8,7 +8,7 @@ exports.SimpleHasher = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _jsSha = require("js-sha256");
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
12
12
  var _fileReaderError = require("./fileReaderError");
13
13
  var SimpleHasher = exports.SimpleHasher = /*#__PURE__*/function () {
14
14
  function SimpleHasher() {
@@ -25,7 +25,7 @@ var SimpleHasher = exports.SimpleHasher = /*#__PURE__*/function () {
25
25
  resolve("sha256-".concat(_jsSha.sha256.create().update((_reader$result = reader.result) !== null && _reader$result !== void 0 ? _reader$result : '').hex()));
26
26
  };
27
27
  reader.onerror = function (event) {
28
- if ((0, _platformFeatureFlags.fg)('platform_media_filereader_error_surfacing')) {
28
+ if ((0, _fg.fg)('platform_media_filereader_error_surfacing')) {
29
29
  reject((0, _fileReaderError.toFileReaderError)(reader.error));
30
30
  } else {
31
31
  reject(event);
@@ -9,7 +9,7 @@ exports.SimpleHasher = void 0;
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
11
  var Rusha = _interopRequireWildcard(require("rusha"));
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
13
13
  var _fileReaderError = require("./fileReaderError");
14
14
  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); }
15
15
  var SimpleHasher = exports.SimpleHasher = /*#__PURE__*/function () {
@@ -27,7 +27,7 @@ var SimpleHasher = exports.SimpleHasher = /*#__PURE__*/function () {
27
27
  resolve(Rusha.createHash().update((_reader$result = reader.result) !== null && _reader$result !== void 0 ? _reader$result : '').digest('hex'));
28
28
  };
29
29
  reader.onerror = function (event) {
30
- if ((0, _platformFeatureFlags.fg)('platform_media_filereader_error_surfacing')) {
30
+ if ((0, _fg.fg)('platform_media_filereader_error_surfacing')) {
31
31
  reject((0, _fileReaderError.toFileReaderError)(reader.error));
32
32
  } else {
33
33
  reject(event);
@@ -42,7 +42,7 @@ var _defaultShouldRetryError = require("./defaultShouldRetryError");
42
42
  var _extendHeaders = require("./extendHeaders");
43
43
  var _fetchRetry = require("./fetchRetry");
44
44
  var _isFetchNetworkError = require("./isFetchNetworkError");
45
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
45
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
46
46
  var _getNavigator3 = _interopRequireDefault(require("../getNavigator"));
47
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; }
@@ -102,7 +102,7 @@ function _request() {
102
102
  signal: controller && controller.signal
103
103
  }).then((0, _createProcessFetchResponse.createProcessFetchResponse)(metadata));
104
104
  };
105
- if (!(0, _platformFeatureFlags.fg)('platform_media_retry_edge_error')) {
105
+ if (!(0, _fg.fg)('platform_media_retry_edge_error')) {
106
106
  _context.next = 5;
107
107
  break;
108
108
  }
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter2 } from 'eventemitter2';
2
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
2
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
3
3
  import { FileFetcherImpl } from './file-fetcher';
4
4
  import { MediaStore as MediaApi } from './media-store/MediaStore';
5
5
  import { StargateClient } from './stargate-client';
@@ -2,8 +2,8 @@ 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
4
  import { isClientBasedAuth } from '@atlaskit/media-core';
5
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
6
- import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
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';
9
9
  import { getArtifactUrl } from '../../models/artifacts';
@@ -1,4 +1,4 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
1
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
2
  import { globalMediaEventEmitter } from '../../globalMediaEventEmitter';
3
3
  import { rejectTimeout } from '../../utils/rejectTimeout';
4
4
  import { MediaStoreError } from './MediaStoreError';
@@ -32,7 +32,7 @@ export const getFileStreamsCache = () => {
32
32
  if (!streamCache) {
33
33
  // TODO: we can move this into a static import like
34
34
  // import {mediaState} from '@atlaskit/media-core'
35
- const mediaState = require('@atlaskit/media-core').mediaState;
35
+ const mediaState = require('@atlaskit/media-core/cache').mediaState;
36
36
  streamCache = new StreamsCache(mediaState.streams);
37
37
  }
38
38
  return streamCache;
@@ -1,4 +1,4 @@
1
- import { mediaState } from '@atlaskit/media-core';
1
+ import { mediaState } from '@atlaskit/media-core/cache';
2
2
  export const globalMediaEventEmitter = {
3
3
  on(event, listener) {
4
4
  if (mediaState.eventEmitter) {
@@ -1,4 +1,4 @@
1
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
1
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
2
2
  let hasher = null;
3
3
  let sha256Hasher = null;
4
4
  export const destroyHashers = () => {
@@ -1,5 +1,5 @@
1
1
  import { sha256 } from 'js-sha256';
2
- import { fg } from '@atlaskit/platform-feature-flags';
2
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
3
  import { toFileReaderError } from './fileReaderError';
4
4
  export class SimpleHasher {
5
5
  hash(blob) {
@@ -1,5 +1,5 @@
1
1
  import * as Rusha from 'rusha';
2
- import { fg } from '@atlaskit/platform-feature-flags';
2
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
3
  import { toFileReaderError } from './fileReaderError';
4
4
  export class SimpleHasher {
5
5
  hash(blob) {
@@ -22,7 +22,7 @@ import { defaultShouldRetryError } from './defaultShouldRetryError';
22
22
  import { extendHeaders } from './extendHeaders';
23
23
  import { fetchRetry } from './fetchRetry';
24
24
  import { isFetchNetworkError } from './isFetchNetworkError';
25
- import { fg } from '@atlaskit/platform-feature-flags';
25
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
26
26
  import getNavigator from '../getNavigator';
27
27
  import { mapRetryUrlToPathBasedUrl } from '../mapRetryUrlToPathBasedUrl';
28
28
  export async function request(url, options = {}, controller) {
@@ -3,7 +3,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import { EventEmitter2 } from 'eventemitter2';
6
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
6
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
7
7
  import { FileFetcherImpl } from './file-fetcher';
8
8
  import { MediaStore as MediaApi } from './media-store/MediaStore';
9
9
  import { StargateClient } from './stargate-client';
@@ -8,8 +8,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
8
8
  /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
9
9
 
10
10
  import { isClientBasedAuth } from '@atlaskit/media-core';
11
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
12
- import { fg } from '@atlaskit/platform-feature-flags';
11
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
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';
15
15
  import { getArtifactUrl } from '../../models/artifacts';
@@ -1,6 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
4
4
  import { globalMediaEventEmitter } from '../../globalMediaEventEmitter';
5
5
  import { rejectTimeout } from '../../utils/rejectTimeout';
6
6
  import { MediaStoreError } from './MediaStoreError';
@@ -50,7 +50,7 @@ export var getFileStreamsCache = function getFileStreamsCache() {
50
50
  if (!streamCache) {
51
51
  // TODO: we can move this into a static import like
52
52
  // import {mediaState} from '@atlaskit/media-core'
53
- var mediaState = require('@atlaskit/media-core').mediaState;
53
+ var mediaState = require('@atlaskit/media-core/cache').mediaState;
54
54
  streamCache = new StreamsCache(mediaState.streams);
55
55
  }
56
56
  return streamCache;
@@ -1,4 +1,4 @@
1
- import { mediaState } from '@atlaskit/media-core';
1
+ import { mediaState } from '@atlaskit/media-core/cache';
2
2
  export var globalMediaEventEmitter = {
3
3
  on: function on(event, listener) {
4
4
  if (mediaState.eventEmitter) {
@@ -1,6 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
3
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
4
4
  var hasher = null;
5
5
  var sha256Hasher = null;
6
6
  export var destroyHashers = function destroyHashers() {
@@ -1,7 +1,7 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import { sha256 } from 'js-sha256';
4
- import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
5
5
  import { toFileReaderError } from './fileReaderError';
6
6
  export var SimpleHasher = /*#__PURE__*/function () {
7
7
  function SimpleHasher() {
@@ -1,7 +1,7 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import * as Rusha from 'rusha';
4
- import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
5
5
  import { toFileReaderError } from './fileReaderError';
6
6
  export var SimpleHasher = /*#__PURE__*/function () {
7
7
  function SimpleHasher() {
@@ -27,7 +27,7 @@ import { defaultShouldRetryError } from './defaultShouldRetryError';
27
27
  import { extendHeaders } from './extendHeaders';
28
28
  import { fetchRetry } from './fetchRetry';
29
29
  import { isFetchNetworkError } from './isFetchNetworkError';
30
- import { fg } from '@atlaskit/platform-feature-flags';
30
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
31
31
  import getNavigator from '../getNavigator';
32
32
  import { mapRetryUrlToPathBasedUrl } from '../mapRetryUrlToPathBasedUrl';
33
33
  export function request(_x) {
@@ -1,4 +1,4 @@
1
- import { type MediaClientConfig } from '@atlaskit/media-core';
1
+ import type { MediaClientConfig } from '@atlaskit/media-core/auth';
2
2
  import { type FileFetcher } from '../file-fetcher';
3
3
  export declare class MediaClient {
4
4
  readonly config: MediaClientConfig;
@@ -1,5 +1,5 @@
1
1
  import type { FileState } from '@atlaskit/media-state/file-state';
2
- import { type AuthContext } from '@atlaskit/media-core';
2
+ import type { AuthContext } from '@atlaskit/media-core/auth';
3
3
  export type EventPayloadMap<P> = {
4
4
  readonly [event: string]: P;
5
5
  };
@@ -1,4 +1,4 @@
1
- import { type AuthProvider } from '@atlaskit/media-core';
1
+ import type { AuthProvider } from '@atlaskit/media-core/auth';
2
2
  import { type MediaTraceContext } from '@atlaskit/media-common';
3
3
  import type { MediaFileArtifacts } from '@atlaskit/media-state/file-state';
4
4
  import type { GetFileOptions } from '../../models/file-state';
@@ -1,4 +1,4 @@
1
- import { type MediaClientConfig } from '@atlaskit/media-core';
1
+ import type { MediaClientConfig } from '@atlaskit/media-core/auth';
2
2
  import { type MediaTraceContext } from '@atlaskit/media-common';
3
3
  import { type MobileUpload } from '../models/mobile-upload';
4
4
  import { type UploadEventPayloadMap, type EventPayloadListener } from './events';
@@ -1,6 +1,6 @@
1
1
  import { type MediaTraceContext } from '@atlaskit/media-common';
2
- import { type AuthContext, type MediaApiConfig, type Auth } from '@atlaskit/media-core';
3
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
2
+ import type { AuthContext, MediaApiConfig, Auth } from '@atlaskit/media-core/auth';
3
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
4
4
  import type { MediaFileArtifacts } from '@atlaskit/media-state/file-state';
5
5
  import { type GetDocumentPageImage, type DocumentPageRangeContent, type GetDocumentContentOptions } from '../../models/document';
6
6
  import { type MediaFile, type MediaUpload } from '../../models/media';
@@ -1,3 +1,3 @@
1
- import { type Auth, type AuthContext, type AuthProvider } from '@atlaskit/media-core';
1
+ import type { Auth, AuthContext, AuthProvider } from '@atlaskit/media-core/auth';
2
2
  export declare const DEFAULT_AUTH_PROVIDER_TIMEOUT = 10000;
3
3
  export declare const resolveAuth: (authProvider: AuthProvider, authContext?: AuthContext, authProviderTimeout?: number) => Promise<Auth>;
@@ -1,9 +1,9 @@
1
- import { type Auth, type AsapBasedAuth, type AuthContext, type ClientAltBasedAuth } from '@atlaskit/media-core';
1
+ import type { Auth, AsapBasedAuth, AuthContext, ClientAltBasedAuth } from '@atlaskit/media-core/auth';
2
2
  import { type SSR, type MediaTraceContext } from '@atlaskit/media-common';
3
3
  import type { MediaFileArtifacts } from '@atlaskit/media-state/file-state';
4
4
  import { type MediaItemDetails, type MediaFile, type MediaUpload } from '../../models/media';
5
5
  import { type ClientOptions, type RequestHeaders, type RequestMethod, type RequestParams, type RequestMetadata } from '../../utils/request/types';
6
- import { type ChunkHashAlgorithm } from '@atlaskit/media-core';
6
+ import type { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
7
7
  import { type DocumentPageRangeContent, type GetDocumentPageImage, type GetDocumentContentOptions } from '../../models/document';
8
8
  export interface ResponseFileItem {
9
9
  id: string;
@@ -1,4 +1,4 @@
1
- import { type Auth } from '@atlaskit/media-core';
1
+ import type { Auth } from '@atlaskit/media-core/auth';
2
2
  export interface ClientBasedAuthHeaders {
3
3
  readonly 'X-Client-Id': string;
4
4
  readonly Authorization: string;
@@ -1,4 +1,4 @@
1
- import { type Auth } from '@atlaskit/media-core';
1
+ import type { Auth } from '@atlaskit/media-core/auth';
2
2
  export interface ClientBasedQueryParameters {
3
3
  readonly client: string;
4
4
  readonly token: string;
@@ -1,7 +1,7 @@
1
1
  import Dataloader from 'dataloader';
2
2
  import type { MediaStore } from '../client/media-store/MediaStore';
3
3
  import { type NotFoundMediaItemDetails, type MediaItemDetails } from '../models/media';
4
- import { type Auth } from '@atlaskit/media-core';
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
1
  import { type Hasher } from './hasher';
2
- import { ChunkHashAlgorithm } from '@atlaskit/media-core';
2
+ import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
3
3
  export declare const destroyHashers: () => void;
4
4
  export declare const createHasher: (algorithm: ChunkHashAlgorithm) => Promise<Hasher>;
@@ -1,4 +1,4 @@
1
- import { type Auth } from '@atlaskit/media-core';
1
+ import type { Auth } from '@atlaskit/media-core/auth';
2
2
  import type { MediaTraceContext } from '@atlaskit/media-common';
3
3
  export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD';
4
4
  export type RequestParams = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-client",
3
- "version": "37.4.1",
3
+ "version": "37.5.0",
4
4
  "description": "Media API Web Client Library",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,9 +23,9 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/atlassian-context": "^1.1.0",
25
25
  "@atlaskit/chunkinator": "^8.0.0",
26
- "@atlaskit/media-common": "^14.4.0",
26
+ "@atlaskit/media-common": "^14.5.0",
27
27
  "@atlaskit/platform-feature-flags": "^2.1.0",
28
- "@atlaskit/tmp-editor-statsig": "^156.0.0",
28
+ "@atlaskit/tmp-editor-statsig": "^157.0.0",
29
29
  "@babel/runtime": "^7.0.0",
30
30
  "dataloader": "^2.1.0",
31
31
  "deep-equal": "^1.0.1",
@@ -42,10 +42,11 @@
42
42
  "@atlaskit/media-state": "^3.1.0"
43
43
  },
44
44
  "devDependencies": {
45
+ "@atlaskit/button": "^25.2.0",
45
46
  "@atlaskit/media-core": "^38.0.0",
46
47
  "@atlaskit/media-state": "^3.1.0",
47
48
  "@atlaskit/ssr": "workspace:^",
48
- "@atlaskit/tokens": "^16.7.0",
49
+ "@atlaskit/tokens": "^16.8.0",
49
50
  "@atlassian/a11y-jest-testing": "^0.16.0",
50
51
  "@atlassian/feature-flags-test-utils": "^1.2.0",
51
52
  "@emotion/react": "^11.7.1",