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

@netlify/config

Package Overview
Dependencies
Maintainers
16
Versions
438
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/config - npm Package Compare versions

Comparing version 20.21.3 to 20.21.4

2

lib/api/site_info.d.ts

@@ -23,3 +23,3 @@ import { NetlifyAPI } from 'netlify';

*/
export declare const getSiteInfo: ({ api, siteId, accountId, mode, context, offline, testOpts, siteFeatureFlagPrefix, }: GetSiteInfoOpts) => Promise<{
export declare const getSiteInfo: ({ api, siteId, accountId, mode, context, offline, testOpts, siteFeatureFlagPrefix, featureFlags, }: GetSiteInfoOpts) => Promise<{
siteInfo: any;

@@ -26,0 +26,0 @@ accounts: any;

@@ -14,4 +14,5 @@ import fetch from 'node-fetch';

*/
export const getSiteInfo = async function ({ api, siteId, accountId, mode, context, offline = false, testOpts = {}, siteFeatureFlagPrefix, }) {
export const getSiteInfo = async function ({ api, siteId, accountId, mode, context, offline = false, testOpts = {}, siteFeatureFlagPrefix, featureFlags = {}, }) {
const { env: testEnv = false } = testOpts;
const errorOnExtensionFetchFail = featureFlags.error_builds_on_extension_fetch_fail;
if (api === undefined || mode === 'buildbot' || testEnv) {

@@ -23,3 +24,5 @@ const siteInfo = {};

siteInfo.account_id = accountId;
const integrations = mode === 'buildbot' && !offline ? await getIntegrations({ siteId, testOpts, offline, accountId }) : [];
const integrations = mode === 'buildbot' && !offline
? await getIntegrations({ siteId, testOpts, offline, accountId, errorOnExtensionFetchFail })
: [];
return { siteInfo, accounts: [], addons: [], integrations };

@@ -31,3 +34,3 @@ }

getAddons(api, siteId),
getIntegrations({ siteId, testOpts, offline, accountId }),
getIntegrations({ siteId, testOpts, offline, accountId, errorOnExtensionFetchFail }),
];

@@ -74,3 +77,3 @@ const [siteInfo, accounts, addons, integrations] = await Promise.all(promises);

};
const getIntegrations = async function ({ siteId, accountId, testOpts, offline, }) {
const getIntegrations = async function ({ siteId, accountId, testOpts, offline, errorOnExtensionFetchFail, }) {
if (!siteId || offline) {

@@ -85,2 +88,19 @@ return [];

: `${baseUrl}site/${siteId}/integrations/safe`;
if (errorOnExtensionFetchFail) {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Unexpected status code ${response.status} from fetching extensions`);
}
const bodyText = await response.text();
if (bodyText === '') {
return [];
}
const integrations = await JSON.parse(bodyText);
return Array.isArray(integrations) ? integrations : [];
}
catch (error) {
return throwUserError(`Failed retrieving extensions for site ${siteId}: ${error.message}. ${ERROR_CALL_TO_ACTION}`);
}
}
try {

@@ -92,6 +112,4 @@ const response = await fetch(url);

catch (error) {
// TODO: We should consider blocking the build as integrations are a critical part of the build process
// https://linear.app/netlify/issue/CT-1214/implement-strategy-in-builds-to-deal-with-integrations-that-we-fail-to
return [];
}
};
{
"name": "@netlify/config",
"version": "20.21.3",
"version": "20.21.4",
"description": "Netlify config module",

@@ -98,3 +98,3 @@ "type": "module",

},
"gitHead": "0a66a5592b80f8b2e2538ebc385d3eea8777c7b7"
"gitHead": "04134491e36ab1b6ccf5990edf1885e43d8a15a0"
}
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