@eluvio/elv-client-js 4.0.146 → 4.1.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.
Files changed (48) hide show
  1. package/dist/ElvClient-min.js +2 -68
  2. package/dist/ElvClient-min.js.LICENSE.txt +72 -0
  3. package/dist/ElvClient-node-min.js +2 -67
  4. package/dist/ElvClient-node-min.js.LICENSE.txt +72 -0
  5. package/dist/ElvFrameClient-min.js +2 -60
  6. package/dist/ElvFrameClient-min.js.LICENSE.txt +72 -0
  7. package/dist/ElvPermissionsClient-min.js +2 -60
  8. package/dist/ElvPermissionsClient-min.js.LICENSE.txt +72 -0
  9. package/dist/ElvWalletClient-min.js +2 -68
  10. package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
  11. package/dist/ElvWalletClient-node-min.js +2 -67
  12. package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
  13. package/dist/src/AuthorizationClient.js +704 -703
  14. package/dist/src/ContentObjectAudit.js +56 -56
  15. package/dist/src/Crypto.js +85 -86
  16. package/dist/src/ElvClient.js +483 -471
  17. package/dist/src/ElvWallet.js +23 -23
  18. package/dist/src/EthClient.js +308 -307
  19. package/dist/src/FrameClient.js +62 -62
  20. package/dist/src/HttpClient.js +59 -58
  21. package/dist/src/PermissionsClient.js +470 -470
  22. package/dist/src/RemoteSigner.js +77 -76
  23. package/dist/src/UserProfileClient.js +357 -354
  24. package/dist/src/Utils.js +65 -64
  25. package/dist/src/Validation.js +10 -10
  26. package/dist/src/client/ABRPublishing.js +237 -237
  27. package/dist/src/client/AccessGroups.js +477 -474
  28. package/dist/src/client/ContentAccess.js +1749 -1802
  29. package/dist/src/client/ContentManagement.js +871 -871
  30. package/dist/src/client/Contracts.js +575 -578
  31. package/dist/src/client/Files.js +700 -684
  32. package/dist/src/client/LiveStream.js +659 -650
  33. package/dist/src/client/NFT.js +14 -14
  34. package/dist/src/client/NTP.js +84 -84
  35. package/dist/src/client/Shares.js +49 -49
  36. package/dist/src/walletClient/ClientMethods.js +977 -951
  37. package/dist/src/walletClient/Notifications.js +14 -14
  38. package/dist/src/walletClient/Profile.js +66 -66
  39. package/dist/src/walletClient/Utils.js +15 -15
  40. package/dist/src/walletClient/index.js +557 -550
  41. package/package.json +17 -16
  42. package/src/ElvClient.js +1 -0
  43. package/src/FrameClient.js +12 -0
  44. package/src/client/AccessGroups.js +1 -1
  45. package/src/client/ContentAccess.js +44 -71
  46. package/testScripts/Test.js +5 -1
  47. package/webpack.config.js +10 -13
  48. package/dist/src/ContentObjectVerification.js +0 -281
package/dist/src/Utils.js CHANGED
@@ -469,37 +469,37 @@ var Utils = {
469
469
  });
470
470
  },
471
471
  LimitedMap: function () {
472
- var _LimitedMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(limit, array, f) {
472
+ var _LimitedMap = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(limit, array, f) {
473
473
  var index, locked, nextIndex, results, active;
474
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
474
+ return _regeneratorRuntime.wrap(function (_context3) {
475
475
  while (1) switch (_context3.prev = _context3.next) {
476
476
  case 0:
477
477
  index = 0;
478
478
  locked = false;
479
479
  nextIndex = /*#__PURE__*/function () {
480
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
480
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
481
481
  var thisIndex;
482
- return _regeneratorRuntime.wrap(function _callee$(_context) {
482
+ return _regeneratorRuntime.wrap(function (_context) {
483
483
  while (1) switch (_context.prev = _context.next) {
484
484
  case 0:
485
485
  if (!locked) {
486
- _context.next = 5;
486
+ _context.next = 2;
487
487
  break;
488
488
  }
489
- _context.next = 3;
489
+ _context.next = 1;
490
490
  return new Promise(function (resolve) {
491
491
  return setTimeout(resolve, 10);
492
492
  });
493
- case 3:
493
+ case 1:
494
494
  _context.next = 0;
495
495
  break;
496
- case 5:
496
+ case 2:
497
497
  locked = true;
498
498
  thisIndex = index;
499
499
  index += 1;
500
500
  locked = false;
501
501
  return _context.abrupt("return", thisIndex);
502
- case 10:
502
+ case 3:
503
503
  case "end":
504
504
  return _context.stop();
505
505
  }
@@ -512,53 +512,53 @@ var Utils = {
512
512
  results = [];
513
513
  active = 0;
514
514
  return _context3.abrupt("return", new Promise(function (resolve, reject) {
515
- _toConsumableArray(Array(limit || 1)).forEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
516
- var index;
517
- 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) {
518
518
  while (1) switch (_context2.prev = _context2.next) {
519
519
  case 0:
520
520
  active += 1;
521
- _context2.next = 3;
521
+ _context2.next = 1;
522
522
  return nextIndex();
523
- case 3:
523
+ case 1:
524
524
  index = _context2.sent;
525
- case 4:
525
+ case 2:
526
526
  if (!(index < array.length)) {
527
- _context2.next = 19;
527
+ _context2.next = 8;
528
528
  break;
529
529
  }
530
- _context2.prev = 5;
531
- _context2.next = 8;
530
+ _context2.prev = 3;
531
+ _context2.next = 4;
532
532
  return f(array[index], index);
533
- case 8:
533
+ case 4:
534
534
  results[index] = _context2.sent;
535
- _context2.next = 14;
535
+ _context2.next = 6;
536
536
  break;
537
- case 11:
538
- _context2.prev = 11;
539
- _context2.t0 = _context2["catch"](5);
540
- reject(_context2.t0);
541
- case 14:
542
- _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;
543
543
  return nextIndex();
544
- case 16:
544
+ case 7:
545
545
  index = _context2.sent;
546
- _context2.next = 4;
546
+ _context2.next = 2;
547
547
  break;
548
- case 19:
548
+ case 8:
549
549
  // When finished and no more workers are active, resolve
550
550
  active -= 1;
551
551
  if (active === 0) {
552
552
  resolve(results);
553
553
  }
554
- case 21:
554
+ case 9:
555
555
  case "end":
556
556
  return _context2.stop();
557
557
  }
558
- }, _callee2, null, [[5, 11]]);
558
+ }, _callee2, null, [[3, 5]]);
559
559
  })));
560
560
  }));
561
- case 6:
561
+ case 1:
562
562
  case "end":
563
563
  return _context3.stop();
564
564
  }
@@ -578,20 +578,20 @@ var Utils = {
578
578
  * @return {*} - Result of parsing response body as JSON
579
579
  */
580
580
  ResponseToJson: function () {
581
- var _ResponseToJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(response) {
581
+ var _ResponseToJson = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(response) {
582
582
  var debug,
583
583
  logFn,
584
584
  _args4 = arguments;
585
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
585
+ return _regeneratorRuntime.wrap(function (_context4) {
586
586
  while (1) switch (_context4.prev = _context4.next) {
587
587
  case 0:
588
588
  debug = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : false;
589
589
  logFn = _args4.length > 2 ? _args4[2] : undefined;
590
- _context4.next = 4;
590
+ _context4.next = 1;
591
591
  return Utils.ResponseToFormat("json", response, debug, logFn);
592
- case 4:
592
+ case 1:
593
593
  return _context4.abrupt("return", _context4.sent);
594
- case 5:
594
+ case 2:
595
595
  case "end":
596
596
  return _context4.stop();
597
597
  }
@@ -612,60 +612,61 @@ var Utils = {
612
612
  * @return {*} - Result of converting response body into the requested format
613
613
  */
614
614
  ResponseToFormat: function () {
615
- var _ResponseToFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(format, response) {
615
+ var _ResponseToFormat = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(format, response) {
616
616
  var debug,
617
617
  logFn,
618
618
  formattedBody,
619
- _args5 = arguments;
620
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
619
+ _args5 = arguments,
620
+ _t2;
621
+ return _regeneratorRuntime.wrap(function (_context5) {
621
622
  while (1) switch (_context5.prev = _context5.next) {
622
623
  case 0:
623
624
  debug = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
624
625
  logFn = _args5.length > 3 ? _args5[3] : undefined;
625
- _context5.next = 4;
626
+ _context5.next = 1;
626
627
  return response;
627
- case 4:
628
+ case 1:
628
629
  response = _context5.sent;
629
- _context5.t0 = format.toLowerCase();
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;
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;
631
632
  break;
632
- case 8:
633
- _context5.next = 10;
633
+ case 2:
634
+ _context5.next = 3;
634
635
  return response.json();
635
- case 10:
636
+ case 3:
636
637
  formattedBody = _context5.sent;
637
638
  if (debug) logFn("response body: ".concat(JSON.stringify(formattedBody, null, 2)));
638
639
  return _context5.abrupt("return", formattedBody);
639
- case 13:
640
- _context5.next = 15;
640
+ case 4:
641
+ _context5.next = 5;
641
642
  return response.text();
642
- case 15:
643
+ case 5:
643
644
  formattedBody = _context5.sent;
644
645
  if (debug) logFn("response body: ".concat(formattedBody));
645
646
  return _context5.abrupt("return", formattedBody);
646
- case 18:
647
- _context5.next = 20;
647
+ case 6:
648
+ _context5.next = 7;
648
649
  return response.blob();
649
- case 20:
650
+ case 7:
650
651
  return _context5.abrupt("return", _context5.sent);
651
- case 21:
652
- _context5.next = 23;
652
+ case 8:
653
+ _context5.next = 9;
653
654
  return response.arrayBuffer();
654
- case 23:
655
+ case 9:
655
656
  return _context5.abrupt("return", _context5.sent);
656
- case 24:
657
- _context5.next = 26;
657
+ case 10:
658
+ _context5.next = 11;
658
659
  return response.formData();
659
- case 26:
660
+ case 11:
660
661
  return _context5.abrupt("return", _context5.sent);
661
- case 27:
662
- _context5.next = 29;
662
+ case 12:
663
+ _context5.next = 13;
663
664
  return response.buffer();
664
- case 29:
665
+ case 13:
665
666
  return _context5.abrupt("return", _context5.sent);
666
- case 30:
667
+ case 14:
667
668
  return _context5.abrupt("return", response);
668
- case 31:
669
+ case 15:
669
670
  case "end":
670
671
  return _context5.stop();
671
672
  }
@@ -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
  }