@audius/sdk 1.0.6-beta.1 → 1.0.6-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -33598,7 +33598,7 @@ var formatProviders = function formatProviders(providers) {
33598
33598
  };
33599
33599
 
33600
33600
  var name = "@audius/sdk";
33601
- var version = "1.0.6-beta.1";
33601
+ var version = "1.0.6-beta.2";
33602
33602
  var audius = {
33603
33603
  releaseSHA: "e85874b984816113090067e11a5524462622f3cf"
33604
33604
  };
@@ -57056,6 +57056,7 @@ var File = /*#__PURE__*/function (_Base) {
57056
57056
  var callback,
57057
57057
  responseType,
57058
57058
  trackId,
57059
+ premiumContentHeaders,
57059
57060
  urls,
57060
57061
  _args2 = arguments;
57061
57062
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -57065,6 +57066,7 @@ var File = /*#__PURE__*/function (_Base) {
57065
57066
  callback = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
57066
57067
  responseType = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : 'blob';
57067
57068
  trackId = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : null;
57069
+ premiumContentHeaders = _args2.length > 5 && _args2[5] !== undefined ? _args2[5] : {};
57068
57070
  urls = [];
57069
57071
  creatorNodeGateways.forEach(function (gateway) {
57070
57072
  var gatewayWithCid = urlJoin(gateway, cid);
@@ -57075,10 +57077,10 @@ var File = /*#__PURE__*/function (_Base) {
57075
57077
  });
57076
57078
  urls.push(gatewayWithCid);
57077
57079
  });
57078
- _context2.next = 7;
57080
+ _context2.next = 8;
57079
57081
  return retry( /*#__PURE__*/function () {
57080
57082
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(bail) {
57081
- var _yield$raceRequests, response, errored, allUnauthorized, legacyUrls, _yield$raceRequests2, _response;
57083
+ var _yield$raceRequests, response, errored, allForbidden, legacyUrls, _yield$raceRequests2, _response;
57082
57084
 
57083
57085
  return regeneratorRuntime.wrap(function _callee$(_context) {
57084
57086
  while (1) {
@@ -57086,10 +57088,10 @@ var File = /*#__PURE__*/function (_Base) {
57086
57088
  case 0:
57087
57089
  _context.prev = 0;
57088
57090
  _context.next = 3;
57089
- return raceRequests(urls, callback, {
57091
+ return raceRequests(urls, callback, _objectSpread2({
57090
57092
  method: 'get',
57091
57093
  responseType: responseType
57092
- },
57094
+ }, premiumContentHeaders),
57093
57095
  /* timeout */
57094
57096
  null);
57095
57097
 
@@ -57103,18 +57105,18 @@ var File = /*#__PURE__*/function (_Base) {
57103
57105
  break;
57104
57106
  }
57105
57107
 
57106
- allUnauthorized = errored.every( // @ts-expect-error not valid axios error
57108
+ allForbidden = errored.every( // @ts-expect-error not valid axios error
57107
57109
  function (error) {
57108
57110
  return error.response.status === 403;
57109
57111
  });
57110
57112
 
57111
- if (!allUnauthorized) {
57113
+ if (!allForbidden) {
57112
57114
  _context.next = 11;
57113
57115
  break;
57114
57116
  }
57115
57117
 
57116
57118
  // In the case for a 403, do not retry fetching
57117
- bail(new Error('Unauthorized'));
57119
+ bail(new Error('Forbidden'));
57118
57120
  return _context.abrupt("return");
57119
57121
 
57120
57122
  case 11:
@@ -57145,7 +57147,8 @@ var File = /*#__PURE__*/function (_Base) {
57145
57147
  _context.next = 23;
57146
57148
  return raceRequests(legacyUrls, callback, {
57147
57149
  method: 'get',
57148
- responseType: responseType
57150
+ responseType: responseType // todo: Do we need to also set the premium content headers in this legacy flow?
57151
+
57149
57152
  },
57150
57153
  /* timeout */
57151
57154
  null);
@@ -57194,10 +57197,10 @@ var File = /*#__PURE__*/function (_Base) {
57194
57197
  }
57195
57198
  });
57196
57199
 
57197
- case 7:
57200
+ case 8:
57198
57201
  return _context2.abrupt("return", _context2.sent);
57199
57202
 
57200
- case 8:
57203
+ case 9:
57201
57204
  case "end":
57202
57205
  return _context2.stop();
57203
57206
  }