@eluvio/elv-client-js 4.0.5 → 4.0.7
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 -11
- package/dist/ElvClient-node-min.js +12 -11
- package/dist/ElvFrameClient-min.js +12 -11
- package/dist/ElvPermissionsClient-min.js +10 -9
- package/dist/ElvWalletClient-min.js +12 -11
- package/dist/ElvWalletClient-node-min.js +11 -10
- package/dist/src/AuthorizationClient.js +1556 -2077
- package/dist/src/ContentObjectVerification.js +134 -185
- package/dist/src/Crypto.js +225 -322
- package/dist/src/ElvClient.js +823 -1117
- package/dist/src/ElvWallet.js +64 -106
- package/dist/src/EthClient.js +719 -974
- package/dist/src/FrameClient.js +222 -318
- package/dist/src/HttpClient.js +112 -154
- package/dist/src/Id.js +1 -6
- package/dist/src/LogMessage.js +4 -8
- package/dist/src/PermissionsClient.js +973 -1271
- package/dist/src/RemoteSigner.js +161 -232
- package/dist/src/UserProfileClient.js +781 -1038
- package/dist/src/Utils.js +160 -302
- package/dist/src/Validation.js +2 -17
- package/dist/src/client/ABRPublishing.js +772 -942
- package/dist/src/client/AccessGroups.js +849 -1095
- package/dist/src/client/ContentAccess.js +3263 -4132
- package/dist/src/client/ContentManagement.js +1811 -2283
- package/dist/src/client/Contracts.js +468 -614
- package/dist/src/client/Files.js +1505 -1845
- package/dist/src/client/NFT.js +94 -116
- package/dist/src/client/NTP.js +326 -425
- package/dist/src/index.js +2 -5
- package/dist/src/walletClient/ClientMethods.js +1348 -1735
- package/dist/src/walletClient/Configuration.js +4 -2
- package/dist/src/walletClient/Notifications.js +98 -127
- package/dist/src/walletClient/Profile.js +184 -246
- package/dist/src/walletClient/Utils.js +76 -122
- package/dist/src/walletClient/index.js +1168 -1493
- package/package.json +2 -2
- package/src/Crypto.js +1 -1
- package/src/ElvClient.js +1 -3
- package/src/Utils.js +1 -1
- package/testScripts/Test.js +0 -1
- package/utilities/NFTIngest.js +527 -0
- package/utilities/lib/concerns/LocalFile.js +2 -1
package/dist/src/Validation.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
var Utils = require("./Utils");
|
|
2
|
-
|
|
3
2
|
exports.ValidatePresence = function (name, thing) {
|
|
4
3
|
if (!thing) {
|
|
5
4
|
throw Error("".concat(name, " not specified"));
|
|
6
5
|
}
|
|
7
6
|
};
|
|
8
|
-
|
|
9
7
|
exports.ValidateLibrary = function (libraryId) {
|
|
10
8
|
if (!libraryId) {
|
|
11
9
|
throw Error("Library ID not specified");
|
|
@@ -13,7 +11,6 @@ exports.ValidateLibrary = function (libraryId) {
|
|
|
13
11
|
throw Error("Invalid library ID: ".concat(libraryId));
|
|
14
12
|
}
|
|
15
13
|
};
|
|
16
|
-
|
|
17
14
|
exports.ValidateObject = function (objectId) {
|
|
18
15
|
if (!objectId) {
|
|
19
16
|
throw Error("Object ID not specified");
|
|
@@ -21,7 +18,6 @@ exports.ValidateObject = function (objectId) {
|
|
|
21
18
|
throw Error("Invalid object ID: ".concat(objectId));
|
|
22
19
|
}
|
|
23
20
|
};
|
|
24
|
-
|
|
25
21
|
exports.ValidateVersion = function (versionHash) {
|
|
26
22
|
if (!versionHash) {
|
|
27
23
|
throw Error("Version hash not specified");
|
|
@@ -29,7 +25,6 @@ exports.ValidateVersion = function (versionHash) {
|
|
|
29
25
|
throw Error("Invalid version hash: ".concat(versionHash));
|
|
30
26
|
}
|
|
31
27
|
};
|
|
32
|
-
|
|
33
28
|
exports.ValidateWriteToken = function (writeToken) {
|
|
34
29
|
if (!writeToken) {
|
|
35
30
|
throw Error("Write token not specified");
|
|
@@ -37,7 +32,6 @@ exports.ValidateWriteToken = function (writeToken) {
|
|
|
37
32
|
throw Error("Invalid write token: ".concat(writeToken));
|
|
38
33
|
}
|
|
39
34
|
};
|
|
40
|
-
|
|
41
35
|
exports.ValidatePartHash = function (partHash) {
|
|
42
36
|
if (!partHash) {
|
|
43
37
|
throw Error("Part hash not specified");
|
|
@@ -45,12 +39,10 @@ exports.ValidatePartHash = function (partHash) {
|
|
|
45
39
|
throw Error("Invalid part hash: ".concat(partHash));
|
|
46
40
|
}
|
|
47
41
|
};
|
|
48
|
-
|
|
49
42
|
exports.ValidateParameters = function (_ref) {
|
|
50
43
|
var libraryId = _ref.libraryId,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
objectId = _ref.objectId,
|
|
45
|
+
versionHash = _ref.versionHash;
|
|
54
46
|
if (versionHash) {
|
|
55
47
|
exports.ValidateVersion(versionHash);
|
|
56
48
|
} else {
|
|
@@ -58,33 +50,26 @@ exports.ValidateParameters = function (_ref) {
|
|
|
58
50
|
exports.ValidateObject(objectId);
|
|
59
51
|
}
|
|
60
52
|
};
|
|
61
|
-
|
|
62
53
|
exports.ValidateAddress = function (address) {
|
|
63
54
|
if (!address) {
|
|
64
55
|
throw Error("Address not specified");
|
|
65
56
|
} else if (!/^(0x)?[0-9a-f]{40}$/i.test(address.toLowerCase())) {
|
|
66
57
|
throw Error("Invalid address: ".concat(address));
|
|
67
58
|
}
|
|
68
|
-
|
|
69
59
|
return Utils.FormatAddress(address);
|
|
70
60
|
};
|
|
71
|
-
|
|
72
61
|
exports.ValidatePermission = function (permission) {
|
|
73
62
|
if (permission && permission !== "full-access" && permission !== "no-access") {
|
|
74
63
|
throw Error("Invalid profile permission: ".concat(permission));
|
|
75
64
|
}
|
|
76
|
-
|
|
77
65
|
return permission;
|
|
78
66
|
};
|
|
79
|
-
|
|
80
67
|
exports.ValidateDate = function (date) {
|
|
81
68
|
if (!date) {
|
|
82
69
|
return;
|
|
83
70
|
}
|
|
84
|
-
|
|
85
71
|
if (isNaN(new Date(date))) {
|
|
86
72
|
throw Error("Invalid date: ".concat(date));
|
|
87
73
|
}
|
|
88
|
-
|
|
89
74
|
return new Date(date).getTime();
|
|
90
75
|
};
|