@base-cms/base4-rest-api
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
{ | ||
"name": "@base-cms/base4-rest-api", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"description": "A Base4 REST API client.", | ||
@@ -23,3 +23,3 @@ "main": "src/index.js", | ||
}, | ||
"gitHead": "bfe40af02b077c4d143195ca9e4d6c319f9ee4db" | ||
"gitHead": "bea84c918c2ff89f92c185159affca39e3c35717" | ||
} |
@@ -12,3 +12,3 @@ const fetch = require('node-fetch'); | ||
constructor({ | ||
hostname, | ||
uri, | ||
username, | ||
@@ -19,4 +19,4 @@ password, | ||
} = {}) { | ||
if (!hostname || !username || !password) throw new Error('A hostname, username, and password are required for the Base REST API.'); | ||
this.hostname = hostname.replace('http://', '').replace('https://', '').replace(/\/+$/, ''); | ||
if (!uri || !username || !password) throw new Error('A uri, username, and password are required for the Base REST API.'); | ||
this.uri = uri.replace(/\/+$/, ''); | ||
this.username = username; | ||
@@ -168,3 +168,3 @@ this.password = password; | ||
if (!endpoint) throw new Error('An API endpoint is required.'); | ||
return `https://${this.hostname}/${cleanPath(this.baseEndpoint)}/${type}/${cleanPath(endpoint)}`; | ||
return `${this.uri}/${cleanPath(this.baseEndpoint)}/${type}/${cleanPath(endpoint)}`; | ||
} | ||
@@ -171,0 +171,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8485