@eluvio/elv-client-js 4.0.10 → 4.0.11

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