@eluvio/elv-client-js 4.0.89 → 4.0.90

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 +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 +9 -12
  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 +47 -28
  12. package/dist/src/ElvWallet.js +7 -5
  13. package/dist/src/EthClient.js +8 -9
  14. package/dist/src/FrameClient.js +8 -9
  15. package/dist/src/HttpClient.js +27 -4
  16. package/dist/src/Id.js +1 -2
  17. package/dist/src/PermissionsClient.js +31 -19
  18. package/dist/src/RemoteSigner.js +6 -8
  19. package/dist/src/UserProfileClient.js +35 -19
  20. package/dist/src/Utils.js +62 -28
  21. package/dist/src/client/ABRPublishing.js +2 -2
  22. package/dist/src/client/AccessGroups.js +2 -2
  23. package/dist/src/client/ContentAccess.js +104 -104
  24. package/dist/src/client/ContentManagement.js +25 -23
  25. package/dist/src/client/Contracts.js +2 -2
  26. package/dist/src/client/Files.js +77 -88
  27. package/dist/src/client/LiveConf.js +3 -7
  28. package/dist/src/client/LiveStream.js +35 -36
  29. package/dist/src/client/NFT.js +2 -2
  30. package/dist/src/walletClient/ClientMethods.js +2 -2
  31. package/dist/src/walletClient/Profile.js +2 -2
  32. package/dist/src/walletClient/Utils.js +2 -2
  33. package/dist/src/walletClient/index.js +17 -14
  34. package/package.json +1 -1
  35. package/src/HttpClient.js +16 -2
  36. package/src/Utils.js +27 -5
  37. package/src/client/ContentAccess.js +63 -80
  38. package/src/client/ContentManagement.js +25 -11
  39. package/src/client/Files.js +43 -51
  40. package/src/client/LiveStream.js +5 -1
@@ -45,13 +45,11 @@ exports.ListFiles = async function({libraryId, objectId, path = "", versionHash,
45
45
 
46
46
  let urlPath = UrlJoin("q", writeToken || versionHash || objectId, "files_list", path);
47
47
 
48
- return this.utils.ResponseToJson(
49
- this.HttpClient.Request({
50
- headers: await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash}),
51
- method: "GET",
52
- path: urlPath,
53
- })
54
- );
48
+ return this.HttpClient.RequestJsonBody({
49
+ headers: await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash}),
50
+ method: "GET",
51
+ path: urlPath,
52
+ });
55
53
  };
56
54
 
57
55
  /**
@@ -121,7 +119,11 @@ exports.UploadFilesFromS3 = async function({
121
119
  }
122
120
  }
123
121
 
124
- this.Log(`Uploading files from S3: ${libraryId} ${objectId} ${writeToken}`);
122
+ if(copy) {
123
+ this.Log(`Copying files from S3: ${libraryId} ${objectId} ${writeToken}`);
124
+ } else {
125
+ this.Log(`Adding links to files in S3: ${libraryId} ${objectId} ${writeToken}`);
126
+ }
125
127
 
126
128
  let encryption_key;
127
129
  if(encryption === "cgck") {
@@ -485,15 +487,13 @@ exports.CreateFileUploadJob = async function({libraryId, objectId, writeToken, o
485
487
 
486
488
  const path = UrlJoin("q", writeToken, "file_jobs");
487
489
 
488
- return this.utils.ResponseToJson(
489
- this.HttpClient.Request({
490
- headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true, encryption}),
491
- method: "POST",
492
- path: path,
493
- body,
494
- allowFailover: false
495
- })
496
- );
490
+ return this.HttpClient.RequestJsonBody({
491
+ headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true, encryption}),
492
+ method: "POST",
493
+ path: path,
494
+ body,
495
+ allowFailover: false
496
+ });
497
497
  };
498
498
 
499
499
  exports.UploadStatus = async function({libraryId, objectId, writeToken, uploadId}) {
@@ -815,13 +815,11 @@ exports.ContentParts = async function({libraryId, objectId, versionHash}) {
815
815
 
816
816
  const path = UrlJoin("q", versionHash || objectId, "parts");
817
817
 
818
- const response = await this.utils.ResponseToJson(
819
- this.HttpClient.Request({
820
- headers: await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash}),
821
- method: "GET",
822
- path: path
823
- })
824
- );
818
+ const response = await this.HttpClient.RequestJsonBody({
819
+ headers: await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash}),
820
+ method: "GET",
821
+ path: path
822
+ });
825
823
 
826
824
  return response.parts;
827
825
  };
@@ -849,13 +847,11 @@ exports.ContentPart = async function({libraryId, objectId, versionHash, partHash
849
847
 
850
848
  let path = UrlJoin("q", versionHash || objectId, "parts", partHash);
851
849
 
852
- return await this.utils.ResponseToJson(
853
- this.HttpClient.Request({
854
- headers: await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash}),
855
- method: "GET",
856
- path: path
857
- })
858
- );
850
+ return await this.HttpClient.RequestJsonBody({
851
+ headers: await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash}),
852
+ method: "GET",
853
+ path: path
854
+ });
859
855
  };
860
856
 
861
857
  /**
@@ -1079,16 +1075,14 @@ exports.CreatePart = async function({libraryId, objectId, writeToken, encryption
1079
1075
 
1080
1076
  const path = UrlJoin("q", writeToken, "parts");
1081
1077
 
1082
- const openResponse = await this.utils.ResponseToJson(
1083
- this.HttpClient.Request({
1084
- headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true, encryption}),
1085
- method: "POST",
1086
- path,
1087
- bodyType: "BINARY",
1088
- body: "",
1089
- allowFailover: false
1090
- })
1091
- );
1078
+ const openResponse = await this.HttpClient.RequestJsonBody({
1079
+ headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true, encryption}),
1080
+ method: "POST",
1081
+ path,
1082
+ bodyType: "BINARY",
1083
+ body: "",
1084
+ allowFailover: false
1085
+ });
1092
1086
 
1093
1087
  return openResponse.part.write_token;
1094
1088
  };
@@ -1149,16 +1143,14 @@ exports.FinalizePart = async function({libraryId, objectId, writeToken, partWrit
1149
1143
  ValidateWriteToken(writeToken);
1150
1144
 
1151
1145
  const path = UrlJoin("q", writeToken, "parts");
1152
- return await this.utils.ResponseToJson(
1153
- await this.HttpClient.Request({
1154
- headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true, encryption}),
1155
- method: "POST",
1156
- path: UrlJoin(path, partWriteToken),
1157
- bodyType: "BINARY",
1158
- body: "",
1159
- allowFailover: false
1160
- })
1161
- );
1146
+ return await this.HttpClient.RequestJsonBody({
1147
+ headers: await this.authClient.AuthorizationHeader({libraryId, objectId, update: true, encryption}),
1148
+ method: "POST",
1149
+ path: UrlJoin(path, partWriteToken),
1150
+ bodyType: "BINARY",
1151
+ body: "",
1152
+ allowFailover: false
1153
+ });
1162
1154
  };
1163
1155
 
1164
1156
  /**
@@ -1350,7 +1350,11 @@ exports.StreamConfig = async function({name, customSettings={}, probeMetadata})
1350
1350
  status.user_config = userConfig;
1351
1351
 
1352
1352
  // Get node URI from user config
1353
- const hostName = userConfig.url.replace("udp://", "").replace("rtmp://", "").replace("srt://", "").split(":")[0];
1353
+ const parsedName = userConfig.url
1354
+ .replace("udp://", "https://")
1355
+ .replace("rtmp://", "https://")
1356
+ .replace("srt://", "https://");
1357
+ const hostName = new URL(parsedName).hostname;
1354
1358
  const streamUrl = new URL(userConfig.url);
1355
1359
 
1356
1360
  console.log("Retrieving nodes - matching", hostName);