@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.10",
3
+ "version": "4.0.11",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -116,6 +116,7 @@ class AuthorizationClient {
116
116
  audienceData,
117
117
  context,
118
118
  update=false,
119
+ makeAccessRequest=false,
119
120
  channelAuth=false,
120
121
  oauthToken,
121
122
  noCache=false,
@@ -171,7 +172,7 @@ class AuthorizationClient {
171
172
  partHash,
172
173
  encryption,
173
174
  update,
174
- noAuth
175
+ makeAccessRequest
175
176
  });
176
177
  }
177
178
 
@@ -183,7 +184,7 @@ class AuthorizationClient {
183
184
  }
184
185
  }
185
186
 
186
- async GenerateAuthorizationToken({libraryId, objectId, versionHash, partHash, encryption, update=false, noAuth=false}) {
187
+ async GenerateAuthorizationToken({libraryId, objectId, versionHash, partHash, encryption, update=false, makeAccessRequest=false}) {
187
188
  if(versionHash) { objectId = Utils.DecodeVersionHash(versionHash).objectId; }
188
189
 
189
190
  // Generate AFGH public key if encryption is specified
@@ -204,15 +205,14 @@ class AuthorizationClient {
204
205
  addr: Utils.FormatAddress(((this.client.signer && this.client.signer.address) || ""))
205
206
  };
206
207
 
207
- if(update) {
208
+ if(update || makeAccessRequest) {
208
209
  const { transactionHash } = await this.MakeAccessRequest({
209
210
  libraryId,
210
211
  objectId,
211
212
  versionHash,
212
213
  update,
213
214
  publicKey,
214
- noCache: this.noCache,
215
- noAuth: this.noAuth || noAuth
215
+ noCache: this.noCache
216
216
  });
217
217
 
218
218
  if(transactionHash) {
@@ -809,7 +809,7 @@ exports.DownloadPart = async function({
809
809
  const encryption = encrypted ? "cgck" : undefined;
810
810
  const path = UrlJoin("q", writeToken || versionHash || objectId, "data", partHash);
811
811
 
812
- let headers = await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash, encryption});
812
+ let headers = await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash, encryption, makeAccessRequest: true});
813
813
 
814
814
  const bytesTotal = (await this.ContentPart({libraryId, objectId, versionHash, partHash})).part.size;
815
815