@eluvio/elv-client-js 4.0.88 → 4.0.90

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 (58) hide show
  1. package/dist/ElvClient-min.js +15 -14
  2. package/dist/ElvClient-node-min.js +14 -13
  3. package/dist/ElvFrameClient-min.js +10 -10
  4. package/dist/ElvPermissionsClient-min.js +9 -9
  5. package/dist/ElvWalletClient-min.js +15 -14
  6. package/dist/ElvWalletClient-node-min.js +14 -13
  7. package/dist/src/AuthorizationClient.js +9 -12
  8. package/dist/src/ContentObjectAudit.js +3 -3
  9. package/dist/src/ContentObjectVerification.js +3 -3
  10. package/dist/src/Crypto.js +2 -2
  11. package/dist/src/ElvClient.js +47 -28
  12. package/dist/src/ElvWallet.js +7 -5
  13. package/dist/src/EthClient.js +8 -9
  14. package/dist/src/FrameClient.js +8 -9
  15. package/dist/src/HttpClient.js +27 -4
  16. package/dist/src/Id.js +1 -2
  17. package/dist/src/PermissionsClient.js +31 -19
  18. package/dist/src/RemoteSigner.js +6 -8
  19. package/dist/src/UserProfileClient.js +35 -19
  20. package/dist/src/Utils.js +62 -28
  21. package/dist/src/client/ABRPublishing.js +2 -2
  22. package/dist/src/client/AccessGroups.js +2 -2
  23. package/dist/src/client/ContentAccess.js +104 -104
  24. package/dist/src/client/ContentManagement.js +25 -23
  25. package/dist/src/client/Contracts.js +2 -2
  26. package/dist/src/client/Files.js +77 -88
  27. package/dist/src/client/LiveConf.js +3 -7
  28. package/dist/src/client/LiveStream.js +35 -36
  29. package/dist/src/client/NFT.js +2 -2
  30. package/dist/src/walletClient/ClientMethods.js +2 -2
  31. package/dist/src/walletClient/Profile.js +2 -2
  32. package/dist/src/walletClient/Utils.js +2 -2
  33. package/dist/src/walletClient/index.js +17 -14
  34. package/package.json +1 -1
  35. package/src/HttpClient.js +16 -2
  36. package/src/Utils.js +27 -5
  37. package/src/client/ContentAccess.js +85 -93
  38. package/src/client/ContentManagement.js +25 -11
  39. package/src/client/Files.js +43 -51
  40. package/src/client/LiveConf.js +0 -2
  41. package/src/client/LiveStream.js +7 -3
  42. package/testScripts/OfferingEnsureStrongDrm.js +2 -2
  43. package/testScripts/Test.js +3 -0
  44. package/testScripts/abr_profile_4k_both.json +18 -0
  45. package/testScripts/abr_profile_4k_drm.json +9 -0
  46. package/testScripts/abr_profile_4k_drm_public_access.json +18 -0
  47. package/testScripts/abr_profile_both.json +18 -0
  48. package/testScripts/abr_profile_drm.json +9 -0
  49. package/testScripts/abr_profile_drm_public_access.json +18 -0
  50. package/utilities/example_files/abr_profile_4k_both.json +18 -0
  51. package/utilities/example_files/abr_profile_4k_drm.json +9 -0
  52. package/utilities/example_files/abr_profile_4k_drm_public_access.json +18 -0
  53. package/utilities/example_files/abr_profile_4k_drm_strict.json +9 -0
  54. package/utilities/example_files/abr_profile_both.json +18 -0
  55. package/utilities/example_files/abr_profile_drm.json +9 -0
  56. package/utilities/example_files/abr_profile_drm_hls_only.json +9 -0
  57. package/utilities/example_files/abr_profile_drm_public_access.json +18 -0
  58. package/utilities/example_files/simple_ingest_library_metadata.json +9 -0
package/dist/src/Utils.js CHANGED
@@ -3,8 +3,8 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
3
3
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
4
4
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
5
5
  var _slicedToArray = require("@babel/runtime/helpers/slicedToArray");
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
+ 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
  if (typeof globalThis.Buffer === "undefined") {
9
9
  globalThis.Buffer = require("buffer/").Buffer;
10
10
  }
@@ -281,7 +281,6 @@ var Utils = {
281
281
  flags: flags // flags for part write token (tqp_)
282
282
  };
283
283
  },
284
-
285
284
  /**
286
285
  * Convert contract address to multiformat hash
287
286
  *
@@ -570,13 +569,29 @@ var Utils = {
570
569
  }
571
570
  return LimitedMap;
572
571
  }(),
572
+ /**
573
+ * Interprets an http response body obtained from an http call as JSON and returns result of parsing it.
574
+ *
575
+ * @param {Promise} response - An http response from node-fetch
576
+ * @param {boolean=} debug - Whether or not to log the body
577
+ * @param {Function} logFn - Log function to use if debug is truthy
578
+ * @return {*} - Result of parsing response body as JSON
579
+ */
573
580
  ResponseToJson: function () {
574
581
  var _ResponseToJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(response) {
582
+ var debug,
583
+ logFn,
584
+ _args4 = arguments;
575
585
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
576
586
  while (1) switch (_context4.prev = _context4.next) {
577
587
  case 0:
578
- return _context4.abrupt("return", Utils.ResponseToFormat("json", response));
579
- case 1:
588
+ debug = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : false;
589
+ logFn = _args4.length > 2 ? _args4[2] : undefined;
590
+ _context4.next = 4;
591
+ return Utils.ResponseToFormat("json", response, debug, logFn);
592
+ case 4:
593
+ return _context4.abrupt("return", _context4.sent);
594
+ case 5:
580
595
  case "end":
581
596
  return _context4.stop();
582
597
  }
@@ -587,51 +602,70 @@ var Utils = {
587
602
  }
588
603
  return ResponseToJson;
589
604
  }(),
605
+ /**
606
+ * Interprets an http response body obtained from an http call as a requested format and returns result of converting/formatting.
607
+ *
608
+ * @param {string} format - The format to use when interpreting response body (e.g. "json", "text" et. al.)
609
+ * @param {Promise} response - An http response from node-fetch
610
+ * @param {boolean=} debug - Whether or not to log a debug statement containing the body (ignored for formats other than "json" and "text")
611
+ * @param {Function} logFn - Log function to use if debug is truthy
612
+ * @return {*} - Result of converting response body into the requested format
613
+ */
590
614
  ResponseToFormat: function () {
591
615
  var _ResponseToFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(format, response) {
616
+ var debug,
617
+ logFn,
618
+ formattedBody,
619
+ _args5 = arguments;
592
620
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
593
621
  while (1) switch (_context5.prev = _context5.next) {
594
622
  case 0:
595
- _context5.next = 2;
623
+ debug = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
624
+ logFn = _args5.length > 3 ? _args5[3] : undefined;
625
+ _context5.next = 4;
596
626
  return response;
597
- case 2:
627
+ case 4:
598
628
  response = _context5.sent;
599
629
  _context5.t0 = format.toLowerCase();
600
- _context5.next = _context5.t0 === "json" ? 6 : _context5.t0 === "text" ? 9 : _context5.t0 === "blob" ? 12 : _context5.t0 === "arraybuffer" ? 15 : _context5.t0 === "formdata" ? 18 : _context5.t0 === "buffer" ? 21 : 24;
630
+ _context5.next = _context5.t0 === "json" ? 8 : _context5.t0 === "text" ? 13 : _context5.t0 === "blob" ? 18 : _context5.t0 === "arraybuffer" ? 21 : _context5.t0 === "formdata" ? 24 : _context5.t0 === "buffer" ? 27 : 30;
601
631
  break;
602
- case 6:
603
- _context5.next = 8;
604
- return response.json();
605
632
  case 8:
606
- return _context5.abrupt("return", _context5.sent);
607
- case 9:
608
- _context5.next = 11;
633
+ _context5.next = 10;
634
+ return response.json();
635
+ case 10:
636
+ formattedBody = _context5.sent;
637
+ if (debug) logFn("response body: ".concat(JSON.stringify(formattedBody, null, 2)));
638
+ return _context5.abrupt("return", formattedBody);
639
+ case 13:
640
+ _context5.next = 15;
609
641
  return response.text();
610
- case 11:
611
- return _context5.abrupt("return", _context5.sent);
612
- case 12:
613
- _context5.next = 14;
614
- return response.blob();
615
- case 14:
616
- return _context5.abrupt("return", _context5.sent);
617
642
  case 15:
618
- _context5.next = 17;
619
- return response.arrayBuffer();
620
- case 17:
621
- return _context5.abrupt("return", _context5.sent);
643
+ formattedBody = _context5.sent;
644
+ if (debug) logFn("response body: ".concat(formattedBody));
645
+ return _context5.abrupt("return", formattedBody);
622
646
  case 18:
623
647
  _context5.next = 20;
624
- return response.formData();
648
+ return response.blob();
625
649
  case 20:
626
650
  return _context5.abrupt("return", _context5.sent);
627
651
  case 21:
628
652
  _context5.next = 23;
629
- return response.buffer();
653
+ return response.arrayBuffer();
630
654
  case 23:
631
655
  return _context5.abrupt("return", _context5.sent);
632
656
  case 24:
657
+ _context5.next = 26;
658
+ return response.formData();
659
+ case 26:
660
+ return _context5.abrupt("return", _context5.sent);
661
+ case 27:
662
+ _context5.next = 29;
663
+ return response.buffer();
664
+ case 29:
665
+ return _context5.abrupt("return", _context5.sent);
666
+ case 30:
633
667
  return _context5.abrupt("return", response);
634
- case 25:
668
+ case 31:
635
669
  case "end":
636
670
  return _context5.stop();
637
671
  }
@@ -2,8 +2,8 @@ var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
2
2
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
3
3
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
4
4
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
5
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ 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; }
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
  /**
8
8
  * Methods for ABR video creation and management
9
9
  *
@@ -2,8 +2,8 @@ var _defineProperty = require("@babel/runtime/helpers/defineProperty");
2
2
  var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
3
3
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
4
4
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
5
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ 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; }
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
  /**
8
8
  * Methods for accessing and managing access groups
9
9
  *
@@ -3,8 +3,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
3
3
  var _defineProperty = require("@babel/runtime/helpers/defineProperty");
4
4
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
5
5
  var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
+ 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
  /**
9
9
  * Methods for accessing content types, libraries and objects
10
10
  *
@@ -693,29 +693,27 @@ exports.ContentLibrary = /*#__PURE__*/function () {
693
693
  libraryId = _ref15.libraryId;
694
694
  ValidateLibrary(libraryId);
695
695
  path = UrlJoin("qlibs", libraryId);
696
- _context10.t0 = this.utils;
697
- _context10.t1 = this.HttpClient;
698
- _context10.next = 7;
696
+ _context10.t0 = this.HttpClient;
697
+ _context10.next = 6;
699
698
  return this.authClient.AuthorizationHeader({
700
699
  libraryId: libraryId
701
700
  });
702
- case 7:
703
- _context10.t2 = _context10.sent;
704
- _context10.t3 = path;
705
- _context10.t4 = {
706
- headers: _context10.t2,
701
+ case 6:
702
+ _context10.t1 = _context10.sent;
703
+ _context10.t2 = path;
704
+ _context10.t3 = {
705
+ headers: _context10.t1,
707
706
  method: "GET",
708
- path: _context10.t3
707
+ path: _context10.t2
709
708
  };
710
- _context10.t5 = _context10.t1.Request.call(_context10.t1, _context10.t4);
711
- _context10.next = 13;
712
- return _context10.t0.ResponseToJson.call(_context10.t0, _context10.t5);
713
- case 13:
709
+ _context10.next = 11;
710
+ return _context10.t0.RequestJsonBody.call(_context10.t0, _context10.t3);
711
+ case 11:
714
712
  library = _context10.sent;
715
713
  return _context10.abrupt("return", _objectSpread(_objectSpread({}, library), {}, {
716
714
  meta: library.meta || {}
717
715
  }));
718
- case 15:
716
+ case 13:
719
717
  case "end":
720
718
  return _context10.stop();
721
719
  }
@@ -945,28 +943,26 @@ exports.ContentObjects = /*#__PURE__*/function () {
945
943
  }
946
944
  this.Log("Filter options:");
947
945
  this.Log(filterOptions);
948
- _context14.t0 = this.utils;
949
- _context14.t1 = this.HttpClient;
950
- _context14.next = 19;
946
+ _context14.t0 = this.HttpClient;
947
+ _context14.next = 18;
951
948
  return this.authClient.AuthorizationHeader({
952
949
  libraryId: libraryId
953
950
  });
954
- case 19:
955
- _context14.t2 = _context14.sent;
956
- _context14.t3 = path;
957
- _context14.t4 = queryParams;
958
- _context14.t5 = {
959
- headers: _context14.t2,
951
+ case 18:
952
+ _context14.t1 = _context14.sent;
953
+ _context14.t2 = path;
954
+ _context14.t3 = queryParams;
955
+ _context14.t4 = {
956
+ headers: _context14.t1,
960
957
  method: "GET",
961
- path: _context14.t3,
962
- queryParams: _context14.t4
958
+ path: _context14.t2,
959
+ queryParams: _context14.t3
963
960
  };
964
- _context14.t6 = _context14.t1.Request.call(_context14.t1, _context14.t5);
965
- _context14.next = 26;
966
- return _context14.t0.ResponseToJson.call(_context14.t0, _context14.t6);
967
- case 26:
961
+ _context14.next = 24;
962
+ return _context14.t0.RequestJsonBody.call(_context14.t0, _context14.t4);
963
+ case 24:
968
964
  return _context14.abrupt("return", _context14.sent);
969
- case 27:
965
+ case 25:
970
966
  case "end":
971
967
  return _context14.stop();
972
968
  }
@@ -1006,28 +1002,26 @@ exports.ContentObject = /*#__PURE__*/function () {
1006
1002
  objectId = this.utils.DecodeVersionHash(versionHash).objectId;
1007
1003
  }
1008
1004
  path = UrlJoin("q", writeToken || versionHash || objectId);
1009
- _context15.t0 = this.utils;
1010
- _context15.t1 = this.HttpClient;
1011
- _context15.next = 9;
1005
+ _context15.t0 = this.HttpClient;
1006
+ _context15.next = 8;
1012
1007
  return this.authClient.AuthorizationHeader({
1013
1008
  libraryId: libraryId,
1014
1009
  objectId: objectId,
1015
1010
  versionHash: versionHash
1016
1011
  });
1017
- case 9:
1018
- _context15.t2 = _context15.sent;
1019
- _context15.t3 = path;
1020
- _context15.t4 = {
1021
- headers: _context15.t2,
1012
+ case 8:
1013
+ _context15.t1 = _context15.sent;
1014
+ _context15.t2 = path;
1015
+ _context15.t3 = {
1016
+ headers: _context15.t1,
1022
1017
  method: "GET",
1023
- path: _context15.t3
1018
+ path: _context15.t2
1024
1019
  };
1025
- _context15.t5 = _context15.t1.Request.call(_context15.t1, _context15.t4);
1026
- _context15.next = 15;
1027
- return _context15.t0.ResponseToJson.call(_context15.t0, _context15.t5);
1028
- case 15:
1020
+ _context15.next = 13;
1021
+ return _context15.t0.RequestJsonBody.call(_context15.t0, _context15.t3);
1022
+ case 13:
1029
1023
  return _context15.abrupt("return", _context15.sent);
1030
- case 16:
1024
+ case 14:
1031
1025
  case "end":
1032
1026
  return _context15.stop();
1033
1027
  }
@@ -1588,7 +1582,7 @@ exports.ContentObjectMetadata = /*#__PURE__*/function () {
1588
1582
  delete queryParams.authorization;
1589
1583
  _context24.prev = 17;
1590
1584
  _context24.next = 20;
1591
- return this.utils.ResponseToJson(this.HttpClient.Request({
1585
+ return this.HttpClient.RequestJsonBody({
1592
1586
  headers: {
1593
1587
  "Authorization": authTokens.map(function (token) {
1594
1588
  return "Bearer ".concat(token);
@@ -1604,7 +1598,7 @@ exports.ContentObjectMetadata = /*#__PURE__*/function () {
1604
1598
  }),
1605
1599
  method: "GET",
1606
1600
  path: path
1607
- }));
1601
+ });
1608
1602
  case 20:
1609
1603
  metadata = _context24.sent;
1610
1604
  _context24.next = 33;
@@ -1811,24 +1805,22 @@ exports.ContentObjectVersions = /*#__PURE__*/function () {
1811
1805
  });
1812
1806
  this.Log("Retrieving content object versions: ".concat(libraryId || "", " ").concat(objectId));
1813
1807
  path = UrlJoin("qid", objectId);
1814
- _context26.t0 = this.utils;
1815
- _context26.t1 = this.HttpClient;
1816
- _context26.next = 8;
1808
+ _context26.t0 = this.HttpClient;
1809
+ _context26.next = 7;
1817
1810
  return this.authClient.AuthorizationHeader({
1818
1811
  libraryId: libraryId,
1819
1812
  objectId: objectId
1820
1813
  });
1821
- case 8:
1822
- _context26.t2 = _context26.sent;
1823
- _context26.t3 = path;
1824
- _context26.t4 = {
1825
- headers: _context26.t2,
1814
+ case 7:
1815
+ _context26.t1 = _context26.sent;
1816
+ _context26.t2 = path;
1817
+ _context26.t3 = {
1818
+ headers: _context26.t1,
1826
1819
  method: "GET",
1827
- path: _context26.t3
1820
+ path: _context26.t2
1828
1821
  };
1829
- _context26.t5 = _context26.t1.Request.call(_context26.t1, _context26.t4);
1830
- return _context26.abrupt("return", _context26.t0.ResponseToJson.call(_context26.t0, _context26.t5));
1831
- case 13:
1822
+ return _context26.abrupt("return", _context26.t0.RequestJsonBody.call(_context26.t0, _context26.t3));
1823
+ case 11:
1832
1824
  case "end":
1833
1825
  return _context26.stop();
1834
1826
  }
@@ -1943,40 +1935,38 @@ exports.LatestVersionHashV2 = /*#__PURE__*/function () {
1943
1935
  ValidateObject(objectId);
1944
1936
  _context28.prev = 3;
1945
1937
  path = UrlJoin("q", objectId);
1946
- _context28.t0 = this.utils;
1947
- _context28.t1 = this.HttpClient;
1948
- _context28.next = 9;
1938
+ _context28.t0 = this.HttpClient;
1939
+ _context28.next = 8;
1949
1940
  return this.authClient.AuthorizationHeader({
1950
1941
  objectId: objectId
1951
1942
  });
1952
- case 9:
1953
- _context28.t2 = _context28.sent;
1954
- _context28.t3 = path;
1955
- _context28.t4 = {
1956
- headers: _context28.t2,
1943
+ case 8:
1944
+ _context28.t1 = _context28.sent;
1945
+ _context28.t2 = path;
1946
+ _context28.t3 = {
1947
+ headers: _context28.t1,
1957
1948
  method: "GET",
1958
- path: _context28.t3
1949
+ path: _context28.t2
1959
1950
  };
1960
- _context28.t5 = _context28.t1.Request.call(_context28.t1, _context28.t4);
1961
- _context28.next = 15;
1962
- return _context28.t0.ResponseToJson.call(_context28.t0, _context28.t5);
1963
- case 15:
1951
+ _context28.next = 13;
1952
+ return _context28.t0.RequestJsonBody.call(_context28.t0, _context28.t3);
1953
+ case 13:
1964
1954
  q = _context28.sent;
1965
1955
  latestHash = q.hash;
1966
- _context28.next = 23;
1956
+ _context28.next = 21;
1967
1957
  break;
1968
- case 19:
1969
- _context28.prev = 19;
1970
- _context28.t6 = _context28["catch"](3);
1971
- _context28.t6.message = "Unable to determine latest version hash for ".concat(versionHash || objectId);
1972
- throw _context28.t6;
1973
- case 23:
1958
+ case 17:
1959
+ _context28.prev = 17;
1960
+ _context28.t4 = _context28["catch"](3);
1961
+ _context28.t4.message = "Unable to determine latest version hash for ".concat(versionHash || objectId);
1962
+ throw _context28.t4;
1963
+ case 21:
1974
1964
  return _context28.abrupt("return", latestHash);
1975
- case 24:
1965
+ case 22:
1976
1966
  case "end":
1977
1967
  return _context28.stop();
1978
1968
  }
1979
- }, _callee28, this, [[3, 19]]);
1969
+ }, _callee28, this, [[3, 17]]);
1980
1970
  }));
1981
1971
  return function (_x29) {
1982
1972
  return _ref49.apply(this, arguments);
@@ -2036,7 +2026,6 @@ exports.AvailableDRMs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
2036
2026
  }
2037
2027
  return _context29.abrupt("return", availableDRMs);
2038
2028
  case 6:
2039
- _context29.prev = 6;
2040
2029
  config = [{
2041
2030
  initDataTypes: ["cenc"],
2042
2031
  audioCapabilities: [{
@@ -2046,23 +2035,38 @@ exports.AvailableDRMs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerato
2046
2035
  contentType: "video/mp4;codecs=\"avc1.42E01E\""
2047
2036
  }]
2048
2037
  }];
2038
+ _context29.prev = 7;
2049
2039
  _context29.next = 10;
2050
2040
  return navigator.requestMediaKeySystemAccess("com.widevine.alpha", config);
2051
2041
  case 10:
2052
2042
  availableDRMs.push("widevine");
2043
+ // console.log("widevine detected");
2053
2044
  // eslint-disable-next-line no-empty
2054
2045
  _context29.next = 15;
2055
2046
  break;
2056
2047
  case 13:
2057
2048
  _context29.prev = 13;
2058
- _context29.t0 = _context29["catch"](6);
2049
+ _context29.t0 = _context29["catch"](7);
2059
2050
  case 15:
2051
+ _context29.prev = 15;
2052
+ _context29.next = 18;
2053
+ return navigator.requestMediaKeySystemAccess("com.microsoft.playready", config);
2054
+ case 18:
2055
+ availableDRMs.push("playready");
2056
+ // console.log("playready detected");
2057
+ // eslint-disable-next-line no-empty
2058
+ _context29.next = 23;
2059
+ break;
2060
+ case 21:
2061
+ _context29.prev = 21;
2062
+ _context29.t1 = _context29["catch"](15);
2063
+ case 23:
2060
2064
  return _context29.abrupt("return", availableDRMs);
2061
- case 16:
2065
+ case 24:
2062
2066
  case "end":
2063
2067
  return _context29.stop();
2064
2068
  }
2065
- }, _callee29, null, [[6, 13]]);
2069
+ }, _callee29, null, [[7, 13], [15, 21]]);
2066
2070
  }));
2067
2071
  exports.PlayoutPathResolution = /*#__PURE__*/function () {
2068
2072
  var _ref52 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(_ref51) {
@@ -2250,13 +2254,13 @@ exports.AvailableOfferings = /*#__PURE__*/function () {
2250
2254
  return token;
2251
2255
  });
2252
2256
  _context31.next = 27;
2253
- return this.utils.ResponseToJson(this.HttpClient.Request({
2257
+ return this.HttpClient.RequestJsonBody({
2254
2258
  path: path,
2255
2259
  method: "GET",
2256
2260
  headers: {
2257
2261
  Authorization: "Bearer ".concat(authorization.join(","))
2258
2262
  }
2259
- }));
2263
+ });
2260
2264
  case 27:
2261
2265
  return _context31.abrupt("return", _context31.sent);
2262
2266
  case 30:
@@ -2299,7 +2303,7 @@ exports.AvailableOfferings = /*#__PURE__*/function () {
2299
2303
  * @param {string=} linkPath - If playing from a link, the path to the link
2300
2304
  * @param {boolean=} signedLink - Specify if linkPath is referring to a signed link
2301
2305
  * @param {Array<string>} protocols=["dash","hls"]] - Acceptable playout protocols ("dash", "hls")
2302
- * @param {Array<string>} drms - Acceptable DRM formats ("clear", "aes-128", "widevine")
2306
+ * @param {Array<string>} drms - Acceptable DRM formats ("aes-128", "clear", "fairplay", "playready", "sample-aes", "widevine")
2303
2307
  * @param {string=} handler=playout - The handler to use for playout (not used with links)
2304
2308
  * @param {string=} offering=default - The offering to play
2305
2309
  * @param {string=} playoutType - The type of playout
@@ -2450,11 +2454,11 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2450
2454
  }, options);
2451
2455
  _context34.t11 = Object;
2452
2456
  _context34.next = 60;
2453
- return this.utils.ResponseToJson(this.HttpClient.Request({
2457
+ return this.HttpClient.RequestJsonBody({
2454
2458
  path: path,
2455
2459
  method: "GET",
2456
2460
  queryParams: queryParams
2457
- }));
2461
+ });
2458
2462
  case 60:
2459
2463
  _context34.t12 = _context34.sent;
2460
2464
  playoutOptions = _context34.t11.values.call(_context34.t11, _context34.t12);
@@ -2595,9 +2599,8 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2595
2599
  return _regeneratorRuntime.wrap(function _callee32$(_context32) {
2596
2600
  while (1) switch (_context32.prev = _context32.next) {
2597
2601
  case 0:
2598
- _context32.t0 = _this9.utils;
2599
- _context32.next = 3;
2600
- return _this9.HttpClient.Request({
2602
+ _context32.next = 2;
2603
+ return _this9.HttpClient.RequestJsonBody({
2601
2604
  path: UrlJoin("q", linkTarget.versionHash || versionHash, "rep", handler, offering, "views.json"),
2602
2605
  method: "GET",
2603
2606
  queryParams: {
@@ -2605,13 +2608,9 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2605
2608
  authorization: authorization
2606
2609
  }
2607
2610
  });
2608
- case 3:
2609
- _context32.t1 = _context32.sent;
2610
- _context32.next = 6;
2611
- return _context32.t0.ResponseToFormat.call(_context32.t0, "json", _context32.t1);
2612
- case 6:
2611
+ case 2:
2613
2612
  return _context32.abrupt("return", _context32.sent);
2614
- case 7:
2613
+ case 3:
2615
2614
  case "end":
2616
2615
  return _context32.stop();
2617
2616
  }
@@ -2673,7 +2672,7 @@ exports.PlayoutOptions = /*#__PURE__*/function () {
2673
2672
  * @param {string=} linkPath - If playing from a link, the path to the link
2674
2673
  * @param {boolean=} signedLink - Specify if linkPath is referring to a signed link
2675
2674
  * @param {Array<string>} protocols=["dash","hls"]] - Acceptable playout protocols ("dash", "hls")
2676
- * @param {Array<string>} drms - Acceptable DRM formats ("clear", "aes-128", "sample-aes", "widevine")
2675
+ * @param {Array<string>} drms - Acceptable DRM formats ("aes-128", "clear", "fairplay", "playready", "sample-aes", "widevine")
2677
2676
  * @param {string=} handler=playout - The handler to use for playout
2678
2677
  * @param {string=} offering=default - The offering to play
2679
2678
  * @param {string=} playoutType - The type of playout
@@ -2883,8 +2882,10 @@ exports.CallBitcodeMethod = /*#__PURE__*/function () {
2883
2882
  });
2884
2883
  case 17:
2885
2884
  _context36.t2 = _context36.sent;
2886
- return _context36.abrupt("return", _context36.t0.ResponseToFormat.call(_context36.t0, _context36.t1, _context36.t2));
2887
- case 19:
2885
+ _context36.t3 = this.HttpClient.debug;
2886
+ _context36.t4 = this.HttpClient.Log.bind(this.HttpClient);
2887
+ return _context36.abrupt("return", _context36.t0.ResponseToFormat.call(_context36.t0, _context36.t1, _context36.t2, _context36.t3, _context36.t4));
2888
+ case 21:
2888
2889
  case "end":
2889
2890
  return _context36.stop();
2890
2891
  }
@@ -4446,7 +4447,6 @@ exports.AccessInfo = /*#__PURE__*/function () {
4446
4447
  [] // Stakeholders
4447
4448
  ];
4448
4449
  }
4449
-
4450
4450
  this.Log("Retrieving access info: ".concat(objectId));
4451
4451
  _context53.next = 6;
4452
4452
  return this.ethClient.CallContractMethod({