@atlaskit/media-client 35.4.0 → 35.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/media-client
2
2
 
3
+ ## 35.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`3d3db676b30c1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d3db676b30c1) -
8
+ Add support for path based routing for artifact urls
9
+
3
10
  ## 35.4.0
4
11
 
5
12
  ### Minor Changes
@@ -512,6 +512,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
512
512
  artifactUrl,
513
513
  auth,
514
514
  options,
515
+ url,
515
516
  _args0 = arguments;
516
517
  return _regenerator.default.wrap(function _callee0$(_context0) {
517
518
  while (1) switch (_context0.prev = _context0.next) {
@@ -549,8 +550,15 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
549
550
  },
550
551
  auth: auth
551
552
  };
552
- return _context0.abrupt("return", (0, _helpers.createUrl)((0, _mediaCdn.mapToMediaCdnUrl)(artifactUrl, auth.token), options));
553
- case 9:
553
+ url = (0, _helpers.createUrl)((0, _mediaCdn.mapToMediaCdnUrl)(artifactUrl, auth.token), options);
554
+ if (!(0, _platformFeatureFlags.fg)('platform_media_path_based_route')) {
555
+ _context0.next = 11;
556
+ break;
557
+ }
558
+ return _context0.abrupt("return", (0, _pathBasedUrl.mapToPathBasedUrl)(url));
559
+ case 11:
560
+ return _context0.abrupt("return", url);
561
+ case 12:
554
562
  case "end":
555
563
  return _context0.stop();
556
564
  }
@@ -339,7 +339,11 @@ export class MediaStore {
339
339
  },
340
340
  auth
341
341
  };
342
- return createUrl(mapToMediaCdnUrl(artifactUrl, auth.token), options);
342
+ const url = createUrl(mapToMediaCdnUrl(artifactUrl, auth.token), options);
343
+ if (fg('platform_media_path_based_route')) {
344
+ return mapToPathBasedUrl(url);
345
+ }
346
+ return url;
343
347
  }
344
348
  async getImage(id, params, controller, fetchMaxRes, traceContext) {
345
349
  // TODO add checkWebpSupport() back https://product-fabric.atlassian.net/browse/MPT-584
@@ -506,6 +506,7 @@ export var MediaStore = /*#__PURE__*/function () {
506
506
  artifactUrl,
507
507
  auth,
508
508
  options,
509
+ url,
509
510
  _args0 = arguments;
510
511
  return _regeneratorRuntime.wrap(function _callee0$(_context0) {
511
512
  while (1) switch (_context0.prev = _context0.next) {
@@ -543,8 +544,15 @@ export var MediaStore = /*#__PURE__*/function () {
543
544
  },
544
545
  auth: auth
545
546
  };
546
- return _context0.abrupt("return", createUrl(mapToMediaCdnUrl(artifactUrl, auth.token), options));
547
- case 9:
547
+ url = createUrl(mapToMediaCdnUrl(artifactUrl, auth.token), options);
548
+ if (!fg('platform_media_path_based_route')) {
549
+ _context0.next = 11;
550
+ break;
551
+ }
552
+ return _context0.abrupt("return", mapToPathBasedUrl(url));
553
+ case 11:
554
+ return _context0.abrupt("return", url);
555
+ case 12:
548
556
  case "end":
549
557
  return _context0.stop();
550
558
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-client",
3
- "version": "35.4.0",
3
+ "version": "35.5.0",
4
4
  "description": "Media API Web Client Library",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"