@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.
- package/dist/ElvClient-min.js +2 -68
- package/dist/ElvClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvClient-node-min.js +2 -67
- package/dist/ElvClient-node-min.js.LICENSE.txt +72 -0
- package/dist/ElvFrameClient-min.js +2 -60
- package/dist/ElvFrameClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvPermissionsClient-min.js +2 -60
- package/dist/ElvPermissionsClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-min.js +2 -68
- package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-node-min.js +2 -67
- package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
- package/dist/src/AuthorizationClient.js +704 -703
- package/dist/src/ContentObjectAudit.js +56 -56
- package/dist/src/Crypto.js +85 -86
- package/dist/src/ElvClient.js +483 -471
- package/dist/src/ElvWallet.js +23 -23
- package/dist/src/EthClient.js +308 -307
- package/dist/src/FrameClient.js +62 -62
- package/dist/src/HttpClient.js +59 -58
- package/dist/src/PermissionsClient.js +470 -470
- package/dist/src/RemoteSigner.js +77 -76
- package/dist/src/UserProfileClient.js +357 -354
- package/dist/src/Utils.js +65 -64
- package/dist/src/Validation.js +10 -10
- package/dist/src/client/ABRPublishing.js +237 -237
- package/dist/src/client/AccessGroups.js +477 -474
- package/dist/src/client/ContentAccess.js +1749 -1802
- package/dist/src/client/ContentManagement.js +871 -871
- package/dist/src/client/Contracts.js +575 -578
- package/dist/src/client/Files.js +700 -684
- package/dist/src/client/LiveStream.js +659 -650
- package/dist/src/client/NFT.js +14 -14
- package/dist/src/client/NTP.js +84 -84
- package/dist/src/client/Shares.js +49 -49
- package/dist/src/walletClient/ClientMethods.js +977 -951
- 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 +557 -550
- package/package.json +17 -16
- package/src/ElvClient.js +1 -0
- package/src/FrameClient.js +12 -0
- package/src/client/AccessGroups.js +1 -1
- package/src/client/ContentAccess.js +44 -71
- package/testScripts/Test.js +5 -1
- package/webpack.config.js +10 -13
- 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(
|
|
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
|
|
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(
|
|
480
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
481
481
|
var thisIndex;
|
|
482
|
-
return _regeneratorRuntime.wrap(function
|
|
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 =
|
|
486
|
+
_context.next = 2;
|
|
487
487
|
break;
|
|
488
488
|
}
|
|
489
|
-
_context.next =
|
|
489
|
+
_context.next = 1;
|
|
490
490
|
return new Promise(function (resolve) {
|
|
491
491
|
return setTimeout(resolve, 10);
|
|
492
492
|
});
|
|
493
|
-
case
|
|
493
|
+
case 1:
|
|
494
494
|
_context.next = 0;
|
|
495
495
|
break;
|
|
496
|
-
case
|
|
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
|
|
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(
|
|
516
|
-
var index;
|
|
517
|
-
return _regeneratorRuntime.wrap(function
|
|
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 =
|
|
521
|
+
_context2.next = 1;
|
|
522
522
|
return nextIndex();
|
|
523
|
-
case
|
|
523
|
+
case 1:
|
|
524
524
|
index = _context2.sent;
|
|
525
|
-
case
|
|
525
|
+
case 2:
|
|
526
526
|
if (!(index < array.length)) {
|
|
527
|
-
_context2.next =
|
|
527
|
+
_context2.next = 8;
|
|
528
528
|
break;
|
|
529
529
|
}
|
|
530
|
-
_context2.prev =
|
|
531
|
-
_context2.next =
|
|
530
|
+
_context2.prev = 3;
|
|
531
|
+
_context2.next = 4;
|
|
532
532
|
return f(array[index], index);
|
|
533
|
-
case
|
|
533
|
+
case 4:
|
|
534
534
|
results[index] = _context2.sent;
|
|
535
|
-
_context2.next =
|
|
535
|
+
_context2.next = 6;
|
|
536
536
|
break;
|
|
537
|
-
case
|
|
538
|
-
_context2.prev =
|
|
539
|
-
|
|
540
|
-
reject(
|
|
541
|
-
case
|
|
542
|
-
_context2.next =
|
|
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
|
|
544
|
+
case 7:
|
|
545
545
|
index = _context2.sent;
|
|
546
|
-
_context2.next =
|
|
546
|
+
_context2.next = 2;
|
|
547
547
|
break;
|
|
548
|
-
case
|
|
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
|
|
554
|
+
case 9:
|
|
555
555
|
case "end":
|
|
556
556
|
return _context2.stop();
|
|
557
557
|
}
|
|
558
|
-
}, _callee2, null, [[
|
|
558
|
+
}, _callee2, null, [[3, 5]]);
|
|
559
559
|
})));
|
|
560
560
|
}));
|
|
561
|
-
case
|
|
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(
|
|
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
|
|
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 =
|
|
590
|
+
_context4.next = 1;
|
|
591
591
|
return Utils.ResponseToFormat("json", response, debug, logFn);
|
|
592
|
-
case
|
|
592
|
+
case 1:
|
|
593
593
|
return _context4.abrupt("return", _context4.sent);
|
|
594
|
-
case
|
|
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(
|
|
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
|
-
|
|
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 =
|
|
626
|
+
_context5.next = 1;
|
|
626
627
|
return response;
|
|
627
|
-
case
|
|
628
|
+
case 1:
|
|
628
629
|
response = _context5.sent;
|
|
629
|
-
|
|
630
|
-
_context5.next =
|
|
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
|
|
633
|
-
_context5.next =
|
|
633
|
+
case 2:
|
|
634
|
+
_context5.next = 3;
|
|
634
635
|
return response.json();
|
|
635
|
-
case
|
|
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
|
|
640
|
-
_context5.next =
|
|
640
|
+
case 4:
|
|
641
|
+
_context5.next = 5;
|
|
641
642
|
return response.text();
|
|
642
|
-
case
|
|
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
|
|
647
|
-
_context5.next =
|
|
647
|
+
case 6:
|
|
648
|
+
_context5.next = 7;
|
|
648
649
|
return response.blob();
|
|
649
|
-
case
|
|
650
|
+
case 7:
|
|
650
651
|
return _context5.abrupt("return", _context5.sent);
|
|
651
|
-
case
|
|
652
|
-
_context5.next =
|
|
652
|
+
case 8:
|
|
653
|
+
_context5.next = 9;
|
|
653
654
|
return response.arrayBuffer();
|
|
654
|
-
case
|
|
655
|
+
case 9:
|
|
655
656
|
return _context5.abrupt("return", _context5.sent);
|
|
656
|
-
case
|
|
657
|
-
_context5.next =
|
|
657
|
+
case 10:
|
|
658
|
+
_context5.next = 11;
|
|
658
659
|
return response.formData();
|
|
659
|
-
case
|
|
660
|
+
case 11:
|
|
660
661
|
return _context5.abrupt("return", _context5.sent);
|
|
661
|
-
case
|
|
662
|
-
_context5.next =
|
|
662
|
+
case 12:
|
|
663
|
+
_context5.next = 13;
|
|
663
664
|
return response.buffer();
|
|
664
|
-
case
|
|
665
|
+
case 13:
|
|
665
666
|
return _context5.abrupt("return", _context5.sent);
|
|
666
|
-
case
|
|
667
|
+
case 14:
|
|
667
668
|
return _context5.abrupt("return", response);
|
|
668
|
-
case
|
|
669
|
+
case 15:
|
|
669
670
|
case "end":
|
|
670
671
|
return _context5.stop();
|
|
671
672
|
}
|
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(
|
|
91
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
92
92
|
var address, client, walletAddress;
|
|
93
|
-
return _regeneratorRuntime.wrap(function
|
|
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 =
|
|
98
|
+
_context.next = 1;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
101
|
throw Error("Address not specified");
|
|
102
|
-
case
|
|
102
|
+
case 1:
|
|
103
103
|
if (client) {
|
|
104
|
-
_context.next =
|
|
104
|
+
_context.next = 2;
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
throw Error("Client not specified");
|
|
108
|
-
case
|
|
109
|
-
_context.next =
|
|
108
|
+
case 2:
|
|
109
|
+
_context.next = 3;
|
|
110
110
|
return client.userProfileClient.UserWalletAddress({
|
|
111
111
|
address: address
|
|
112
112
|
});
|
|
113
|
-
case
|
|
113
|
+
case 3:
|
|
114
114
|
walletAddress = _context.sent;
|
|
115
115
|
if (walletAddress) {
|
|
116
|
-
_context.next =
|
|
116
|
+
_context.next = 4;
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
119
|
throw Error("User address has no wallet: ".concat(address));
|
|
120
|
-
case
|
|
120
|
+
case 4:
|
|
121
121
|
case "end":
|
|
122
122
|
return _context.stop();
|
|
123
123
|
}
|