@eluvio/elv-client-js 3.1.89 → 3.1.92

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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.89",
3
+ "version": "3.1.92",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "3.1.89",
3
+ "version": "3.1.92",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/ElvClient.js",
6
6
  "author": "Kevin Talmadge",
@@ -144,7 +144,7 @@ class AuthorizationClient {
144
144
  this.noCache = true;
145
145
  }
146
146
 
147
- if(this.client.signer && this.client.signer.remoteSigner) {
147
+ if(channelAuth && this.client.signer && this.client.signer.remoteSigner) {
148
148
  // Channel auth not supported for remote signer, use a self-signed no-auth token instead
149
149
  noAuth = true;
150
150
  channelAuth = false;
@@ -204,7 +204,7 @@ class AuthorizationClient {
204
204
  addr: Utils.FormatAddress(((this.client.signer && this.client.signer.address) || ""))
205
205
  };
206
206
 
207
- if(!(this.noAuth || noAuth)) {
207
+ if(!(this.noAuth || noAuth) && !this.client.signer.remoteSigner) {
208
208
  const { transactionHash } = await this.MakeAccessRequest({
209
209
  libraryId,
210
210
  objectId,
package/src/HttpClient.js CHANGED
@@ -77,10 +77,10 @@ class HttpClient {
77
77
  headers: this.RequestHeaders(bodyType, headers)
78
78
  };
79
79
 
80
- if(method === "POST" || method === "PUT") {
80
+ if(method === "POST" || method === "PUT" || method === "DELETE") {
81
81
  if(body && bodyType === "JSON") {
82
82
  fetchParameters.body = JSON.stringify(body);
83
- } else {
83
+ } else if(body) {
84
84
  fetchParameters.body = body;
85
85
  }
86
86
  }
@@ -234,11 +234,14 @@ exports.ContentType = async function({name, typeId, versionHash, publicOnly=fals
234
234
  if(name) {
235
235
  this.Log("Looking up type by name in content space metadata...");
236
236
  // Look up named type in content space metadata
237
- typeId = await this.ContentObjectMetadata({
238
- libraryId: this.contentSpaceLibraryId,
239
- objectId: this.contentSpaceObjectId,
240
- metadataSubtree: UrlJoin("public", "contentTypes", name)
241
- });
237
+ try {
238
+ typeId = await this.ContentObjectMetadata({
239
+ libraryId: this.contentSpaceLibraryId,
240
+ objectId: this.contentSpaceObjectId,
241
+ metadataSubtree: UrlJoin("public", "contentTypes", name)
242
+ });
243
+ // eslint-disable-next-line no-empty
244
+ } catch(error) {}
242
245
  }
243
246
 
244
247
  if(!typeId) {
@@ -310,11 +313,15 @@ exports.ContentTypes = async function() {
310
313
  this.Log(typeAddresses);
311
314
 
312
315
  // Content space types
313
- const contentSpaceTypes = await this.ContentObjectMetadata({
314
- libraryId: this.contentSpaceLibraryId,
315
- objectId: this.contentSpaceObjectId,
316
- metadataSubtree: "public/contentTypes"
317
- }) || {};
316
+ let contentSpaceTypes = {};
317
+ try {
318
+ contentSpaceTypes = await this.ContentObjectMetadata({
319
+ libraryId: this.contentSpaceLibraryId,
320
+ objectId: this.contentSpaceObjectId,
321
+ metadataSubtree: "public/contentTypes"
322
+ }) || {};
323
+ // eslint-disable-next-line no-empty
324
+ } catch(error) {}
318
325
 
319
326
  const contentSpaceTypeAddresses = Object.values(contentSpaceTypes)
320
327
  .map(typeId => this.utils.HashToAddress(typeId));