@netlify/config 20.17.1 → 20.19.0
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.
- package/lib/api/site_info.js +12 -3
- package/lib/origin.js +1 -1
- package/package.json +3 -3
package/lib/api/site_info.js
CHANGED
|
@@ -16,7 +16,11 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
|
|
|
16
16
|
const useV2Endpoint = !!accountId && featureFlags.cli_integration_installations_meta;
|
|
17
17
|
if (useV2Endpoint) {
|
|
18
18
|
if (api === undefined || mode === 'buildbot' || testEnv) {
|
|
19
|
-
const siteInfo =
|
|
19
|
+
const siteInfo = {};
|
|
20
|
+
if (siteId !== undefined)
|
|
21
|
+
siteInfo.id = siteId;
|
|
22
|
+
if (accountId !== undefined)
|
|
23
|
+
siteInfo.account_id = accountId;
|
|
20
24
|
const integrations = mode === 'buildbot' && !offline
|
|
21
25
|
? await getIntegrations({ siteId, testOpts, offline, useV2Endpoint, accountId })
|
|
22
26
|
: [];
|
|
@@ -36,7 +40,11 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
|
|
|
36
40
|
return { siteInfo, accounts, addons, integrations };
|
|
37
41
|
}
|
|
38
42
|
if (api === undefined || mode === 'buildbot' || testEnv) {
|
|
39
|
-
const siteInfo =
|
|
43
|
+
const siteInfo = {};
|
|
44
|
+
if (siteId !== undefined)
|
|
45
|
+
siteInfo.id = siteId;
|
|
46
|
+
if (accountId !== undefined)
|
|
47
|
+
siteInfo.account_id = accountId;
|
|
40
48
|
const integrations = mode === 'buildbot' && !offline ? await getIntegrations({ siteId, testOpts, offline }) : [];
|
|
41
49
|
return { siteInfo, accounts: [], addons: [], integrations };
|
|
42
50
|
}
|
|
@@ -92,8 +100,9 @@ const getIntegrations = async function ({ siteId, accountId, testOpts, offline,
|
|
|
92
100
|
}
|
|
93
101
|
const { host } = testOpts;
|
|
94
102
|
const baseUrl = new URL(host ? `http://${host}` : `https://api.netlifysdk.com`);
|
|
103
|
+
// use future state feature flag
|
|
95
104
|
const url = useV2Endpoint
|
|
96
|
-
? `${baseUrl}team/${accountId}/integrations/installations/meta
|
|
105
|
+
? `${baseUrl}team/${accountId}/integrations/installations/meta/${siteId}`
|
|
97
106
|
: `${baseUrl}site/${siteId}/integrations/safe`;
|
|
98
107
|
try {
|
|
99
108
|
const response = await fetch(url);
|
package/lib/origin.js
CHANGED
|
@@ -21,7 +21,7 @@ const addBuildPublishOrigin = function ({ config, config: { build = {} }, origin
|
|
|
21
21
|
return isTruthy(build.publish) ? { ...config, build: { ...build, publishOrigin: origin } } : config;
|
|
22
22
|
};
|
|
23
23
|
const addConfigPluginOrigin = function ({ config, config: { plugins }, origin }) {
|
|
24
|
-
return Array.isArray(plugins) ? { ...config, plugins: plugins.map((plugin) => ({ ...plugin
|
|
24
|
+
return Array.isArray(plugins) ? { ...config, plugins: plugins.map((plugin) => ({ origin, ...plugin })) } : config;
|
|
25
25
|
};
|
|
26
26
|
const addHeadersOrigin = function ({ config, config: { headers }, origin }) {
|
|
27
27
|
return isTruthy(headers) ? { ...config, headersOrigin: origin } : config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.19.0",
|
|
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.
|
|
75
|
+
"netlify": "^13.1.21",
|
|
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": "
|
|
98
|
+
"gitHead": "4ae7f95ca7b31f392956894d5cd6ecf781349b55"
|
|
99
99
|
}
|