@eluvio/elv-client-js 4.0.4 → 4.0.6

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.
Files changed (45) hide show
  1. package/dist/ElvClient-min.js +12 -11
  2. package/dist/ElvClient-node-min.js +12 -17
  3. package/dist/ElvFrameClient-min.js +12 -11
  4. package/dist/ElvPermissionsClient-min.js +10 -9
  5. package/dist/ElvWalletClient-min.js +11 -10
  6. package/dist/ElvWalletClient-node-min.js +12 -17
  7. package/dist/src/AuthorizationClient.js +1556 -2077
  8. package/dist/src/ContentObjectVerification.js +134 -185
  9. package/dist/src/Crypto.js +225 -322
  10. package/dist/src/ElvClient.js +823 -1117
  11. package/dist/src/ElvWallet.js +64 -106
  12. package/dist/src/EthClient.js +719 -974
  13. package/dist/src/FrameClient.js +222 -318
  14. package/dist/src/HttpClient.js +112 -154
  15. package/dist/src/Id.js +1 -6
  16. package/dist/src/LogMessage.js +4 -8
  17. package/dist/src/PermissionsClient.js +973 -1271
  18. package/dist/src/RemoteSigner.js +161 -232
  19. package/dist/src/UserProfileClient.js +781 -1038
  20. package/dist/src/Utils.js +160 -302
  21. package/dist/src/Validation.js +2 -17
  22. package/dist/src/client/ABRPublishing.js +772 -942
  23. package/dist/src/client/AccessGroups.js +849 -1095
  24. package/dist/src/client/ContentAccess.js +3263 -4132
  25. package/dist/src/client/ContentManagement.js +1811 -2283
  26. package/dist/src/client/Contracts.js +468 -614
  27. package/dist/src/client/Files.js +1505 -1845
  28. package/dist/src/client/NFT.js +94 -116
  29. package/dist/src/client/NTP.js +326 -425
  30. package/dist/src/index.js +2 -5
  31. package/dist/src/walletClient/ClientMethods.js +1412 -1551
  32. package/dist/src/walletClient/Configuration.js +4 -2
  33. package/dist/src/walletClient/Notifications.js +98 -127
  34. package/dist/src/walletClient/Profile.js +184 -246
  35. package/dist/src/walletClient/Utils.js +76 -122
  36. package/dist/src/walletClient/index.js +1169 -1493
  37. package/package.json +3 -2
  38. package/src/Crypto.js +1 -1
  39. package/src/ElvClient.js +1 -3
  40. package/src/Utils.js +1 -1
  41. package/src/walletClient/ClientMethods.js +133 -11
  42. package/src/walletClient/index.js +1 -0
  43. package/testScripts/Test.js +0 -1
  44. package/utilities/NFTIngest.js +527 -0
  45. package/utilities/lib/concerns/LocalFile.js +2 -1
@@ -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
- objectId = _ref.objectId,
52
- versionHash = _ref.versionHash;
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
  };