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