@netlify/config 21.0.6 → 22.0.0-rc
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.d.ts +16 -3
- package/lib/api/site_info.js +6 -5
- package/lib/main.d.ts +20 -1
- package/package.json +4 -5
package/lib/api/site_info.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NetlifyAPI } from 'netlify';
|
|
2
|
+
import { IntegrationResponse } from '../types/api.js';
|
|
2
3
|
import { ModeOption, TestOptions } from '../types/options.js';
|
|
3
4
|
type GetSiteInfoOpts = {
|
|
4
5
|
siteId: string;
|
|
@@ -24,8 +25,20 @@ type GetSiteInfoOpts = {
|
|
|
24
25
|
*/
|
|
25
26
|
export declare const getSiteInfo: ({ api, siteId, accountId, mode, context, offline, testOpts, siteFeatureFlagPrefix, token, featureFlags, extensionApiBaseUrl, }: GetSiteInfoOpts) => Promise<{
|
|
26
27
|
siteInfo: any;
|
|
27
|
-
accounts:
|
|
28
|
-
addons: any;
|
|
29
|
-
integrations:
|
|
28
|
+
accounts: MinimalAccount[];
|
|
29
|
+
addons: any[] | undefined;
|
|
30
|
+
integrations: IntegrationResponse[];
|
|
30
31
|
}>;
|
|
32
|
+
export type MinimalAccount = {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
slug: string;
|
|
36
|
+
default: boolean;
|
|
37
|
+
team_logo_url: string | null;
|
|
38
|
+
on_pro_trial: boolean;
|
|
39
|
+
organization_id: string | null;
|
|
40
|
+
type_name: string;
|
|
41
|
+
type_slug: string;
|
|
42
|
+
members_count: number;
|
|
43
|
+
};
|
|
31
44
|
export {};
|
package/lib/api/site_info.js
CHANGED
|
@@ -34,13 +34,12 @@ export const getSiteInfo = async function ({ api, siteId, accountId, mode, conte
|
|
|
34
34
|
: [];
|
|
35
35
|
return { siteInfo, accounts: [], addons: [], integrations };
|
|
36
36
|
}
|
|
37
|
-
const
|
|
37
|
+
const [siteInfo, accounts, addons, integrations] = await Promise.all([
|
|
38
38
|
getSite(api, siteId, siteFeatureFlagPrefix),
|
|
39
39
|
getAccounts(api),
|
|
40
40
|
getAddons(api, siteId),
|
|
41
41
|
getIntegrations({ siteId, testOpts, offline, accountId, token, featureFlags, extensionApiBaseUrl, mode }),
|
|
42
|
-
];
|
|
43
|
-
const [siteInfo, accounts, addons, integrations] = await Promise.all(promises);
|
|
42
|
+
]);
|
|
44
43
|
if (siteInfo.use_envelope) {
|
|
45
44
|
const envelope = await getEnvelope({ api, accountId: siteInfo.account_slug, siteId, context });
|
|
46
45
|
siteInfo.build_settings.env = envelope;
|
|
@@ -61,11 +60,13 @@ const getSite = async function (api, siteId, siteFeatureFlagPrefix) {
|
|
|
61
60
|
};
|
|
62
61
|
const getAccounts = async function (api) {
|
|
63
62
|
try {
|
|
64
|
-
const accounts = await api.listAccountsForUser(
|
|
63
|
+
const accounts = (await api.listAccountsForUser(
|
|
64
|
+
// @ts-expect-error(ndhoule): This is an unpublished, internal querystring parameter
|
|
65
|
+
{ minimal: 'true' }));
|
|
65
66
|
return Array.isArray(accounts) ? accounts : [];
|
|
66
67
|
}
|
|
67
68
|
catch (error) {
|
|
68
|
-
throwUserError(`Failed retrieving user account: ${error.message}. ${ERROR_CALL_TO_ACTION}`);
|
|
69
|
+
return throwUserError(`Failed retrieving user account: ${error.message}. ${ERROR_CALL_TO_ACTION}`);
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
72
|
const getAddons = async function (api, siteId) {
|
package/lib/main.d.ts
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { type MinimalAccount } from './api/site_info.js';
|
|
2
|
+
export type Config = {
|
|
3
|
+
accounts: MinimalAccount[] | undefined;
|
|
4
|
+
addons: any;
|
|
5
|
+
api: any;
|
|
6
|
+
branch: any;
|
|
7
|
+
buildDir: any;
|
|
8
|
+
config: any;
|
|
9
|
+
configPath: any;
|
|
10
|
+
context: any;
|
|
11
|
+
env: any;
|
|
12
|
+
headersPath: any;
|
|
13
|
+
integrations: any;
|
|
14
|
+
logs: any;
|
|
15
|
+
redirectsPath: any;
|
|
16
|
+
repositoryRoot: any;
|
|
17
|
+
siteInfo: any;
|
|
18
|
+
token: any;
|
|
19
|
+
};
|
|
1
20
|
/**
|
|
2
21
|
* Load the configuration file.
|
|
3
22
|
* Takes an optional configuration file path as input and return the resolved
|
|
4
23
|
* `config` together with related properties such as the `configPath`.
|
|
5
24
|
*/
|
|
6
|
-
export declare const resolveConfig: (opts: any) => Promise<
|
|
25
|
+
export declare const resolveConfig: (opts: any) => Promise<Config>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-rc",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -59,8 +59,6 @@
|
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@iarna/toml": "^2.2.5",
|
|
62
|
-
"@netlify/headers-parser": "^8.0.0",
|
|
63
|
-
"@netlify/redirect-parser": "^14.5.1",
|
|
64
62
|
"chalk": "^5.0.0",
|
|
65
63
|
"cron-parser": "^4.1.0",
|
|
66
64
|
"deepmerge": "^4.2.2",
|
|
@@ -75,6 +73,8 @@
|
|
|
75
73
|
"js-yaml": "^4.0.0",
|
|
76
74
|
"map-obj": "^5.0.0",
|
|
77
75
|
"netlify": "^13.3.4",
|
|
76
|
+
"@netlify/headers-parser": "^8.0.0",
|
|
77
|
+
"@netlify/redirect-parser": "^14.5.1",
|
|
78
78
|
"node-fetch": "^3.3.1",
|
|
79
79
|
"omit.js": "^2.0.2",
|
|
80
80
|
"p-locate": "^6.0.0",
|
|
@@ -94,6 +94,5 @@
|
|
|
94
94
|
},
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": "^14.16.0 || >=16.0.0"
|
|
97
|
-
}
|
|
98
|
-
"gitHead": "761c1e087c92c4cf579050e686a5869da5b3ce00"
|
|
97
|
+
}
|
|
99
98
|
}
|