New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fusebit/add-on-sdk

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fusebit/add-on-sdk - npm Package Compare versions

Comparing version

to
3.0.3

test/api.test.js

12

lib/index.js

@@ -287,2 +287,6 @@ const Superagent = require('superagent');

get: async function (storageSubId) {
storageSubId = storageSubId ? removeTrailingSlash(removeLeadingSlash(storageSubId)) : '';
if (!storageSubId && !storageIdPrefix) {
return undefined;
}
const response = await Superagent.get(getUrl(storageSubId))

@@ -294,2 +298,8 @@ .set('Authorization', `Bearer ${accessToken}`)

put: async function (data, storageSubId) {
storageSubId = storageSubId ? removeTrailingSlash(removeLeadingSlash(storageSubId)) : '';
if (!storageSubId && !storageIdPrefix) {
throw new Error(
'Storage objects cannot be stored at the root of the hierarchy. Specify a storageSubId when calling the `put` method, or a storageIdPrefix when creating the storage client.'
);
}
const response = await Superagent.put(getUrl(storageSubId)).set('Authorization', `Bearer ${accessToken}`).send(data);

@@ -310,3 +320,3 @@ return response.body;

},
list: async function (storageSubId, { count, next }) {
list: async function (storageSubId, { count, next } = {}) {
const response = await Superagent.get(`${getUrl(storageSubId)}/*`)

@@ -313,0 +323,0 @@ .query(isNaN(count) ? undefined : { count })

{
"name": "@fusebit/add-on-sdk",
"version": "3.0.2",
"version": "3.0.3",
"description": "SDK for implementing Fusebit Add-Ons",

@@ -14,4 +14,11 @@ "main": "lib/index.js",

"devDependencies": {
"prettier": "^2.0.5"
"node-notifier": ">=8.0.1",
"prettier": "^2.0.5",
"jest": "^26.6.3",
"uuid": "^8.3.2"
},
"scripts": {
"test": "jest --colors",
"coverage": "jest --colors --coverage"
}
}

@@ -5,6 +5,32 @@ # add-on-sdk

## Running tests
Here are a few things you need to know before running tests:
- You must have access to a [Fusebit](https://fusebit.io) subscription.
- You must have the [Fusebit CLI](https://fusebit.io/docs/reference/fusebit-cli/) installed.
- You must have a Fusebit CLI profile configured with an account ID and subscription ID, and sufficient permissions to manage all functions and all storage on that subscription.
- The test will create and remove functions in randomly named boundary in the subscription.
- The test will create and remove storage objects in randomly named storage ID in the subscription.
To run the tests, set the `FUSE_PROFILE` environment variable to the Fusebit CLI profile name to use:
```
FUSE_PROFILE={profile-name} npm test
```
In case of a failure, you can get useful, verbose diagnostic information with:
```
debug=1 FUSE_PROFILE={profile-name} npm test
```
## Release Notes
### v3.0.3
- Fix bug in parameter processing in the storage client
### v3.0.2
- Allow turning off debugging by setting `debug=0` in the configuration of the function