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 1.3.1 to 2.0.0

50

lib/index.js

@@ -281,12 +281,12 @@ const Superagent = require('superagent');

function generateStorageUrl(ctx) {
return `${ctx.configuration.fusebit_storage_audience}/v1/account/${ctx.configuration.fusebit_storage_account_id}/subscription/${ctx.configuration.fusebit_storage_subscription_id}/storage/${ctx.configuration.fusebit_storage_id}`;
function generateStorageUrl(storageCtx) {
return `${storageCtx.fusebit_storage_audience}/v1/account/${storageCtx.fusebit_storage_account_id}/subscription/${storageCtx.fusebit_storage_subscription_id}/storage/${storageCtx.fusebit_storage_id}`;
}
exports.deleteStorage = async (functionCtx, ctx) => {
exports.deleteStorage = async (ctx, storageCtx) => {
debug('DELETE STORAGE');
const issuerId = functionCtx.configuration.fusebit_storage_issuer_id;
const subject = functionCtx.configuration.fusebit_storage_subject;
const accountId = functionCtx.configuration.fusebit_storage_account_id;
const issuerId = storageCtx.fusebit_storage_issuer_id;
const subject = storageCtx.fusebit_storage_subject;
const accountId = storageCtx.fusebit_storage_account_id;

@@ -300,3 +300,3 @@ if (!issuerId || !subject || !accountId) {

debug('Deleting storage');
await Superagent.delete(generateStorageUrl(functionCtx))
await Superagent.delete(generateStorageUrl(storageCtx))
.set('Authorization', ctx.headers['authorization']) // pass-through authorization

@@ -334,31 +334,2 @@ .ok((r) => r.status < 300 || r.status === 404);

try {
// Acquire any additional configuration elements from optional components
let additionalCfg = {};
// Is storage requested?
if (functionSpecification.enableStorage) {
additionalCfg = await exports.createStorage(ctx);
if (typeof functionSpecification.nodejs.files['package.json'] === 'object') {
functionSpecification.nodejs.files['package.json'].dependencies['@fusebit/add-on-sdk'] = '*';
} else if (typeof functionSpecification.nodejs.files['package.json'] === 'string') {
let pkg = JSON.parse(functionSpecification.nodejs.files['package.json']);
pkg.dependencies['@fusebit/add-on-sdk'] = '*';
functionSpecification.nodejs.files['package.json'] = pkg;
}
}
delete functionSpecification.enableStorage;
// Add the additional configuration elements to the specification
if (Object.keys(additionalCfg).length != 0) {
if (functionSpecification.configurationSerialized) {
functionSpecification.configurationSerialized += `# Storage configuration settings\n${Object.keys(additionalCfg)
.sort()
.map((k) => `${k}=${additionalCfg[k]}`)
.join('\n')}\n`;
} else {
functionSpecification.configuration = { ...functionSpecification.configuration, ...additionalCfg };
}
}
// Create the function

@@ -409,4 +380,2 @@ let url = `${ctx.body.baseUrl}/v1/account/${ctx.body.accountId}/subscription/${ctx.body.subscriptionId}/boundary/${ctx.body.boundaryId}/function/${ctx.body.functionId}`;

exports.deleteFunction = async (ctx, boundaryId, functionId) => {
let functionCtx = await exports.getFunctionDefinition(ctx, boundaryId, functionId);
await Superagent.delete(

@@ -417,5 +386,2 @@ `${ctx.body.baseUrl}/v1/account/${ctx.body.accountId}/subscription/${ctx.body.subscriptionId}/boundary/${

).set('Authorization', ctx.headers['authorization']); // pass-through authorization
// Try to delete the storage, this will do nothing if storage wasn't configured
await exports.deleteStorage(functionCtx, ctx);
};

@@ -454,3 +420,3 @@

const url = generateStorageUrl(ctx);
const url = generateStorageUrl(ctx.configuration);

@@ -457,0 +423,0 @@ return {

2

package.json
{
"name": "@fusebit/add-on-sdk",
"version": "1.3.1",
"version": "2.0.0",
"description": "SDK for implementing Fusebit Add-Ons",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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