@eluvio/elv-client-js 3.1.93 → 3.1.96
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 +15 -11
- package/dist/ElvClient-node-min.js +17 -13
- package/dist/ElvFrameClient-min.js +13 -9
- package/dist/ElvPermissionsClient-min.js +13 -9
- package/dist/src/AuthorizationClient.js +2248 -1990
- package/dist/src/ContentObjectVerification.js +164 -173
- package/dist/src/Crypto.js +376 -324
- package/dist/src/ElvClient.js +1214 -938
- package/dist/src/ElvWallet.js +119 -95
- package/dist/src/EthClient.js +1040 -896
- package/dist/src/FrameClient.js +331 -300
- package/dist/src/HttpClient.js +153 -147
- package/dist/src/Id.js +1 -3
- package/dist/src/PermissionsClient.js +1294 -1168
- package/dist/src/RemoteSigner.js +260 -200
- package/dist/src/UserProfileClient.js +1164 -1023
- package/dist/src/Utils.js +209 -177
- package/dist/src/client/ABRPublishing.js +895 -856
- package/dist/src/client/AccessGroups.js +1102 -959
- package/dist/src/client/ContentAccess.js +3727 -3425
- package/dist/src/client/ContentManagement.js +2252 -2068
- package/dist/src/client/Contracts.js +647 -563
- package/dist/src/client/Files.js +1886 -1757
- package/dist/src/client/NFT.js +126 -112
- package/dist/src/client/NTP.js +478 -422
- package/package.json +2 -1
- package/src/AuthorizationClient.js +1 -1
- package/src/ElvClient.js +62 -1
- package/src/RemoteSigner.js +22 -18
- package/src/client/ABRPublishing.js +2 -1
- package/src/client/ContentAccess.js +4 -0
- package/testScripts/Test.js +0 -19
- package/testScripts/VariantABRProfile.js +45 -0
- package/utilities/ObjectSetPermission.js +4 -4
- package/utilities/SimpleIngest.js +286 -0
- package/utilities/example_files/simple_ingest_library_metadata.json +180 -0
- package/utilities/example_files/simple_ingest_library_metadata_animation_NFTs.json +133 -0
- package/package-lock.json +0 -12650
package/dist/src/Utils.js
CHANGED
|
@@ -2,15 +2,17 @@ var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
2
2
|
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
|
|
5
|
+
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
6
|
+
|
|
5
7
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
6
8
|
|
|
7
9
|
var _slicedToArray = require("@babel/runtime/helpers/slicedToArray");
|
|
8
10
|
|
|
9
11
|
var _this = this;
|
|
10
12
|
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
13
|
+
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; }
|
|
12
14
|
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
15
|
+
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; }
|
|
14
16
|
|
|
15
17
|
if (typeof Buffer === "undefined") {
|
|
16
18
|
Buffer = require("buffer/").Buffer;
|
|
@@ -475,203 +477,233 @@ var Utils = {
|
|
|
475
477
|
signature = _token$split2[1];
|
|
476
478
|
|
|
477
479
|
info = JSON.parse(Utils.FromB64(info));
|
|
478
|
-
return _objectSpread({}, info, {
|
|
480
|
+
return _objectSpread(_objectSpread({}, info), {}, {
|
|
479
481
|
signature: signature
|
|
480
482
|
});
|
|
481
483
|
},
|
|
482
|
-
LimitedMap: function
|
|
483
|
-
var
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
484
|
+
LimitedMap: function () {
|
|
485
|
+
var _LimitedMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(limit, array, f) {
|
|
486
|
+
var index, locked, nextIndex, results, active;
|
|
487
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
488
|
+
while (1) {
|
|
489
|
+
switch (_context3.prev = _context3.next) {
|
|
490
|
+
case 0:
|
|
491
|
+
index = 0;
|
|
492
|
+
locked = false;
|
|
493
|
+
|
|
494
|
+
nextIndex = /*#__PURE__*/function () {
|
|
495
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
496
|
+
var thisIndex;
|
|
497
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
498
|
+
while (1) {
|
|
499
|
+
switch (_context.prev = _context.next) {
|
|
500
|
+
case 0:
|
|
501
|
+
if (!locked) {
|
|
502
|
+
_context.next = 5;
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
_context.next = 3;
|
|
507
|
+
return new Promise(function (resolve) {
|
|
508
|
+
return setTimeout(resolve, 10);
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
case 3:
|
|
512
|
+
_context.next = 0;
|
|
513
|
+
break;
|
|
514
|
+
|
|
515
|
+
case 5:
|
|
516
|
+
locked = true;
|
|
517
|
+
thisIndex = index;
|
|
518
|
+
index += 1;
|
|
519
|
+
locked = false;
|
|
520
|
+
return _context.abrupt("return", thisIndex);
|
|
521
|
+
|
|
522
|
+
case 10:
|
|
523
|
+
case "end":
|
|
524
|
+
return _context.stop();
|
|
500
525
|
}
|
|
526
|
+
}
|
|
527
|
+
}, _callee);
|
|
528
|
+
}));
|
|
529
|
+
|
|
530
|
+
return function nextIndex() {
|
|
531
|
+
return _ref.apply(this, arguments);
|
|
532
|
+
};
|
|
533
|
+
}();
|
|
534
|
+
|
|
535
|
+
results = [];
|
|
536
|
+
active = 0;
|
|
537
|
+
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
538
|
+
_toConsumableArray(Array(limit || 1)).forEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
539
|
+
var index;
|
|
540
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
541
|
+
while (1) {
|
|
542
|
+
switch (_context2.prev = _context2.next) {
|
|
543
|
+
case 0:
|
|
544
|
+
active += 1;
|
|
545
|
+
_context2.next = 3;
|
|
546
|
+
return nextIndex();
|
|
547
|
+
|
|
548
|
+
case 3:
|
|
549
|
+
index = _context2.sent;
|
|
550
|
+
|
|
551
|
+
case 4:
|
|
552
|
+
if (!(index < array.length)) {
|
|
553
|
+
_context2.next = 19;
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
_context2.prev = 5;
|
|
558
|
+
_context2.next = 8;
|
|
559
|
+
return f(array[index], index);
|
|
560
|
+
|
|
561
|
+
case 8:
|
|
562
|
+
results[index] = _context2.sent;
|
|
563
|
+
_context2.next = 14;
|
|
564
|
+
break;
|
|
565
|
+
|
|
566
|
+
case 11:
|
|
567
|
+
_context2.prev = 11;
|
|
568
|
+
_context2.t0 = _context2["catch"](5);
|
|
569
|
+
reject(_context2.t0);
|
|
501
570
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
break;
|
|
510
|
-
|
|
511
|
-
case 5:
|
|
512
|
-
locked = true;
|
|
513
|
-
thisIndex = index;
|
|
514
|
-
index += 1;
|
|
515
|
-
locked = false;
|
|
516
|
-
return _context.abrupt("return", thisIndex);
|
|
517
|
-
|
|
518
|
-
case 10:
|
|
519
|
-
case "end":
|
|
520
|
-
return _context.stop();
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
results = [];
|
|
527
|
-
active = 0;
|
|
528
|
-
return _context3.abrupt("return", new Promise(function (resolve, reject) {
|
|
529
|
-
_toConsumableArray(Array(limit || 1)).forEach(function _callee() {
|
|
530
|
-
var index;
|
|
531
|
-
return _regeneratorRuntime.async(function _callee$(_context2) {
|
|
532
|
-
while (1) {
|
|
533
|
-
switch (_context2.prev = _context2.next) {
|
|
534
|
-
case 0:
|
|
535
|
-
active += 1;
|
|
536
|
-
_context2.next = 3;
|
|
537
|
-
return _regeneratorRuntime.awrap(nextIndex());
|
|
538
|
-
|
|
539
|
-
case 3:
|
|
540
|
-
index = _context2.sent;
|
|
541
|
-
|
|
542
|
-
case 4:
|
|
543
|
-
if (!(index < array.length)) {
|
|
544
|
-
_context2.next = 19;
|
|
571
|
+
case 14:
|
|
572
|
+
_context2.next = 16;
|
|
573
|
+
return nextIndex();
|
|
574
|
+
|
|
575
|
+
case 16:
|
|
576
|
+
index = _context2.sent;
|
|
577
|
+
_context2.next = 4;
|
|
545
578
|
break;
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
_context2.t0 = _context2["catch"](5);
|
|
560
|
-
reject(_context2.t0);
|
|
561
|
-
|
|
562
|
-
case 14:
|
|
563
|
-
_context2.next = 16;
|
|
564
|
-
return _regeneratorRuntime.awrap(nextIndex());
|
|
565
|
-
|
|
566
|
-
case 16:
|
|
567
|
-
index = _context2.sent;
|
|
568
|
-
_context2.next = 4;
|
|
569
|
-
break;
|
|
570
|
-
|
|
571
|
-
case 19:
|
|
572
|
-
// When finished and no more workers are active, resolve
|
|
573
|
-
active -= 1;
|
|
574
|
-
|
|
575
|
-
if (active === 0) {
|
|
576
|
-
resolve(results);
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
case 21:
|
|
580
|
-
case "end":
|
|
581
|
-
return _context2.stop();
|
|
579
|
+
|
|
580
|
+
case 19:
|
|
581
|
+
// When finished and no more workers are active, resolve
|
|
582
|
+
active -= 1;
|
|
583
|
+
|
|
584
|
+
if (active === 0) {
|
|
585
|
+
resolve(results);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
case 21:
|
|
589
|
+
case "end":
|
|
590
|
+
return _context2.stop();
|
|
591
|
+
}
|
|
582
592
|
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
593
|
+
}, _callee2, null, [[5, 11]]);
|
|
594
|
+
})));
|
|
595
|
+
}));
|
|
596
|
+
|
|
597
|
+
case 6:
|
|
598
|
+
case "end":
|
|
599
|
+
return _context3.stop();
|
|
600
|
+
}
|
|
591
601
|
}
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
602
|
+
}, _callee3);
|
|
603
|
+
}));
|
|
604
|
+
|
|
605
|
+
function LimitedMap(_x, _x2, _x3) {
|
|
606
|
+
return _LimitedMap.apply(this, arguments);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return LimitedMap;
|
|
610
|
+
}(),
|
|
611
|
+
ResponseToJson: function () {
|
|
612
|
+
var _ResponseToJson = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(response) {
|
|
613
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
614
|
+
while (1) {
|
|
615
|
+
switch (_context4.prev = _context4.next) {
|
|
616
|
+
case 0:
|
|
617
|
+
return _context4.abrupt("return", Utils.ResponseToFormat("json", response));
|
|
618
|
+
|
|
619
|
+
case 1:
|
|
620
|
+
case "end":
|
|
621
|
+
return _context4.stop();
|
|
622
|
+
}
|
|
605
623
|
}
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
switch (_context5.prev = _context5.next) {
|
|
613
|
-
case 0:
|
|
614
|
-
_context5.next = 2;
|
|
615
|
-
return _regeneratorRuntime.awrap(response);
|
|
624
|
+
}, _callee4);
|
|
625
|
+
}));
|
|
626
|
+
|
|
627
|
+
function ResponseToJson(_x4) {
|
|
628
|
+
return _ResponseToJson.apply(this, arguments);
|
|
629
|
+
}
|
|
616
630
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
631
|
+
return ResponseToJson;
|
|
632
|
+
}(),
|
|
633
|
+
ResponseToFormat: function () {
|
|
634
|
+
var _ResponseToFormat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(format, response) {
|
|
635
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
636
|
+
while (1) {
|
|
637
|
+
switch (_context5.prev = _context5.next) {
|
|
638
|
+
case 0:
|
|
639
|
+
_context5.next = 2;
|
|
640
|
+
return response;
|
|
622
641
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
642
|
+
case 2:
|
|
643
|
+
response = _context5.sent;
|
|
644
|
+
_context5.t0 = format.toLowerCase();
|
|
645
|
+
_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;
|
|
646
|
+
break;
|
|
626
647
|
|
|
627
|
-
|
|
628
|
-
|
|
648
|
+
case 6:
|
|
649
|
+
_context5.next = 8;
|
|
650
|
+
return response.json();
|
|
629
651
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
return _regeneratorRuntime.awrap(response.text());
|
|
652
|
+
case 8:
|
|
653
|
+
return _context5.abrupt("return", _context5.sent);
|
|
633
654
|
|
|
634
|
-
|
|
635
|
-
|
|
655
|
+
case 9:
|
|
656
|
+
_context5.next = 11;
|
|
657
|
+
return response.text();
|
|
636
658
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
return _regeneratorRuntime.awrap(response.blob());
|
|
659
|
+
case 11:
|
|
660
|
+
return _context5.abrupt("return", _context5.sent);
|
|
640
661
|
|
|
641
|
-
|
|
642
|
-
|
|
662
|
+
case 12:
|
|
663
|
+
_context5.next = 14;
|
|
664
|
+
return response.blob();
|
|
643
665
|
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
return _regeneratorRuntime.awrap(response.arrayBuffer());
|
|
666
|
+
case 14:
|
|
667
|
+
return _context5.abrupt("return", _context5.sent);
|
|
647
668
|
|
|
648
|
-
|
|
649
|
-
|
|
669
|
+
case 15:
|
|
670
|
+
_context5.next = 17;
|
|
671
|
+
return response.arrayBuffer();
|
|
650
672
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
return _regeneratorRuntime.awrap(response.formData());
|
|
673
|
+
case 17:
|
|
674
|
+
return _context5.abrupt("return", _context5.sent);
|
|
654
675
|
|
|
655
|
-
|
|
656
|
-
|
|
676
|
+
case 18:
|
|
677
|
+
_context5.next = 20;
|
|
678
|
+
return response.formData();
|
|
657
679
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
return _regeneratorRuntime.awrap(response.buffer());
|
|
680
|
+
case 20:
|
|
681
|
+
return _context5.abrupt("return", _context5.sent);
|
|
661
682
|
|
|
662
|
-
|
|
663
|
-
|
|
683
|
+
case 21:
|
|
684
|
+
_context5.next = 23;
|
|
685
|
+
return response.buffer();
|
|
664
686
|
|
|
665
|
-
|
|
666
|
-
|
|
687
|
+
case 23:
|
|
688
|
+
return _context5.abrupt("return", _context5.sent);
|
|
667
689
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
690
|
+
case 24:
|
|
691
|
+
return _context5.abrupt("return", response);
|
|
692
|
+
|
|
693
|
+
case 25:
|
|
694
|
+
case "end":
|
|
695
|
+
return _context5.stop();
|
|
696
|
+
}
|
|
671
697
|
}
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
|
|
698
|
+
}, _callee5);
|
|
699
|
+
}));
|
|
700
|
+
|
|
701
|
+
function ResponseToFormat(_x5, _x6) {
|
|
702
|
+
return _ResponseToFormat.apply(this, arguments);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
return ResponseToFormat;
|
|
706
|
+
}(),
|
|
675
707
|
|
|
676
708
|
/**
|
|
677
709
|
* Resize the image file or link URL to the specified maximum height. Can also be used to remove
|
|
@@ -682,9 +714,9 @@ var Utils = {
|
|
|
682
714
|
*
|
|
683
715
|
* @returns {string} - The modified URL with the height parameter
|
|
684
716
|
*/
|
|
685
|
-
ResizeImage: function ResizeImage(
|
|
686
|
-
var imageUrl =
|
|
687
|
-
height =
|
|
717
|
+
ResizeImage: function ResizeImage(_ref3) {
|
|
718
|
+
var imageUrl = _ref3.imageUrl,
|
|
719
|
+
height = _ref3.height;
|
|
688
720
|
|
|
689
721
|
if (!imageUrl || imageUrl && !imageUrl.startsWith("http")) {
|
|
690
722
|
return imageUrl;
|