@eluvio/elv-client-js 4.0.143 → 4.0.145

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 (41) hide show
  1. package/dist/ElvClient-min.js +15 -14
  2. package/dist/ElvClient-node-min.js +14 -13
  3. package/dist/ElvFrameClient-min.js +10 -10
  4. package/dist/ElvPermissionsClient-min.js +9 -9
  5. package/dist/ElvWalletClient-min.js +15 -14
  6. package/dist/ElvWalletClient-node-min.js +14 -13
  7. package/dist/src/AuthorizationClient.js +11 -14
  8. package/dist/src/ContentObjectAudit.js +3 -3
  9. package/dist/src/ContentObjectVerification.js +3 -3
  10. package/dist/src/Crypto.js +2 -2
  11. package/dist/src/ElvClient.js +532 -401
  12. package/dist/src/ElvWallet.js +7 -5
  13. package/dist/src/EthClient.js +9 -10
  14. package/dist/src/FrameClient.js +10 -11
  15. package/dist/src/HttpClient.js +5 -5
  16. package/dist/src/Id.js +1 -2
  17. package/dist/src/PermissionsClient.js +31 -19
  18. package/dist/src/RemoteSigner.js +10 -11
  19. package/dist/src/UserProfileClient.js +35 -20
  20. package/dist/src/Utils.js +2 -3
  21. package/dist/src/Validation.js +10 -2
  22. package/dist/src/client/ABRPublishing.js +438 -238
  23. package/dist/src/client/AccessGroups.js +2 -2
  24. package/dist/src/client/ContentAccess.js +281 -344
  25. package/dist/src/client/ContentManagement.js +100 -84
  26. package/dist/src/client/Contracts.js +430 -2
  27. package/dist/src/client/Files.js +2 -2
  28. package/dist/src/client/LiveConf.js +43 -26
  29. package/dist/src/client/LiveStream.js +65 -63
  30. package/dist/src/client/NFT.js +2 -2
  31. package/dist/src/client/Shares.js +47 -24
  32. package/dist/src/walletClient/ClientMethods.js +2 -2
  33. package/dist/src/walletClient/Profile.js +2 -2
  34. package/dist/src/walletClient/Utils.js +2 -2
  35. package/dist/src/walletClient/index.js +359 -280
  36. package/package.json +2 -2
  37. package/src/FrameClient.js +1 -0
  38. package/src/Validation.js +9 -3
  39. package/src/client/ABRPublishing.js +176 -160
  40. package/src/client/Contracts.js +258 -0
  41. package/src/walletClient/index.js +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.143",
3
+ "version": "4.0.145",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -73,7 +73,7 @@
73
73
  "hash.js": "^1.1.7",
74
74
  "isarray": "^2.0.5",
75
75
  "js-polyfills": "^0.1.42",
76
- "jsonpath-plus": "^6.0.1",
76
+ "jsonpath-plus": "^10.3.0",
77
77
  "kind-of": "^6.0.3",
78
78
  "lodash": "^4.17.19",
79
79
  "lodash.isequal": "^4.5.0",
@@ -575,6 +575,7 @@ class FrameClient {
575
575
  "Profile",
576
576
  "ProfileMetadata",
577
577
  "PurchaseStatus",
578
+ "PurgeUrl",
578
579
  "PushNotification",
579
580
  "RejectMarketplaceOffer",
580
581
  "RemoveListing",
package/src/Validation.js CHANGED
@@ -30,11 +30,17 @@ exports.ValidateVersion = (versionHash) => {
30
30
  }
31
31
  };
32
32
 
33
- exports.ValidateWriteToken = (writeToken) => {
33
+ // Validates that write token is in valid format and is properly encoded.
34
+ // If objectId is also supplied, then write token's encoded object id is checked to make sure it matches
35
+ // the supplied object id.
36
+ exports.ValidateWriteToken = (writeToken, objectId = "") => {
34
37
  if(!writeToken) {
35
38
  throw Error("Write token not specified");
36
- } else if(!writeToken.toString().startsWith("t")) {
37
- throw Error(`Invalid write token: ${writeToken}`);
39
+ } else {
40
+ const decoded = Utils.DecodeWriteToken(writeToken);
41
+ if(objectId && objectId !== decoded.objectId) {
42
+ throw Error(`Object id (${objectId}) does not match the the id (${decoded.objectId}) decoded from write token (${writeToken})`);
43
+ }
38
44
  }
39
45
  };
40
46