@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.
- package/dist/ElvClient-min.js +15 -14
- package/dist/ElvClient-node-min.js +14 -13
- package/dist/ElvFrameClient-min.js +10 -10
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +15 -14
- package/dist/ElvWalletClient-node-min.js +14 -13
- package/dist/src/AuthorizationClient.js +9 -12
- package/dist/src/ContentObjectAudit.js +3 -3
- package/dist/src/ContentObjectVerification.js +3 -3
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +47 -28
- package/dist/src/ElvWallet.js +7 -5
- package/dist/src/EthClient.js +8 -9
- package/dist/src/FrameClient.js +8 -9
- package/dist/src/HttpClient.js +27 -4
- package/dist/src/Id.js +1 -2
- package/dist/src/PermissionsClient.js +31 -19
- package/dist/src/RemoteSigner.js +6 -8
- package/dist/src/UserProfileClient.js +35 -19
- package/dist/src/Utils.js +62 -28
- package/dist/src/client/ABRPublishing.js +2 -2
- package/dist/src/client/AccessGroups.js +2 -2
- package/dist/src/client/ContentAccess.js +104 -104
- package/dist/src/client/ContentManagement.js +25 -23
- package/dist/src/client/Contracts.js +2 -2
- package/dist/src/client/Files.js +77 -88
- package/dist/src/client/LiveConf.js +3 -7
- package/dist/src/client/LiveStream.js +35 -36
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +17 -14
- package/package.json +1 -1
- package/src/HttpClient.js +16 -2
- package/src/Utils.js +27 -5
- package/src/client/ContentAccess.js +63 -80
- package/src/client/ContentManagement.js +25 -11
- package/src/client/Files.js +43 -51
- package/src/client/LiveStream.js +5 -1
package/src/client/Files.js
CHANGED
|
@@ -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.
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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.
|
|
489
|
-
this.
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
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.
|
|
819
|
-
this.
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
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.
|
|
853
|
-
this.
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
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.
|
|
1083
|
-
this.
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
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.
|
|
1153
|
-
await this.
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
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
|
/**
|
package/src/client/LiveStream.js
CHANGED
|
@@ -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
|
|
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);
|