@eluvio/elv-client-js 4.0.9 → 4.0.10

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 +11 -10
  2. package/dist/ElvClient-node-min.js +11 -10
  3. package/dist/ElvFrameClient-min.js +11 -10
  4. package/dist/ElvPermissionsClient-min.js +10 -9
  5. package/dist/ElvWalletClient-min.js +10 -9
  6. package/dist/ElvWalletClient-node-min.js +10 -9
  7. package/dist/src/AuthorizationClient.js +1556 -2077
  8. package/dist/src/ContentObjectVerification.js +134 -185
  9. package/dist/src/Crypto.js +224 -319
  10. package/dist/src/ElvClient.js +822 -1114
  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 +159 -299
  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 +3322 -4195
  25. package/dist/src/client/ContentManagement.js +1817 -2286
  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 +1368 -1763
  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 +1171 -1496
  37. package/package.json +1 -1
  38. package/src/client/ContentManagement.js +24 -29
  39. package/testScripts/CreateMezMonolithic.js +779 -0
  40. package/utilities/ListAccessGroups.js +34 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.9",
3
+ "version": "4.0.10",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -174,20 +174,20 @@ exports.CreateContentType = async function({name, metadata={}, bitcode}) {
174
174
  this.Log(`Created type: ${contractAddress} ${objectId}`);
175
175
 
176
176
  /* Create object, upload bitcode and finalize */
177
- const createResponse = await this.utils.ResponseToJson(
178
- this.HttpClient.Request({
179
- headers: await this.authClient.AuthorizationHeader({
180
- libraryId: this.contentSpaceLibraryId,
181
- objectId,
182
- update: true
183
- }),
184
- method: "POST",
185
- path: path
186
- })
187
- );
177
+ const rawCreateResponse = await this.HttpClient.Request({
178
+ headers: await this.authClient.AuthorizationHeader({
179
+ libraryId: this.contentSpaceLibraryId,
180
+ objectId,
181
+ update: true
182
+ }),
183
+ method: "POST",
184
+ path: path
185
+ });
186
+ const nodeUrl = (new URL(rawCreateResponse.url)).origin;
187
+ const createResponse = await this.utils.ResponseToJson(rawCreateResponse);
188
188
 
189
189
  // Record the node used in creating this write token
190
- this.HttpClient.RecordWriteToken(createResponse.write_token);
190
+ this.HttpClient.RecordWriteToken(createResponse.write_token, nodeUrl);
191
191
 
192
192
  await this.ReplaceMetadata({
193
193
  libraryId: this.contentSpaceLibraryId,
@@ -605,20 +605,21 @@ exports.CreateContentObject = async function({libraryId, objectId, options={}})
605
605
 
606
606
  const path = UrlJoin("qid", objectId);
607
607
 
608
- let createResponse = await this.utils.ResponseToJson(
609
- this.HttpClient.Request({
610
- headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true}),
611
- method: "POST",
612
- path: path,
613
- body: options
614
- })
615
- );
608
+ const rawCreateResponse = await this.HttpClient.Request({
609
+ headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true}),
610
+ method: "POST",
611
+ path: path,
612
+ body: options
613
+ });
614
+ const nodeUrl = (new URL(rawCreateResponse.url)).origin;
615
+ const createResponse = await this.utils.ResponseToJson(rawCreateResponse);
616
616
 
617
617
  // Record the node used in creating this write token
618
- this.HttpClient.RecordWriteToken(createResponse.write_token);
618
+ this.HttpClient.RecordWriteToken(createResponse.write_token, nodeUrl);
619
619
 
620
620
  createResponse.writeToken = createResponse.write_token;
621
621
  createResponse.objectId = createResponse.id;
622
+ createResponse.nodeUrl = nodeUrl;
622
623
 
623
624
  return createResponse;
624
625
  };
@@ -780,14 +781,8 @@ exports.EditContentObject = async function({libraryId, objectId, options={}}) {
780
781
  path: path,
781
782
  body: options
782
783
  });
783
-
784
- const actualUrl = new URL(rawEditResponse.url);
785
- actualUrl.pathname = "";
786
- actualUrl.search = "";
787
- actualUrl.hash = "";
788
- const nodeUrl = actualUrl.href;
789
-
790
- let editResponse = await this.utils.ResponseToJson(rawEditResponse);
784
+ const nodeUrl = (new URL(rawEditResponse.url)).origin;
785
+ const editResponse = await this.utils.ResponseToJson(rawEditResponse);
791
786
 
792
787
  // Record the node used in creating this write token
793
788
  this.HttpClient.RecordWriteToken(editResponse.write_token, nodeUrl);