@eluvio/elv-client-js 4.2.6 → 4.2.7

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 (40) hide show
  1. package/dist/ElvClient-min.js +1 -1
  2. package/dist/ElvClient-node-min.js +1 -1
  3. package/dist/ElvFrameClient-min.js +1 -1
  4. package/dist/ElvPermissionsClient-min.js +1 -1
  5. package/dist/ElvWalletClient-min.js +1 -1
  6. package/dist/ElvWalletClient-node-min.js +1 -1
  7. package/dist/src/AuthorizationClient.js +709 -710
  8. package/dist/src/ContentObjectAudit.js +56 -56
  9. package/dist/src/Crypto.js +85 -85
  10. package/dist/src/ElvClient.js +529 -499
  11. package/dist/src/ElvWallet.js +30 -28
  12. package/dist/src/EthClient.js +311 -311
  13. package/dist/src/FrameClient.js +63 -64
  14. package/dist/src/HttpClient.js +60 -60
  15. package/dist/src/Id.js +1 -2
  16. package/dist/src/PermissionsClient.js +499 -487
  17. package/dist/src/RemoteSigner.js +82 -83
  18. package/dist/src/UserProfileClient.js +392 -374
  19. package/dist/src/Utils.js +69 -66
  20. package/dist/src/Validation.js +10 -10
  21. package/dist/src/client/ABRPublishing.js +238 -238
  22. package/dist/src/client/AccessGroups.js +477 -474
  23. package/dist/src/client/ContentAccess.js +1707 -1711
  24. package/dist/src/client/ContentManagement.js +871 -871
  25. package/dist/src/client/Contracts.js +575 -578
  26. package/dist/src/client/Files.js +700 -684
  27. package/dist/src/client/LiveConf.js +1 -3
  28. package/dist/src/client/LiveStream.js +694 -693
  29. package/dist/src/client/NFT.js +14 -14
  30. package/dist/src/client/NTP.js +84 -84
  31. package/dist/src/client/Shares.js +53 -60
  32. package/dist/src/walletClient/ClientMethods.js +977 -951
  33. package/dist/src/walletClient/Notifications.js +14 -14
  34. package/dist/src/walletClient/Profile.js +66 -66
  35. package/dist/src/walletClient/Utils.js +15 -15
  36. package/dist/src/walletClient/index.js +572 -562
  37. package/package.json +1 -1
  38. package/src/ElvClient.js +1 -1
  39. package/src/walletClient/index.js +6 -2
  40. package/dist/src/ContentObjectVerification.js +0 -281
package/dist/src/Utils.js CHANGED
@@ -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
  *
@@ -470,37 +469,37 @@ var Utils = {
470
469
  });
471
470
  },
472
471
  LimitedMap: function () {
473
- var _LimitedMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(limit, array, f) {
472
+ var _LimitedMap = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(limit, array, f) {
474
473
  var index, locked, nextIndex, results, active;
475
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
474
+ return _regeneratorRuntime.wrap(function (_context3) {
476
475
  while (1) switch (_context3.prev = _context3.next) {
477
476
  case 0:
478
477
  index = 0;
479
478
  locked = false;
480
479
  nextIndex = /*#__PURE__*/function () {
481
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
480
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
482
481
  var thisIndex;
483
- return _regeneratorRuntime.wrap(function _callee$(_context) {
482
+ return _regeneratorRuntime.wrap(function (_context) {
484
483
  while (1) switch (_context.prev = _context.next) {
485
484
  case 0:
486
485
  if (!locked) {
487
- _context.next = 5;
486
+ _context.next = 2;
488
487
  break;
489
488
  }
490
- _context.next = 3;
489
+ _context.next = 1;
491
490
  return new Promise(function (resolve) {
492
491
  return setTimeout(resolve, 10);
493
492
  });
494
- case 3:
493
+ case 1:
495
494
  _context.next = 0;
496
495
  break;
497
- case 5:
496
+ case 2:
498
497
  locked = true;
499
498
  thisIndex = index;
500
499
  index += 1;
501
500
  locked = false;
502
501
  return _context.abrupt("return", thisIndex);
503
- case 10:
502
+ case 3:
504
503
  case "end":
505
504
  return _context.stop();
506
505
  }
@@ -513,53 +512,53 @@ var Utils = {
513
512
  results = [];
514
513
  active = 0;
515
514
  return _context3.abrupt("return", new Promise(function (resolve, reject) {
516
- _toConsumableArray(Array(limit || 1)).forEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
517
- var index;
518
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
515
+ _toConsumableArray(Array(limit || 1)).forEach(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
516
+ var index, _t;
517
+ return _regeneratorRuntime.wrap(function (_context2) {
519
518
  while (1) switch (_context2.prev = _context2.next) {
520
519
  case 0:
521
520
  active += 1;
522
- _context2.next = 3;
521
+ _context2.next = 1;
523
522
  return nextIndex();
524
- case 3:
523
+ case 1:
525
524
  index = _context2.sent;
526
- case 4:
525
+ case 2:
527
526
  if (!(index < array.length)) {
528
- _context2.next = 19;
527
+ _context2.next = 8;
529
528
  break;
530
529
  }
531
- _context2.prev = 5;
532
- _context2.next = 8;
530
+ _context2.prev = 3;
531
+ _context2.next = 4;
533
532
  return f(array[index], index);
534
- case 8:
533
+ case 4:
535
534
  results[index] = _context2.sent;
536
- _context2.next = 14;
535
+ _context2.next = 6;
537
536
  break;
538
- case 11:
539
- _context2.prev = 11;
540
- _context2.t0 = _context2["catch"](5);
541
- reject(_context2.t0);
542
- case 14:
543
- _context2.next = 16;
537
+ case 5:
538
+ _context2.prev = 5;
539
+ _t = _context2["catch"](3);
540
+ reject(_t);
541
+ case 6:
542
+ _context2.next = 7;
544
543
  return nextIndex();
545
- case 16:
544
+ case 7:
546
545
  index = _context2.sent;
547
- _context2.next = 4;
546
+ _context2.next = 2;
548
547
  break;
549
- case 19:
548
+ case 8:
550
549
  // When finished and no more workers are active, resolve
551
550
  active -= 1;
552
551
  if (active === 0) {
553
552
  resolve(results);
554
553
  }
555
- case 21:
554
+ case 9:
556
555
  case "end":
557
556
  return _context2.stop();
558
557
  }
559
- }, _callee2, null, [[5, 11]]);
558
+ }, _callee2, null, [[3, 5]]);
560
559
  })));
561
560
  }));
562
- case 6:
561
+ case 1:
563
562
  case "end":
564
563
  return _context3.stop();
565
564
  }
@@ -579,20 +578,20 @@ var Utils = {
579
578
  * @return {*} - Result of parsing response body as JSON
580
579
  */
581
580
  ResponseToJson: function () {
582
- var _ResponseToJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(response) {
581
+ var _ResponseToJson = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(response) {
583
582
  var debug,
584
583
  logFn,
585
584
  _args4 = arguments;
586
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
585
+ return _regeneratorRuntime.wrap(function (_context4) {
587
586
  while (1) switch (_context4.prev = _context4.next) {
588
587
  case 0:
589
588
  debug = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : false;
590
589
  logFn = _args4.length > 2 ? _args4[2] : undefined;
591
- _context4.next = 4;
590
+ _context4.next = 1;
592
591
  return Utils.ResponseToFormat("json", response, debug, logFn);
593
- case 4:
592
+ case 1:
594
593
  return _context4.abrupt("return", _context4.sent);
595
- case 5:
594
+ case 2:
596
595
  case "end":
597
596
  return _context4.stop();
598
597
  }
@@ -613,60 +612,61 @@ var Utils = {
613
612
  * @return {*} - Result of converting response body into the requested format
614
613
  */
615
614
  ResponseToFormat: function () {
616
- var _ResponseToFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(format, response) {
615
+ var _ResponseToFormat = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(format, response) {
617
616
  var debug,
618
617
  logFn,
619
618
  formattedBody,
620
- _args5 = arguments;
621
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
619
+ _args5 = arguments,
620
+ _t2;
621
+ return _regeneratorRuntime.wrap(function (_context5) {
622
622
  while (1) switch (_context5.prev = _context5.next) {
623
623
  case 0:
624
624
  debug = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
625
625
  logFn = _args5.length > 3 ? _args5[3] : undefined;
626
- _context5.next = 4;
626
+ _context5.next = 1;
627
627
  return response;
628
- case 4:
628
+ case 1:
629
629
  response = _context5.sent;
630
- _context5.t0 = format.toLowerCase();
631
- _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;
630
+ _t2 = format.toLowerCase();
631
+ _context5.next = _t2 === "json" ? 2 : _t2 === "text" ? 4 : _t2 === "blob" ? 6 : _t2 === "arraybuffer" ? 8 : _t2 === "formdata" ? 10 : _t2 === "buffer" ? 12 : 14;
632
632
  break;
633
- case 8:
634
- _context5.next = 10;
633
+ case 2:
634
+ _context5.next = 3;
635
635
  return response.json();
636
- case 10:
636
+ case 3:
637
637
  formattedBody = _context5.sent;
638
638
  if (debug) logFn("response body: ".concat(JSON.stringify(formattedBody, null, 2)));
639
639
  return _context5.abrupt("return", formattedBody);
640
- case 13:
641
- _context5.next = 15;
640
+ case 4:
641
+ _context5.next = 5;
642
642
  return response.text();
643
- case 15:
643
+ case 5:
644
644
  formattedBody = _context5.sent;
645
645
  if (debug) logFn("response body: ".concat(formattedBody));
646
646
  return _context5.abrupt("return", formattedBody);
647
- case 18:
648
- _context5.next = 20;
647
+ case 6:
648
+ _context5.next = 7;
649
649
  return response.blob();
650
- case 20:
650
+ case 7:
651
651
  return _context5.abrupt("return", _context5.sent);
652
- case 21:
653
- _context5.next = 23;
652
+ case 8:
653
+ _context5.next = 9;
654
654
  return response.arrayBuffer();
655
- case 23:
655
+ case 9:
656
656
  return _context5.abrupt("return", _context5.sent);
657
- case 24:
658
- _context5.next = 26;
657
+ case 10:
658
+ _context5.next = 11;
659
659
  return response.formData();
660
- case 26:
660
+ case 11:
661
661
  return _context5.abrupt("return", _context5.sent);
662
- case 27:
663
- _context5.next = 29;
662
+ case 12:
663
+ _context5.next = 13;
664
664
  return response.buffer();
665
- case 29:
665
+ case 13:
666
666
  return _context5.abrupt("return", _context5.sent);
667
- case 30:
667
+ case 14:
668
668
  return _context5.abrupt("return", response);
669
- case 31:
669
+ case 15:
670
670
  case "end":
671
671
  return _context5.stop();
672
672
  }
@@ -852,7 +852,10 @@ var Utils = {
852
852
  profile = _ref4$profile === void 0 ? "default" : _ref4$profile;
853
853
  var isSafari = typeof window !== "undefined" && typeof window.navigator !== "undefined" && /^((?!chrome|android).)*safari/i.test(window.navigator.userAgent);
854
854
  var defaultSettings = {
855
- "backBufferLength": 90
855
+ "maxBufferHole": 2.2,
856
+ "nudgeOffset": 0.2,
857
+ "nudgeMaxRetry": 12,
858
+ "highBufferWatchdogPeriod": 1
856
859
  };
857
860
  if (!isSafari && ["ull", "ultraLowLatency"].includes(profile)) {
858
861
  return {
@@ -88,36 +88,36 @@ exports.ValidateDate = function (date) {
88
88
  return new Date(date).getTime();
89
89
  };
90
90
  exports.ValidateUserWallet = /*#__PURE__*/function () {
91
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
91
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
92
92
  var address, client, walletAddress;
93
- return _regeneratorRuntime.wrap(function _callee$(_context) {
93
+ return _regeneratorRuntime.wrap(function (_context) {
94
94
  while (1) switch (_context.prev = _context.next) {
95
95
  case 0:
96
96
  address = _ref2.address, client = _ref2.client;
97
97
  if (address) {
98
- _context.next = 5;
98
+ _context.next = 1;
99
99
  break;
100
100
  }
101
101
  throw Error("Address not specified");
102
- case 5:
102
+ case 1:
103
103
  if (client) {
104
- _context.next = 7;
104
+ _context.next = 2;
105
105
  break;
106
106
  }
107
107
  throw Error("Client not specified");
108
- case 7:
109
- _context.next = 9;
108
+ case 2:
109
+ _context.next = 3;
110
110
  return client.userProfileClient.UserWalletAddress({
111
111
  address: address
112
112
  });
113
- case 9:
113
+ case 3:
114
114
  walletAddress = _context.sent;
115
115
  if (walletAddress) {
116
- _context.next = 12;
116
+ _context.next = 4;
117
117
  break;
118
118
  }
119
119
  throw Error("User address has no wallet: ".concat(address));
120
- case 12:
120
+ case 4:
121
121
  case "end":
122
122
  return _context.stop();
123
123
  }