Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@base-cms/base4-rest-api

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@base-cms/base4-rest-api - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

4

package.json
{
"name": "@base-cms/base4-rest-api",
"version": "1.0.0",
"version": "1.1.0",
"description": "A Base4 REST API client.",

@@ -23,3 +23,3 @@ "main": "src/index.js",

},
"gitHead": "84a09c3f2d6687951b19cabd448c30797bc24fb9"
"gitHead": "004792ffaa2ab317dffbea61ee1267ac8b5c1533"
}

@@ -123,2 +123,12 @@ const fetch = require('node-fetch');

async uploadImageFromUrl({ url } = {}) {
if (!url) throw new Error('An image URL must be passed to upload.');
return this.fetch({
method: 'post',
type: 'custom',
body: { uri: url },
endpoint: 'upload-embedded',
});
}
async fetch({

@@ -165,4 +175,5 @@ method,

buildUrl({ type, endpoint } = {}) {
if (!['persistence', 'search'].includes(type)) throw new Error(`The API resource type '${type}' is not supported.`);
if (!['persistence', 'search', 'custom'].includes(type)) throw new Error(`The API resource type '${type}' is not supported.`);
if (!endpoint) throw new Error('An API endpoint is required.');
if (type === 'custom') return `${this.uri}/${cleanPath(endpoint)}`;
return `${this.uri}/${cleanPath(this.baseEndpoint)}/${type}/${cleanPath(endpoint)}`;

@@ -169,0 +180,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc