@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.
@@ -514,7 +514,7 @@ if (typeof window !== 'undefined' && window && window.Web3) {
514
514
  var LibsWeb3 = Web3;
515
515
 
516
516
  var name = "@audius/sdk";
517
- var version = "1.0.6-beta.1";
517
+ var version = "1.0.6-beta.2";
518
518
  var audius = {
519
519
  releaseSHA: "e85874b984816113090067e11a5524462622f3cf"
520
520
  };
@@ -47249,6 +47249,7 @@ var File = /*#__PURE__*/function (_Base) {
47249
47249
  var callback,
47250
47250
  responseType,
47251
47251
  trackId,
47252
+ premiumContentHeaders,
47252
47253
  urls,
47253
47254
  _args2 = arguments;
47254
47255
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -47258,6 +47259,7 @@ var File = /*#__PURE__*/function (_Base) {
47258
47259
  callback = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
47259
47260
  responseType = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : 'blob';
47260
47261
  trackId = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : null;
47262
+ premiumContentHeaders = _args2.length > 5 && _args2[5] !== undefined ? _args2[5] : {};
47261
47263
  urls = [];
47262
47264
  creatorNodeGateways.forEach(function (gateway) {
47263
47265
  var gatewayWithCid = urlJoin(gateway, cid);
@@ -47268,10 +47270,10 @@ var File = /*#__PURE__*/function (_Base) {
47268
47270
  });
47269
47271
  urls.push(gatewayWithCid);
47270
47272
  });
47271
- _context2.next = 7;
47273
+ _context2.next = 8;
47272
47274
  return retry( /*#__PURE__*/function () {
47273
47275
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(bail) {
47274
- var _yield$raceRequests, response, errored, allUnauthorized, legacyUrls, _yield$raceRequests2, _response;
47276
+ var _yield$raceRequests, response, errored, allForbidden, legacyUrls, _yield$raceRequests2, _response;
47275
47277
 
47276
47278
  return regeneratorRuntime.wrap(function _callee$(_context) {
47277
47279
  while (1) {
@@ -47279,10 +47281,10 @@ var File = /*#__PURE__*/function (_Base) {
47279
47281
  case 0:
47280
47282
  _context.prev = 0;
47281
47283
  _context.next = 3;
47282
- return raceRequests(urls, callback, {
47284
+ return raceRequests(urls, callback, _objectSpread2({
47283
47285
  method: 'get',
47284
47286
  responseType: responseType
47285
- },
47287
+ }, premiumContentHeaders),
47286
47288
  /* timeout */
47287
47289
  null);
47288
47290
 
@@ -47296,18 +47298,18 @@ var File = /*#__PURE__*/function (_Base) {
47296
47298
  break;
47297
47299
  }
47298
47300
 
47299
- allUnauthorized = errored.every( // @ts-expect-error not valid axios error
47301
+ allForbidden = errored.every( // @ts-expect-error not valid axios error
47300
47302
  function (error) {
47301
47303
  return error.response.status === 403;
47302
47304
  });
47303
47305
 
47304
- if (!allUnauthorized) {
47306
+ if (!allForbidden) {
47305
47307
  _context.next = 11;
47306
47308
  break;
47307
47309
  }
47308
47310
 
47309
47311
  // In the case for a 403, do not retry fetching
47310
- bail(new Error('Unauthorized'));
47312
+ bail(new Error('Forbidden'));
47311
47313
  return _context.abrupt("return");
47312
47314
 
47313
47315
  case 11:
@@ -47338,7 +47340,8 @@ var File = /*#__PURE__*/function (_Base) {
47338
47340
  _context.next = 23;
47339
47341
  return raceRequests(legacyUrls, callback, {
47340
47342
  method: 'get',
47341
- responseType: responseType
47343
+ responseType: responseType // todo: Do we need to also set the premium content headers in this legacy flow?
47344
+
47342
47345
  },
47343
47346
  /* timeout */
47344
47347
  null);
@@ -47387,10 +47390,10 @@ var File = /*#__PURE__*/function (_Base) {
47387
47390
  }
47388
47391
  });
47389
47392
 
47390
- case 7:
47393
+ case 8:
47391
47394
  return _context2.abrupt("return", _context2.sent);
47392
47395
 
47393
- case 8:
47396
+ case 9:
47394
47397
  case "end":
47395
47398
  return _context2.stop();
47396
47399
  }