@netlify/config 20.15.1 → 20.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ type GetSiteInfoOpts = {
9
9
  context?: string;
10
10
  featureFlags?: Record<string, boolean>;
11
11
  testOpts?: TestOptions;
12
+ siteFeatureFlagPrefix: string;
12
13
  };
13
14
  /**
14
15
  * Retrieve Netlify Site information, if available.
@@ -19,7 +20,7 @@ type GetSiteInfoOpts = {
19
20
  * Silently ignore API errors. For example the network connection might be down,
20
21
  * but local builds should still work regardless.
21
22
  */
22
- export declare const getSiteInfo: ({ api, siteId, accountId, mode, context, offline, testOpts, featureFlags, }: GetSiteInfoOpts) => Promise<{
23
+ export declare const getSiteInfo: ({ api, siteId, accountId, mode, context, offline, testOpts, featureFlags, siteFeatureFlagPrefix, }: GetSiteInfoOpts) => Promise<{
23
24
  siteInfo: any;
24
25
  accounts: any;
25
26
  addons: any;
@@ -11,7 +11,7 @@ import { ERROR_CALL_TO_ACTION } from '../log/messages.js';
11
11
  * Silently ignore API errors. For example the network connection might be down,
12
12
  * but local builds should still work regardless.
13
13
  */
14
- export const getSiteInfo = async function ({ api, siteId, accountId, mode, context, offline = false, testOpts = {}, featureFlags = {}, }) {
14
+ export const getSiteInfo = async function ({ api, siteId, accountId, mode, context, offline = false, testOpts = {}, featureFlags = {}, siteFeatureFlagPrefix, }) {
15
15
  const { env: testEnv = false } = testOpts;
16
16
  const useV2Endpoint = !!accountId && featureFlags.cli_integration_installations_meta;
17
17
  if (useV2Endpoint) {
@@ -23,7 +23,7 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
23
23
  return { siteInfo, accounts: [], addons: [], integrations };
24
24
  }
25
25
  const promises = [
26
- getSite(api, siteId),
26
+ getSite(api, siteId, siteFeatureFlagPrefix),
27
27
  getAccounts(api),
28
28
  getAddons(api, siteId),
29
29
  getIntegrations({ siteId, testOpts, offline, useV2Endpoint, accountId }),
@@ -41,7 +41,7 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
41
41
  return { siteInfo, accounts: [], addons: [], integrations };
42
42
  }
43
43
  const promises = [
44
- getSite(api, siteId),
44
+ getSite(api, siteId, siteFeatureFlagPrefix),
45
45
  getAccounts(api),
46
46
  getAddons(api, siteId),
47
47
  getIntegrations({ siteId, testOpts, offline }),
@@ -53,12 +53,12 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
53
53
  }
54
54
  return { siteInfo, accounts, addons, integrations };
55
55
  };
56
- const getSite = async function (api, siteId) {
56
+ const getSite = async function (api, siteId, siteFeatureFlagPrefix) {
57
57
  if (siteId === undefined) {
58
58
  return {};
59
59
  }
60
60
  try {
61
- const site = await api.getSite({ siteId });
61
+ const site = await api.getSite({ siteId, feature_flags: siteFeatureFlagPrefix });
62
62
  return { ...site, id: siteId };
63
63
  }
64
64
  catch (error) {
package/lib/main.js CHANGED
@@ -24,7 +24,7 @@ import { getRedirectsPath, addRedirects } from './redirects.js';
24
24
  * `config` together with related properties such as the `configPath`.
25
25
  */
26
26
  export const resolveConfig = async function (opts) {
27
- const { cachedConfig, cachedConfigPath, host, scheme, packagePath, pathPrefix, testOpts, token, offline, ...optsA } = addDefaultOpts(opts);
27
+ const { cachedConfig, cachedConfigPath, host, scheme, packagePath, pathPrefix, testOpts, token, offline, siteFeatureFlagPrefix, ...optsA } = addDefaultOpts(opts);
28
28
  // `api` is not JSON-serializable, so we cannot cache it inside `cachedConfig`
29
29
  const api = getApiClient({ token, offline, host, scheme, pathPrefix, testOpts });
30
30
  const parsedCachedConfig = await getCachedConfig({ cachedConfig, cachedConfigPath, token, api });
@@ -38,6 +38,7 @@ export const resolveConfig = async function (opts) {
38
38
  siteId,
39
39
  accountId,
40
40
  mode,
41
+ siteFeatureFlagPrefix,
41
42
  offline,
42
43
  featureFlags,
43
44
  testOpts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "20.15.1",
3
+ "version": "20.15.3",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -72,7 +72,7 @@
72
72
  "is-plain-obj": "^4.0.0",
73
73
  "js-yaml": "^4.0.0",
74
74
  "map-obj": "^5.0.0",
75
- "netlify": "^13.1.18",
75
+ "netlify": "^13.1.19",
76
76
  "netlify-headers-parser": "^7.1.4",
77
77
  "netlify-redirect-parser": "^14.3.0",
78
78
  "node-fetch": "^3.3.1",
@@ -95,5 +95,5 @@
95
95
  "engines": {
96
96
  "node": "^14.16.0 || >=16.0.0"
97
97
  },
98
- "gitHead": "aa96e910e165bde1a46101bcf73702818d008214"
98
+ "gitHead": "4a5a503555b806ef711031834f563aa06773817e"
99
99
  }