@eluvio/elv-client-js 4.0.42 → 4.0.44
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 +12 -19
- package/dist/ElvClient-node-min.js +12 -19
- package/dist/ElvFrameClient-min.js +10 -17
- package/dist/ElvWalletClient-min.js +12 -19
- package/dist/ElvWalletClient-node-min.js +12 -19
- package/dist/src/Crypto.js +23 -22
- package/dist/src/ElvClient.js +61 -47
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/client/ABRPublishing.js +8 -2
- package/dist/src/client/ContentManagement.js +12 -3
- package/dist/src/client/Files.js +382 -330
- package/package.json +3 -2
- package/src/Crypto.js +6 -14
- package/src/ElvClient.js +10 -0
- package/src/FrameClient.js +2 -0
- package/src/client/ABRPublishing.js +2 -2
- package/src/client/ContentManagement.js +3 -3
- package/src/client/Files.js +23 -0
package/dist/src/Crypto.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
1
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
5
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
3
6
|
if (typeof globalThis.Buffer === "undefined") {
|
|
4
7
|
globalThis.Buffer = require("buffer/").Buffer;
|
|
5
8
|
}
|
|
6
9
|
var bs58 = require("bs58");
|
|
7
|
-
var Stream = require("stream");
|
|
10
|
+
var Stream = require("readable-stream");
|
|
8
11
|
var Utils = require("./Utils");
|
|
12
|
+
if (!globalThis.process) {
|
|
13
|
+
globalThis.process = require("process/browser");
|
|
14
|
+
}
|
|
9
15
|
if (typeof crypto === "undefined") {
|
|
10
16
|
var _crypto = require("crypto");
|
|
11
17
|
_crypto.getRandomValues = function (arr) {
|
|
@@ -13,18 +19,6 @@ if (typeof crypto === "undefined") {
|
|
|
13
19
|
};
|
|
14
20
|
globalThis.crypto = _crypto;
|
|
15
21
|
}
|
|
16
|
-
var _ElvCrypto;
|
|
17
|
-
switch (Utils.Platform()) {
|
|
18
|
-
case Utils.PLATFORM_REACT_NATIVE:
|
|
19
|
-
_ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.externals")["default"];
|
|
20
|
-
break;
|
|
21
|
-
case Utils.PLATFORM_WEB:
|
|
22
|
-
_ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.externals")["default"];
|
|
23
|
-
break;
|
|
24
|
-
default:
|
|
25
|
-
_ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.node")["default"];
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
22
|
|
|
29
23
|
/**
|
|
30
24
|
* @namespace
|
|
@@ -33,36 +27,43 @@ switch (Utils.Platform()) {
|
|
|
33
27
|
*/
|
|
34
28
|
var Crypto = {
|
|
35
29
|
ElvCrypto: function () {
|
|
36
|
-
var
|
|
30
|
+
var _ElvCrypto = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
31
|
+
var _ElvCrypto2;
|
|
37
32
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
38
33
|
while (1) switch (_context.prev = _context.next) {
|
|
39
34
|
case 0:
|
|
40
35
|
_context.prev = 0;
|
|
41
36
|
if (Crypto.elvCrypto) {
|
|
42
|
-
_context.next =
|
|
37
|
+
_context.next = 8;
|
|
43
38
|
break;
|
|
44
39
|
}
|
|
45
40
|
_context.next = 4;
|
|
46
|
-
return
|
|
41
|
+
return Promise.resolve().then(function () {
|
|
42
|
+
return _interopRequireWildcard(require("@eluvio/crypto"));
|
|
43
|
+
});
|
|
47
44
|
case 4:
|
|
45
|
+
_ElvCrypto2 = _context.sent["default"];
|
|
46
|
+
_context.next = 7;
|
|
47
|
+
return new _ElvCrypto2().init();
|
|
48
|
+
case 7:
|
|
48
49
|
Crypto.elvCrypto = _context.sent;
|
|
49
|
-
case 5:
|
|
50
|
-
return _context.abrupt("return", Crypto.elvCrypto);
|
|
51
50
|
case 8:
|
|
52
|
-
_context.
|
|
51
|
+
return _context.abrupt("return", Crypto.elvCrypto);
|
|
52
|
+
case 11:
|
|
53
|
+
_context.prev = 11;
|
|
53
54
|
_context.t0 = _context["catch"](0);
|
|
54
55
|
// eslint-disable-next-line no-console
|
|
55
56
|
console.error("Error initializing ElvCrypto:");
|
|
56
57
|
// eslint-disable-next-line no-console
|
|
57
58
|
console.error(_context.t0);
|
|
58
|
-
case
|
|
59
|
+
case 15:
|
|
59
60
|
case "end":
|
|
60
61
|
return _context.stop();
|
|
61
62
|
}
|
|
62
|
-
}, _callee, null, [[0,
|
|
63
|
+
}, _callee, null, [[0, 11]]);
|
|
63
64
|
}));
|
|
64
65
|
function ElvCrypto() {
|
|
65
|
-
return
|
|
66
|
+
return _ElvCrypto.apply(this, arguments);
|
|
66
67
|
}
|
|
67
68
|
return ElvCrypto;
|
|
68
69
|
}(),
|
package/dist/src/ElvClient.js
CHANGED
|
@@ -532,6 +532,20 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
532
532
|
configUrl: this.configUrl
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
+
}, {
|
|
536
|
+
key: "WriteTokenNodeUrl",
|
|
537
|
+
value: function WriteTokenNodeUrl(_ref7) {
|
|
538
|
+
var writeToken = _ref7.writeToken;
|
|
539
|
+
var nodeUrl = this.HttpClient.draftURIs[writeToken];
|
|
540
|
+
return nodeUrl ? nodeUrl.toString() : undefined;
|
|
541
|
+
}
|
|
542
|
+
}, {
|
|
543
|
+
key: "RecordWriteToken",
|
|
544
|
+
value: function RecordWriteToken(_ref8) {
|
|
545
|
+
var writeToken = _ref8.writeToken,
|
|
546
|
+
fabricNodeUrl = _ref8.fabricNodeUrl;
|
|
547
|
+
this.HttpClient.RecordWriteToken(writeToken, fabricNodeUrl);
|
|
548
|
+
}
|
|
535
549
|
|
|
536
550
|
/* Wallet and signers */
|
|
537
551
|
|
|
@@ -579,10 +593,10 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
579
593
|
*/
|
|
580
594
|
}, {
|
|
581
595
|
key: "SetSigner",
|
|
582
|
-
value: function SetSigner(
|
|
583
|
-
var signer =
|
|
584
|
-
|
|
585
|
-
reset =
|
|
596
|
+
value: function SetSigner(_ref9) {
|
|
597
|
+
var signer = _ref9.signer,
|
|
598
|
+
_ref9$reset = _ref9.reset,
|
|
599
|
+
reset = _ref9$reset === void 0 ? true : _ref9$reset;
|
|
586
600
|
this.staticToken = undefined;
|
|
587
601
|
signer.connect(this.ethClient.Provider());
|
|
588
602
|
signer.provider.pollingInterval = 500;
|
|
@@ -607,12 +621,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
607
621
|
}, {
|
|
608
622
|
key: "SetRemoteSigner",
|
|
609
623
|
value: function () {
|
|
610
|
-
var _SetRemoteSigner = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(
|
|
624
|
+
var _SetRemoteSigner = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref10) {
|
|
611
625
|
var idToken, authToken, tenantId, extraData, signerURIs, unsignedPublicAuth, signer;
|
|
612
626
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
613
627
|
while (1) switch (_context6.prev = _context6.next) {
|
|
614
628
|
case 0:
|
|
615
|
-
idToken =
|
|
629
|
+
idToken = _ref10.idToken, authToken = _ref10.authToken, tenantId = _ref10.tenantId, extraData = _ref10.extraData, signerURIs = _ref10.signerURIs, unsignedPublicAuth = _ref10.unsignedPublicAuth;
|
|
616
630
|
_context6.t0 = RemoteSigner;
|
|
617
631
|
_context6.t1 = signerURIs || this.authServiceURIs;
|
|
618
632
|
_context6.t2 = idToken;
|
|
@@ -664,12 +678,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
664
678
|
}, {
|
|
665
679
|
key: "SetSignerFromWeb3Provider",
|
|
666
680
|
value: function () {
|
|
667
|
-
var _SetSignerFromWeb3Provider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(
|
|
681
|
+
var _SetSignerFromWeb3Provider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref11) {
|
|
668
682
|
var provider, ethProvider;
|
|
669
683
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
670
684
|
while (1) switch (_context7.prev = _context7.next) {
|
|
671
685
|
case 0:
|
|
672
|
-
provider =
|
|
686
|
+
provider = _ref11.provider;
|
|
673
687
|
this.staticToken = undefined;
|
|
674
688
|
ethProvider = new Ethers.providers.Web3Provider(provider);
|
|
675
689
|
ethProvider.pollingInterval = 250;
|
|
@@ -709,12 +723,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
709
723
|
}, {
|
|
710
724
|
key: "CreateAccount",
|
|
711
725
|
value: function () {
|
|
712
|
-
var _CreateAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(
|
|
713
|
-
var tenantId, fundingToken,
|
|
726
|
+
var _CreateAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref12) {
|
|
727
|
+
var tenantId, fundingToken, _ref12$funds, funds, groupToken, wallet, signer;
|
|
714
728
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
715
729
|
while (1) switch (_context8.prev = _context8.next) {
|
|
716
730
|
case 0:
|
|
717
|
-
tenantId =
|
|
731
|
+
tenantId = _ref12.tenantId, fundingToken = _ref12.fundingToken, _ref12$funds = _ref12.funds, funds = _ref12$funds === void 0 ? 0.5 : _ref12$funds, groupToken = _ref12.groupToken;
|
|
718
732
|
if (!this.signer) {
|
|
719
733
|
wallet = this.GenerateWallet();
|
|
720
734
|
signer = wallet.AddAccountFromMnemonic({
|
|
@@ -786,16 +800,16 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
786
800
|
}, {
|
|
787
801
|
key: "PersonalSign",
|
|
788
802
|
value: function () {
|
|
789
|
-
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(
|
|
803
|
+
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref13) {
|
|
790
804
|
var _this = this;
|
|
791
805
|
var message, addEthereumPrefix, Sign;
|
|
792
806
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
793
807
|
while (1) switch (_context10.prev = _context10.next) {
|
|
794
808
|
case 0:
|
|
795
|
-
message =
|
|
809
|
+
message = _ref13.message, addEthereumPrefix = _ref13.addEthereumPrefix, Sign = _ref13.Sign;
|
|
796
810
|
if (!Sign) {
|
|
797
811
|
Sign = /*#__PURE__*/function () {
|
|
798
|
-
var
|
|
812
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(message) {
|
|
799
813
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
800
814
|
while (1) switch (_context9.prev = _context9.next) {
|
|
801
815
|
case 0:
|
|
@@ -807,7 +821,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
807
821
|
}, _callee9);
|
|
808
822
|
}));
|
|
809
823
|
return function Sign(_x7) {
|
|
810
|
-
return
|
|
824
|
+
return _ref14.apply(this, arguments);
|
|
811
825
|
};
|
|
812
826
|
}();
|
|
813
827
|
}
|
|
@@ -844,14 +858,14 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
844
858
|
key: "CreateFabricToken",
|
|
845
859
|
value: function () {
|
|
846
860
|
var _CreateFabricToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
847
|
-
var
|
|
848
|
-
|
|
861
|
+
var _ref15,
|
|
862
|
+
_ref15$duration,
|
|
849
863
|
duration,
|
|
850
|
-
|
|
864
|
+
_ref15$spec,
|
|
851
865
|
spec,
|
|
852
866
|
address,
|
|
853
867
|
Sign,
|
|
854
|
-
|
|
868
|
+
_ref15$addEthereumPre,
|
|
855
869
|
addEthereumPrefix,
|
|
856
870
|
token,
|
|
857
871
|
message,
|
|
@@ -861,7 +875,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
861
875
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
862
876
|
while (1) switch (_context11.prev = _context11.next) {
|
|
863
877
|
case 0:
|
|
864
|
-
|
|
878
|
+
_ref15 = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {}, _ref15$duration = _ref15.duration, duration = _ref15$duration === void 0 ? 24 * 60 * 60 * 1000 : _ref15$duration, _ref15$spec = _ref15.spec, spec = _ref15$spec === void 0 ? {} : _ref15$spec, address = _ref15.address, Sign = _ref15.Sign, _ref15$addEthereumPre = _ref15.addEthereumPrefix, addEthereumPrefix = _ref15$addEthereumPre === void 0 ? true : _ref15$addEthereumPre;
|
|
865
879
|
address = address || this.CurrentAccountAddress();
|
|
866
880
|
_context11.t0 = _objectSpread;
|
|
867
881
|
_context11.t1 = _objectSpread({}, spec);
|
|
@@ -923,12 +937,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
923
937
|
}, {
|
|
924
938
|
key: "CreateSignedToken",
|
|
925
939
|
value: function () {
|
|
926
|
-
var _CreateSignedToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(
|
|
927
|
-
var libraryId, objectId, versionHash, policyId, subject,
|
|
940
|
+
var _CreateSignedToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref16) {
|
|
941
|
+
var libraryId, objectId, versionHash, policyId, subject, _ref16$grantType, grantType, _ref16$allowDecryptio, allowDecryption, duration, _ref16$context, context, token, cap, compressedToken, signature;
|
|
928
942
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
929
943
|
while (1) switch (_context12.prev = _context12.next) {
|
|
930
944
|
case 0:
|
|
931
|
-
libraryId =
|
|
945
|
+
libraryId = _ref16.libraryId, objectId = _ref16.objectId, versionHash = _ref16.versionHash, policyId = _ref16.policyId, subject = _ref16.subject, _ref16$grantType = _ref16.grantType, grantType = _ref16$grantType === void 0 ? "read" : _ref16$grantType, _ref16$allowDecryptio = _ref16.allowDecryption, allowDecryption = _ref16$allowDecryptio === void 0 ? false : _ref16$allowDecryptio, duration = _ref16.duration, _ref16$context = _ref16.context, context = _ref16$context === void 0 ? {} : _ref16$context;
|
|
932
946
|
if (subject) {
|
|
933
947
|
_context12.next = 9;
|
|
934
948
|
break;
|
|
@@ -1043,12 +1057,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1043
1057
|
}, {
|
|
1044
1058
|
key: "SetOauthToken",
|
|
1045
1059
|
value: function () {
|
|
1046
|
-
var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(
|
|
1060
|
+
var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref17) {
|
|
1047
1061
|
var token, wallet, signer;
|
|
1048
1062
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1049
1063
|
while (1) switch (_context13.prev = _context13.next) {
|
|
1050
1064
|
case 0:
|
|
1051
|
-
token =
|
|
1065
|
+
token = _ref17.token;
|
|
1052
1066
|
this.oauthToken = token;
|
|
1053
1067
|
wallet = this.GenerateWallet();
|
|
1054
1068
|
signer = wallet.AddAccountFromMnemonic({
|
|
@@ -1081,12 +1095,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1081
1095
|
}, {
|
|
1082
1096
|
key: "SetSignerFromOauthToken",
|
|
1083
1097
|
value: function () {
|
|
1084
|
-
var _SetSignerFromOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(
|
|
1098
|
+
var _SetSignerFromOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref18) {
|
|
1085
1099
|
var token, wallet, client, _yield$client$authCli, urls, path, httpClient, response, privateKey;
|
|
1086
1100
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
1087
1101
|
while (1) switch (_context14.prev = _context14.next) {
|
|
1088
1102
|
case 0:
|
|
1089
|
-
token =
|
|
1103
|
+
token = _ref18.token;
|
|
1090
1104
|
if (this.trustAuthorityId) {
|
|
1091
1105
|
_context14.next = 3;
|
|
1092
1106
|
break;
|
|
@@ -1185,8 +1199,8 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1185
1199
|
}, {
|
|
1186
1200
|
key: "SetStaticToken",
|
|
1187
1201
|
value: function SetStaticToken() {
|
|
1188
|
-
var
|
|
1189
|
-
token =
|
|
1202
|
+
var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1203
|
+
token = _ref19.token;
|
|
1190
1204
|
if (!token) {
|
|
1191
1205
|
token = this.utils.B64(JSON.stringify({
|
|
1192
1206
|
qspace_id: this.contentSpaceId
|
|
@@ -1216,12 +1230,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1216
1230
|
}, {
|
|
1217
1231
|
key: "SetPolicyAuthorization",
|
|
1218
1232
|
value: function () {
|
|
1219
|
-
var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(
|
|
1233
|
+
var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref20) {
|
|
1220
1234
|
var objectId;
|
|
1221
1235
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
1222
1236
|
while (1) switch (_context15.prev = _context15.next) {
|
|
1223
1237
|
case 0:
|
|
1224
|
-
objectId =
|
|
1238
|
+
objectId = _ref20.objectId;
|
|
1225
1239
|
_context15.t0 = this;
|
|
1226
1240
|
_context15.next = 4;
|
|
1227
1241
|
return this.GenerateStateChannelToken({
|
|
@@ -1286,12 +1300,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1286
1300
|
}, {
|
|
1287
1301
|
key: "EncryptECIES",
|
|
1288
1302
|
value: function () {
|
|
1289
|
-
var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(
|
|
1303
|
+
var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref21) {
|
|
1290
1304
|
var message, publicKey;
|
|
1291
1305
|
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1292
1306
|
while (1) switch (_context17.prev = _context17.next) {
|
|
1293
1307
|
case 0:
|
|
1294
|
-
message =
|
|
1308
|
+
message = _ref21.message, publicKey = _ref21.publicKey;
|
|
1295
1309
|
if (this.signer) {
|
|
1296
1310
|
_context17.next = 3;
|
|
1297
1311
|
break;
|
|
@@ -1325,12 +1339,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1325
1339
|
}, {
|
|
1326
1340
|
key: "DecryptECIES",
|
|
1327
1341
|
value: function () {
|
|
1328
|
-
var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(
|
|
1342
|
+
var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref22) {
|
|
1329
1343
|
var message;
|
|
1330
1344
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1331
1345
|
while (1) switch (_context18.prev = _context18.next) {
|
|
1332
1346
|
case 0:
|
|
1333
|
-
message =
|
|
1347
|
+
message = _ref22.message;
|
|
1334
1348
|
if (this.signer) {
|
|
1335
1349
|
_context18.next = 3;
|
|
1336
1350
|
break;
|
|
@@ -1367,12 +1381,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1367
1381
|
}, {
|
|
1368
1382
|
key: "Request",
|
|
1369
1383
|
value: function () {
|
|
1370
|
-
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(
|
|
1371
|
-
var url,
|
|
1384
|
+
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref23) {
|
|
1385
|
+
var url, _ref23$format, format, _ref23$method, method, _ref23$headers, headers, body;
|
|
1372
1386
|
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1373
1387
|
while (1) switch (_context19.prev = _context19.next) {
|
|
1374
1388
|
case 0:
|
|
1375
|
-
url =
|
|
1389
|
+
url = _ref23.url, _ref23$format = _ref23.format, format = _ref23$format === void 0 ? "json" : _ref23$format, _ref23$method = _ref23.method, method = _ref23$method === void 0 ? "GET" : _ref23$method, _ref23$headers = _ref23.headers, headers = _ref23$headers === void 0 ? {} : _ref23$headers, body = _ref23.body;
|
|
1376
1390
|
return _context19.abrupt("return", this.utils.ResponseToFormat(format, HttpClient.Fetch(url, {
|
|
1377
1391
|
method: method,
|
|
1378
1392
|
headers: headers,
|
|
@@ -1515,12 +1529,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1515
1529
|
}], [{
|
|
1516
1530
|
key: "Configuration",
|
|
1517
1531
|
value: function () {
|
|
1518
|
-
var _Configuration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(
|
|
1519
|
-
var configUrl,
|
|
1532
|
+
var _Configuration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref24) {
|
|
1533
|
+
var configUrl, _ref24$kmsUrls, kmsUrls, region, clientIP, uri, fabricInfo, filterHTTPS, fabricURIs, ethereumURIs, authServiceURIs, searchURIs, fabricVersion;
|
|
1520
1534
|
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1521
1535
|
while (1) switch (_context21.prev = _context21.next) {
|
|
1522
1536
|
case 0:
|
|
1523
|
-
configUrl =
|
|
1537
|
+
configUrl = _ref24.configUrl, _ref24$kmsUrls = _ref24.kmsUrls, kmsUrls = _ref24$kmsUrls === void 0 ? [] : _ref24$kmsUrls, region = _ref24.region, clientIP = _ref24.clientIP;
|
|
1524
1538
|
_context21.prev = 1;
|
|
1525
1539
|
uri = new URI(configUrl);
|
|
1526
1540
|
uri.pathname("/config");
|
|
@@ -1602,12 +1616,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1602
1616
|
}, {
|
|
1603
1617
|
key: "FromNetworkName",
|
|
1604
1618
|
value: function () {
|
|
1605
|
-
var _FromNetworkName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(
|
|
1606
|
-
var networkName, region, clientIP, trustAuthorityId, staticToken,
|
|
1619
|
+
var _FromNetworkName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(_ref25) {
|
|
1620
|
+
var networkName, region, clientIP, trustAuthorityId, staticToken, _ref25$ethereumContra, ethereumContractTimeout, _ref25$noCache, noCache, _ref25$noAuth, noAuth, assumeV3, configUrl;
|
|
1607
1621
|
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
1608
1622
|
while (1) switch (_context22.prev = _context22.next) {
|
|
1609
1623
|
case 0:
|
|
1610
|
-
networkName =
|
|
1624
|
+
networkName = _ref25.networkName, region = _ref25.region, clientIP = _ref25.clientIP, trustAuthorityId = _ref25.trustAuthorityId, staticToken = _ref25.staticToken, _ref25$ethereumContra = _ref25.ethereumContractTimeout, ethereumContractTimeout = _ref25$ethereumContra === void 0 ? 10 : _ref25$ethereumContra, _ref25$noCache = _ref25.noCache, noCache = _ref25$noCache === void 0 ? false : _ref25$noCache, _ref25$noAuth = _ref25.noAuth, noAuth = _ref25$noAuth === void 0 ? false : _ref25$noAuth, assumeV3 = _ref25.assumeV3;
|
|
1611
1625
|
configUrl = networks[networkName];
|
|
1612
1626
|
if (configUrl) {
|
|
1613
1627
|
_context22.next = 4;
|
|
@@ -1659,12 +1673,12 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1659
1673
|
}, {
|
|
1660
1674
|
key: "FromConfigurationUrl",
|
|
1661
1675
|
value: function () {
|
|
1662
|
-
var _FromConfigurationUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(
|
|
1663
|
-
var configUrl, region, clientIP, trustAuthorityId, staticToken,
|
|
1676
|
+
var _FromConfigurationUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref26) {
|
|
1677
|
+
var configUrl, region, clientIP, trustAuthorityId, staticToken, _ref26$ethereumContra, ethereumContractTimeout, _ref26$noCache, noCache, _ref26$noAuth, noAuth, _ref26$assumeV, assumeV3, _yield$ElvClient$Conf3, contentSpaceId, networkId, networkName, fabricURIs, ethereumURIs, authServiceURIs, searchURIs, fabricVersion, client;
|
|
1664
1678
|
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1665
1679
|
while (1) switch (_context23.prev = _context23.next) {
|
|
1666
1680
|
case 0:
|
|
1667
|
-
configUrl =
|
|
1681
|
+
configUrl = _ref26.configUrl, region = _ref26.region, clientIP = _ref26.clientIP, trustAuthorityId = _ref26.trustAuthorityId, staticToken = _ref26.staticToken, _ref26$ethereumContra = _ref26.ethereumContractTimeout, ethereumContractTimeout = _ref26$ethereumContra === void 0 ? 10 : _ref26$ethereumContra, _ref26$noCache = _ref26.noCache, noCache = _ref26$noCache === void 0 ? false : _ref26$noCache, _ref26$noAuth = _ref26.noAuth, noAuth = _ref26$noAuth === void 0 ? false : _ref26$noAuth, _ref26$assumeV = _ref26.assumeV3, assumeV3 = _ref26$assumeV === void 0 ? false : _ref26$assumeV;
|
|
1668
1682
|
_context23.next = 3;
|
|
1669
1683
|
return ElvClient.Configuration({
|
|
1670
1684
|
configUrl: configUrl,
|
package/dist/src/FrameClient.js
CHANGED
|
@@ -449,7 +449,7 @@ var FrameClient = /*#__PURE__*/function () {
|
|
|
449
449
|
}, {
|
|
450
450
|
key: "AllowedMethods",
|
|
451
451
|
value: function AllowedMethods() {
|
|
452
|
-
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateSignedToken", "CurrentAccountAddress", "CustomContractAddress", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RedeemCode", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetVisibility", "SetPermission", "StartABRMezzanineJobs", "SuspendNTPInstance", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "VerifyContentObject", "Visibility"];
|
|
452
|
+
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateSignedToken", "CurrentAccountAddress", "CustomContractAddress", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetVisibility", "SetPermission", "StartABRMezzanineJobs", "SuspendNTPInstance", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "VerifyContentObject", "Visibility"];
|
|
453
453
|
}
|
|
454
454
|
}, {
|
|
455
455
|
key: "AllowedUserProfileMethods",
|
|
@@ -855,7 +855,10 @@ exports.LROStatus = /*#__PURE__*/function () {
|
|
|
855
855
|
});
|
|
856
856
|
case 4:
|
|
857
857
|
lroDraft = _context6.sent;
|
|
858
|
-
this.
|
|
858
|
+
this.RecordWriteToken({
|
|
859
|
+
writeToken: lroDraft.write_token,
|
|
860
|
+
fabricNodeUrl: lroDraft.node
|
|
861
|
+
});
|
|
859
862
|
_context6.next = 8;
|
|
860
863
|
return this.ContentObjectMetadata({
|
|
861
864
|
libraryId: libraryId,
|
|
@@ -908,7 +911,10 @@ exports.FinalizeABRMezzanine = /*#__PURE__*/function () {
|
|
|
908
911
|
case 4:
|
|
909
912
|
lroDraft = _context7.sent;
|
|
910
913
|
// tell http client what node to contact for this write token
|
|
911
|
-
this.
|
|
914
|
+
this.RecordWriteToken({
|
|
915
|
+
writeToken: lroDraft.write_token,
|
|
916
|
+
fabricNodeUrl: lroDraft.node
|
|
917
|
+
});
|
|
912
918
|
_context7.next = 8;
|
|
913
919
|
return this.ContentObjectMetadata({
|
|
914
920
|
libraryId: libraryId,
|
|
@@ -334,7 +334,10 @@ exports.CreateContentType = /*#__PURE__*/function () {
|
|
|
334
334
|
case 25:
|
|
335
335
|
createResponse = _context4.sent;
|
|
336
336
|
// Record the node used in creating this write token
|
|
337
|
-
this.
|
|
337
|
+
this.RecordWriteToken({
|
|
338
|
+
writeToken: createResponse.write_token,
|
|
339
|
+
fabricNodeUrl: nodeUrl
|
|
340
|
+
});
|
|
338
341
|
_context4.next = 29;
|
|
339
342
|
return this.ReplaceMetadata({
|
|
340
343
|
libraryId: this.contentSpaceLibraryId,
|
|
@@ -963,7 +966,10 @@ exports.CreateContentObject = /*#__PURE__*/function () {
|
|
|
963
966
|
case 69:
|
|
964
967
|
createResponse = _context11.sent;
|
|
965
968
|
// Record the node used in creating this write token
|
|
966
|
-
this.
|
|
969
|
+
this.RecordWriteToken({
|
|
970
|
+
writeToken: createResponse.write_token,
|
|
971
|
+
fabricNodeUrl: nodeUrl
|
|
972
|
+
});
|
|
967
973
|
createResponse.writeToken = createResponse.write_token;
|
|
968
974
|
createResponse.objectId = createResponse.id;
|
|
969
975
|
createResponse.nodeUrl = nodeUrl;
|
|
@@ -1304,7 +1310,10 @@ exports.EditContentObject = /*#__PURE__*/function () {
|
|
|
1304
1310
|
case 37:
|
|
1305
1311
|
editResponse = _context15.sent;
|
|
1306
1312
|
// Record the node used in creating this write token
|
|
1307
|
-
this.
|
|
1313
|
+
this.RecordWriteToken({
|
|
1314
|
+
writeToken: editResponse.write_token,
|
|
1315
|
+
fabricNodeUrl: nodeUrl
|
|
1316
|
+
});
|
|
1308
1317
|
editResponse.writeToken = editResponse.write_token;
|
|
1309
1318
|
editResponse.objectId = editResponse.id;
|
|
1310
1319
|
editResponse.nodeUrl = nodeUrl;
|