@eluvio/elv-client-js 4.0.87 → 4.0.88

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.87",
3
+ "version": "4.0.88",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
package/src/ElvClient.js CHANGED
@@ -283,7 +283,7 @@ class ElvClient {
283
283
  * @return {Object} - An object using network names as keys and configuration URLs as values.
284
284
  */
285
285
  static Networks() {
286
- return networks;
286
+ return Object.assign({}, networks);
287
287
  }
288
288
 
289
289
  /**
package/src/Validation.js CHANGED
@@ -52,8 +52,11 @@ exports.ValidatePartHash = (partHash) => {
52
52
  }
53
53
  };
54
54
 
55
- exports.ValidateParameters = ({libraryId, objectId, versionHash}) => {
56
- if(versionHash) {
55
+ exports.ValidateParameters = ({libraryId, objectId, versionHash, writeToken}) => {
56
+ if(writeToken) {
57
+ if(versionHash) throw Error(`Cannot specify writeToken and versionHash at same time (token:${writeToken}, hash:${versionHash})`);
58
+ exports.ValidateWriteToken(writeToken);
59
+ } else if(versionHash) {
57
60
  exports.ValidateVersion(versionHash);
58
61
  } else {
59
62
  exports.ValidateLibrary(libraryId);
@@ -34,20 +34,22 @@ const {
34
34
  * @namedParams
35
35
  * @param {string=} libraryId - ID of the library
36
36
  * @param {string=} objectId - ID of the object
37
+ * @param {string=} path - ID of the object
37
38
  * @param {string=} versionHash - Hash of the object version - if not specified, most recent version will be used
39
+ * @param {string=} writeToken - Write token of a draft (incompatible with versionHash)
38
40
  */
39
- exports.ListFiles = async function({libraryId, objectId, versionHash}) {
40
- ValidateParameters({libraryId, objectId, versionHash});
41
+ exports.ListFiles = async function({libraryId, objectId, path = "", versionHash, writeToken}) {
42
+ ValidateParameters({libraryId, objectId, versionHash, writeToken});
41
43
 
42
44
  if(versionHash) { objectId = this.utils.DecodeVersionHash(versionHash).objectId; }
43
45
 
44
- let path = UrlJoin("q", versionHash || objectId, "meta", "files");
46
+ let urlPath = UrlJoin("q", writeToken || versionHash || objectId, "files_list", path);
45
47
 
46
48
  return this.utils.ResponseToJson(
47
49
  this.HttpClient.Request({
48
50
  headers: await this.authClient.AuthorizationHeader({libraryId, objectId, versionHash}),
49
51
  method: "GET",
50
- path: path,
52
+ path: urlPath,
51
53
  })
52
54
  );
53
55
  };
@@ -554,7 +556,7 @@ exports.UploadFileData = async function({libraryId, objectId, writeToken, encryp
554
556
  const jobStatus = await this.UploadJobStatus({libraryId, objectId, writeToken, uploadId, jobId});
555
557
 
556
558
  // Find the status of this file
557
- let fileStatus = jobStatus.files.find(item => item.path == filePath);
559
+ let fileStatus = jobStatus.files.find(item => item.path === filePath);
558
560
  if(encryption && encryption !== "none") {
559
561
  fileStatus = fileStatus.encrypted;
560
562
  }
@@ -498,6 +498,9 @@ exports.StreamStatus = async function({name, stopLro=false, showParams=false}) {
498
498
  state = lroStatus.state;
499
499
  status.warnings = lroStatus.custom && lroStatus.custom.warnings;
500
500
  status.quality = lroStatus.custom && lroStatus.custom.quality;
501
+ if (lroStatus.custom && lroStatus.custom.status) {
502
+ status.recording_status = lroStatus.custom.status
503
+ }
501
504
  } catch(error) {
502
505
  console.log("LRO Status (failed): ", error.response.statusCode);
503
506
  status.state = "stopped";
@@ -1954,7 +1957,6 @@ exports.StreamAddWatermark = async function({
1954
1957
  exports.AuditStream = async function({objectId, versionHash, salt, samples}) {
1955
1958
  return await ContentObjectAudit.AuditContentObject({
1956
1959
  client: this,
1957
- libraryId,
1958
1960
  objectId,
1959
1961
  versionHash,
1960
1962
  salt,