@netlify/build 29.20.6 → 29.20.8
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/core/bin.d.ts +2 -0
- package/lib/core/bin.js +2 -2
- package/lib/core/build.d.ts +84 -0
- package/lib/core/config.d.ts +65 -0
- package/lib/core/constants.d.ts +26 -0
- package/lib/core/dev.d.ts +18 -0
- package/lib/core/dry.d.ts +8 -0
- package/lib/core/feature_flags.d.ts +3 -0
- package/lib/core/flags.d.ts +230 -0
- package/lib/core/lingering.d.ts +7 -0
- package/lib/core/main.d.ts +14 -0
- package/lib/core/main.js +1 -3
- package/lib/core/missing_side_file.d.ts +9 -0
- package/lib/core/normalize_flags.d.ts +38 -0
- package/lib/core/report_metrics.d.ts +12 -0
- package/lib/core/severity.d.ts +38 -0
- package/lib/core/types.d.ts +83 -0
- package/lib/core/user_node_version.d.ts +1 -0
- package/lib/env/changes.d.ts +6 -0
- package/lib/env/main.d.ts +4 -0
- package/lib/env/metadata.d.ts +1 -0
- package/lib/error/api.d.ts +1 -0
- package/lib/error/build.d.ts +7 -0
- package/lib/error/cancel.d.ts +4 -0
- package/lib/error/colors.d.ts +1 -0
- package/lib/error/handle.d.ts +17 -0
- package/lib/error/info.d.ts +6 -0
- package/lib/error/monitor/location.d.ts +1 -0
- package/lib/error/monitor/normalize.d.ts +1 -0
- package/lib/error/monitor/print.d.ts +22 -0
- package/lib/error/monitor/report.d.ts +7 -0
- package/lib/error/monitor/start.d.ts +7 -0
- package/lib/error/parse/clean_stack.d.ts +5 -0
- package/lib/error/parse/location.d.ts +5 -0
- package/lib/error/parse/normalize.d.ts +1 -0
- package/lib/error/parse/parse.d.ts +39 -0
- package/lib/error/parse/plugin.d.ts +9 -0
- package/lib/error/parse/properties.d.ts +5 -0
- package/lib/error/parse/serialize_log.d.ts +14 -0
- package/lib/error/parse/serialize_status.d.ts +16 -0
- package/lib/error/parse/stack.d.ts +11 -0
- package/lib/error/report.d.ts +6 -0
- package/lib/error/type.d.ts +3 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +6 -0
- package/lib/install/functions.d.ts +1 -0
- package/lib/install/local.d.ts +8 -0
- package/lib/install/main.d.ts +9 -0
- package/lib/install/missing.d.ts +12 -0
- package/lib/log/colors.d.ts +19 -0
- package/lib/log/description.d.ts +3 -0
- package/lib/log/header.d.ts +2 -0
- package/lib/log/header_func.d.ts +2 -0
- package/lib/log/logger.d.ts +32 -0
- package/lib/log/messages/compatibility.d.ts +6 -0
- package/lib/log/messages/config.d.ts +21 -0
- package/lib/log/messages/core.d.ts +12 -0
- package/lib/log/messages/core_steps.d.ts +21 -0
- package/lib/log/messages/dry.d.ts +18 -0
- package/lib/log/messages/install.d.ts +4 -0
- package/lib/log/messages/ipc.d.ts +7 -0
- package/lib/log/messages/mutations.d.ts +16 -0
- package/lib/log/messages/plugins.d.ts +8 -0
- package/lib/log/messages/status.d.ts +1 -0
- package/lib/log/messages/steps.d.ts +10 -0
- package/lib/log/serialize.d.ts +2 -0
- package/lib/log/stream.d.ts +10 -0
- package/lib/log/theme.d.ts +19 -0
- package/lib/plugins/child/diff.d.ts +2 -0
- package/lib/plugins/child/error.d.ts +2 -0
- package/lib/plugins/child/lazy.d.ts +1 -0
- package/lib/plugins/child/load.d.ts +14 -0
- package/lib/plugins/child/logic.d.ts +5 -0
- package/lib/plugins/child/main.d.ts +1 -0
- package/lib/plugins/child/run.d.ts +18 -0
- package/lib/plugins/child/status.d.ts +1 -0
- package/lib/plugins/child/typescript.d.ts +2 -0
- package/lib/plugins/child/utils.d.ts +32 -0
- package/lib/plugins/child/validate.d.ts +1 -0
- package/lib/plugins/compatibility.d.ts +33 -0
- package/lib/plugins/error.d.ts +4 -0
- package/lib/plugins/events.d.ts +5 -0
- package/lib/plugins/expected_version.d.ts +10 -0
- package/lib/plugins/internal.d.ts +1 -0
- package/lib/plugins/ipc.d.ts +10 -0
- package/lib/plugins/list.d.ts +9 -0
- package/lib/plugins/load.d.ts +9 -0
- package/lib/plugins/manifest/check.d.ts +10 -0
- package/lib/plugins/manifest/load.d.ts +7 -0
- package/lib/plugins/manifest/main.d.ts +18 -0
- package/lib/plugins/manifest/path.d.ts +5 -0
- package/lib/plugins/manifest/validate.d.ts +1 -0
- package/lib/plugins/node_version.d.ts +22 -0
- package/lib/plugins/options.d.ts +18 -0
- package/lib/plugins/pinned_version.d.ts +24 -0
- package/lib/plugins/resolve.d.ts +17 -0
- package/lib/plugins/spawn.d.ts +2 -0
- package/lib/plugins_core/add.d.ts +13 -0
- package/lib/plugins_core/build_command.d.ts +36 -0
- package/lib/plugins_core/deploy/buildbot_client.d.ts +12 -0
- package/lib/plugins_core/deploy/index.d.ts +30 -0
- package/lib/plugins_core/edge_functions/index.d.ts +27 -0
- package/lib/plugins_core/edge_functions/lib/error.d.ts +1 -0
- package/lib/plugins_core/edge_functions/validate_manifest/validate_edge_functions_manifest.d.ts +2 -0
- package/lib/plugins_core/functions/error.d.ts +1 -0
- package/lib/plugins_core/functions/feature_flags.d.ts +2 -0
- package/lib/plugins_core/functions/index.d.ts +53 -0
- package/lib/plugins_core/functions/utils.d.ts +11 -0
- package/lib/plugins_core/functions/zisi.d.ts +22 -0
- package/lib/plugins_core/functions_install/index.d.ts +6 -0
- package/lib/plugins_core/list.d.ts +8 -0
- package/lib/plugins_core/save_artifacts/index.d.ts +26 -0
- package/lib/plugins_core/secrets_scanning/index.d.ts +16 -0
- package/lib/plugins_core/secrets_scanning/utils.d.ts +67 -0
- package/lib/report/statsd.d.ts +29 -0
- package/lib/status/add.d.ts +9 -0
- package/lib/status/colors.d.ts +1 -0
- package/lib/status/load_error.d.ts +6 -0
- package/lib/status/report.d.ts +14 -0
- package/lib/status/success.d.ts +5 -0
- package/lib/steps/core_step.d.ts +50 -0
- package/lib/steps/error.d.ts +48 -0
- package/lib/steps/get.d.ts +8 -0
- package/lib/steps/plugin.d.ts +39 -0
- package/lib/steps/return.d.ts +55 -0
- package/lib/steps/run_core_steps.d.ts +5 -0
- package/lib/steps/run_step.d.ts +52 -0
- package/lib/steps/run_steps.d.ts +44 -0
- package/lib/steps/update_config.d.ts +23 -0
- package/lib/telemetry/main.d.ts +18 -0
- package/lib/time/aggregate.d.ts +1 -0
- package/lib/time/main.d.ts +16 -0
- package/lib/time/measure.d.ts +10 -0
- package/lib/time/report.d.ts +14 -0
- package/lib/tracing/main.d.ts +29 -0
- package/lib/utils/errors.d.ts +1 -0
- package/lib/utils/json.d.ts +7 -0
- package/lib/utils/omit.d.ts +1 -0
- package/lib/utils/package.d.ts +10 -0
- package/lib/utils/remove_falsy.d.ts +1 -0
- package/lib/utils/resolve.d.ts +8 -0
- package/lib/utils/runtime.d.ts +1 -0
- package/lib/utils/semver.d.ts +2 -0
- package/package.json +12 -15
- package/types/config/inputs.d.ts +1 -1
- package/types/config/netlify_config.d.ts +4 -4
- package/types/index.d.ts +7 -7
- package/types/netlify_event_handler.d.ts +2 -2
- package/types/netlify_plugin.d.ts +2 -2
- package/types/netlify_plugin_options.d.ts +5 -5
- package/types/options/netlify_plugin_cache_util.d.ts +1 -1
- package/types/options/netlify_plugin_run_util.d.ts +1 -1
- package/types/options/netlify_plugin_utils.d.ts +6 -6
- package/types/options/index.d.ts +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function getUtils({ event, constants: { FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC, CACHE_DIR }, runState, }: {
|
|
2
|
+
event: any;
|
|
3
|
+
constants: {
|
|
4
|
+
FUNCTIONS_SRC: any;
|
|
5
|
+
INTERNAL_FUNCTIONS_SRC: any;
|
|
6
|
+
CACHE_DIR: any;
|
|
7
|
+
};
|
|
8
|
+
runState: any;
|
|
9
|
+
}): {
|
|
10
|
+
build: {
|
|
11
|
+
failPlugin: (message: any, opts: any) => never;
|
|
12
|
+
failBuild: any;
|
|
13
|
+
cancelBuild: any;
|
|
14
|
+
};
|
|
15
|
+
cache: {
|
|
16
|
+
save: (paths: any, optsA: any) => any;
|
|
17
|
+
restore: (paths: any, optsA: any) => any;
|
|
18
|
+
remove: (paths: any, optsA: any) => any;
|
|
19
|
+
has: (paths: any, optsA: any) => any;
|
|
20
|
+
list: (optsA: any) => Promise<string[]>;
|
|
21
|
+
getCacheDir: (optsA: any) => string;
|
|
22
|
+
};
|
|
23
|
+
run: (file: string, args?: object | string[] | undefined, options?: Record<string, unknown> | undefined) => import("execa").ExecaChildProcess<string>;
|
|
24
|
+
functions: {
|
|
25
|
+
add: (src: any) => Promise<void>;
|
|
26
|
+
list: any;
|
|
27
|
+
listAll: any;
|
|
28
|
+
};
|
|
29
|
+
status: {
|
|
30
|
+
show: any;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function validatePlugin(logic: any): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function getExpectedVersion({ versions, nodeVersion, packageJson, buildDir, pinnedVersion }: {
|
|
2
|
+
versions: any;
|
|
3
|
+
nodeVersion: any;
|
|
4
|
+
packageJson: any;
|
|
5
|
+
buildDir: any;
|
|
6
|
+
pinnedVersion: any;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
version: any;
|
|
9
|
+
compatWarning: string;
|
|
10
|
+
}>;
|
|
11
|
+
export namespace CONDITIONS {
|
|
12
|
+
namespace nodeVersion {
|
|
13
|
+
export { nodeVersionTest as test };
|
|
14
|
+
export { nodeVersionWarning as warning };
|
|
15
|
+
}
|
|
16
|
+
namespace siteDependencies {
|
|
17
|
+
export { siteDependenciesTest as test };
|
|
18
|
+
export { siteDependenciesWarning as warning };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare function nodeVersionTest(allowedNodeVersion: any, { nodeVersion }: {
|
|
22
|
+
nodeVersion: any;
|
|
23
|
+
}): boolean;
|
|
24
|
+
declare function nodeVersionWarning(allowedNodeVersion: any): string;
|
|
25
|
+
declare function siteDependenciesTest(allowedSiteDependencies: any, { packageJson: { devDependencies, dependencies }, buildDir }: {
|
|
26
|
+
packageJson: {
|
|
27
|
+
devDependencies: any;
|
|
28
|
+
dependencies: any;
|
|
29
|
+
};
|
|
30
|
+
buildDir: any;
|
|
31
|
+
}): Promise<any>;
|
|
32
|
+
declare function siteDependenciesWarning(allowedSiteDependencies: any): string;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export function failBuild(message: any, opts: any): never;
|
|
2
|
+
export function failPlugin(message: any, opts: any): never;
|
|
3
|
+
export function cancelBuild(message: any, opts: any): never;
|
|
4
|
+
export function failPluginWithWarning(methodName: any, event: any, message: any, opts: any): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function addExpectedVersions({ pluginsOptions, autoPluginsDir, packageJson, debug, logs, buildDir, testOpts, featureFlags, }: {
|
|
2
|
+
pluginsOptions: any;
|
|
3
|
+
autoPluginsDir: any;
|
|
4
|
+
packageJson: any;
|
|
5
|
+
debug: any;
|
|
6
|
+
logs: any;
|
|
7
|
+
buildDir: any;
|
|
8
|
+
testOpts: any;
|
|
9
|
+
featureFlags: any;
|
|
10
|
+
}): Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isNetlifyMaintainedPlugin: (pluginPackage: string) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function callChild({ childProcess, eventName, payload, logs, verbose }: {
|
|
2
|
+
childProcess: any;
|
|
3
|
+
eventName: any;
|
|
4
|
+
payload: any;
|
|
5
|
+
logs: any;
|
|
6
|
+
verbose: any;
|
|
7
|
+
}): Promise<any>;
|
|
8
|
+
export function getEventFromChild(childProcess: any, callId: any): Promise<any>;
|
|
9
|
+
export function getEventsFromParent(callback: any): Promise<any>;
|
|
10
|
+
export function sendEventToParent(callId: any, payload: any, verbose: any, error: any): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function checkInputs({ inputs, manifest: { inputs: rules }, packageName, pluginPackageJson, loadedFrom, origin, }: {
|
|
2
|
+
inputs: any;
|
|
3
|
+
manifest: {
|
|
4
|
+
inputs?: any[] | undefined;
|
|
5
|
+
};
|
|
6
|
+
packageName: any;
|
|
7
|
+
pluginPackageJson: any;
|
|
8
|
+
loadedFrom: any;
|
|
9
|
+
origin: any;
|
|
10
|
+
}): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PackageJson } from 'read-pkg-up';
|
|
2
|
+
/**
|
|
3
|
+
* Load plugin's `manifest.yml`
|
|
4
|
+
*/
|
|
5
|
+
export declare const useManifest: ({ packageName, loadedFrom, origin, inputs, }: {
|
|
6
|
+
packageName: string;
|
|
7
|
+
loadedFrom?: unknown;
|
|
8
|
+
origin?: unknown;
|
|
9
|
+
inputs?: unknown;
|
|
10
|
+
}, { pluginDir, packageDir, pluginPackageJson, pluginPackageJson: { version }, debug, }: {
|
|
11
|
+
pluginDir: string;
|
|
12
|
+
packageDir?: string | undefined;
|
|
13
|
+
pluginPackageJson: PackageJson;
|
|
14
|
+
debug: boolean;
|
|
15
|
+
}) => Promise<{
|
|
16
|
+
manifest: any;
|
|
17
|
+
inputs: any;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function validateManifest(manifest: any, rawManifest: any): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PluginsLoadedFrom = 'auto_install' | 'local' | 'package.json';
|
|
2
|
+
export type PluginsOptions = {
|
|
3
|
+
packageName: string;
|
|
4
|
+
pluginPath?: any;
|
|
5
|
+
pinnedVersion?: any;
|
|
6
|
+
loadedFrom: PluginsLoadedFrom;
|
|
7
|
+
origin: 'config' | string;
|
|
8
|
+
inputs: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Local plugins and `package.json`-installed plugins use user's preferred Node.js version if higher than our minimum
|
|
12
|
+
* supported version. Else default to the system Node version.
|
|
13
|
+
* Local and programmatic builds use `@netlify/build` Node.js version, which is
|
|
14
|
+
* usually the system's Node.js version.
|
|
15
|
+
* If the user Node version does not satisfy our supported engine range use our own system Node version
|
|
16
|
+
*/
|
|
17
|
+
export declare const addPluginsNodeVersion: ({ pluginsOptions, nodePath, userNodeVersion, logs }: {
|
|
18
|
+
pluginsOptions: any;
|
|
19
|
+
nodePath: any;
|
|
20
|
+
userNodeVersion: any;
|
|
21
|
+
logs: any;
|
|
22
|
+
}) => any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PackageJson } from 'read-pkg-up';
|
|
2
|
+
export declare const getPluginsOptions: any;
|
|
3
|
+
/**
|
|
4
|
+
* Retrieve information about @netlify/build when an error happens there and not
|
|
5
|
+
* in a plugin
|
|
6
|
+
*/
|
|
7
|
+
export declare const getSpawnInfo: () => {
|
|
8
|
+
plugin: {
|
|
9
|
+
packageName: string;
|
|
10
|
+
pluginPackageJson: PackageJson;
|
|
11
|
+
};
|
|
12
|
+
location: {
|
|
13
|
+
event: 'load';
|
|
14
|
+
packageName: string;
|
|
15
|
+
loadedFrom: 'core';
|
|
16
|
+
origin: 'core';
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function addPinnedVersions({ pluginsOptions, api, siteInfo: { id: siteId }, sendStatus }: {
|
|
2
|
+
pluginsOptions: any;
|
|
3
|
+
api: any;
|
|
4
|
+
siteInfo: {
|
|
5
|
+
id: any;
|
|
6
|
+
};
|
|
7
|
+
sendStatus: any;
|
|
8
|
+
}): Promise<any>;
|
|
9
|
+
export function pinPlugins({ pluginsOptions, failedPlugins, api, siteInfo: { id: siteId }, childEnv, mode, netlifyConfig, errorMonitor, logs, debug, testOpts, sendStatus, }: {
|
|
10
|
+
pluginsOptions: any;
|
|
11
|
+
failedPlugins: any;
|
|
12
|
+
api: any;
|
|
13
|
+
siteInfo: {
|
|
14
|
+
id: any;
|
|
15
|
+
};
|
|
16
|
+
childEnv: any;
|
|
17
|
+
mode: any;
|
|
18
|
+
netlifyConfig: any;
|
|
19
|
+
errorMonitor: any;
|
|
20
|
+
logs: any;
|
|
21
|
+
debug: any;
|
|
22
|
+
testOpts: any;
|
|
23
|
+
sendStatus: any;
|
|
24
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function resolvePluginsPath({ pluginsOptions, siteInfo, buildDir, packagePath, nodePath, packageJson, userNodeVersion, mode, api, logs, debug, sendStatus, testOpts, featureFlags, integrations, }: {
|
|
2
|
+
pluginsOptions: any;
|
|
3
|
+
siteInfo: any;
|
|
4
|
+
buildDir: any;
|
|
5
|
+
packagePath: any;
|
|
6
|
+
nodePath: any;
|
|
7
|
+
packageJson: any;
|
|
8
|
+
userNodeVersion: any;
|
|
9
|
+
mode: any;
|
|
10
|
+
api: any;
|
|
11
|
+
logs: any;
|
|
12
|
+
debug: any;
|
|
13
|
+
sendStatus: any;
|
|
14
|
+
testOpts: any;
|
|
15
|
+
featureFlags: any;
|
|
16
|
+
integrations: any;
|
|
17
|
+
}): Promise<any[]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function addCorePlugins({ netlifyConfig: { plugins }, constants }: {
|
|
2
|
+
netlifyConfig: {
|
|
3
|
+
plugins: any;
|
|
4
|
+
};
|
|
5
|
+
constants: any;
|
|
6
|
+
}): {
|
|
7
|
+
packageName: any;
|
|
8
|
+
pluginPath: any;
|
|
9
|
+
pinnedVersion: any;
|
|
10
|
+
loadedFrom: any;
|
|
11
|
+
origin: any;
|
|
12
|
+
inputs: any;
|
|
13
|
+
}[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export namespace buildCommandCore {
|
|
2
|
+
export let event: string;
|
|
3
|
+
export { coreStep };
|
|
4
|
+
export let coreStepId: string;
|
|
5
|
+
export let coreStepName: string;
|
|
6
|
+
export { coreStepDescription };
|
|
7
|
+
export { hasBuildCommand as condition };
|
|
8
|
+
}
|
|
9
|
+
declare function coreStep({ configPath, buildDir, nodePath, childEnv, logs, netlifyConfig: { build: { command: buildCommand, commandOrigin: buildCommandOrigin }, }, }: {
|
|
10
|
+
configPath: any;
|
|
11
|
+
buildDir: any;
|
|
12
|
+
nodePath: any;
|
|
13
|
+
childEnv: any;
|
|
14
|
+
logs: any;
|
|
15
|
+
netlifyConfig: {
|
|
16
|
+
build: {
|
|
17
|
+
command: any;
|
|
18
|
+
commandOrigin: any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}): Promise<{}>;
|
|
22
|
+
declare function coreStepDescription({ netlifyConfig: { build: { commandOrigin: buildCommandOrigin }, }, }: {
|
|
23
|
+
netlifyConfig: {
|
|
24
|
+
build: {
|
|
25
|
+
commandOrigin: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}): any;
|
|
29
|
+
declare function hasBuildCommand({ netlifyConfig: { build: { command: buildCommand }, }, }: {
|
|
30
|
+
netlifyConfig: {
|
|
31
|
+
build: {
|
|
32
|
+
command: any;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}): boolean;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
export function createBuildbotClient(buildbotServerSocket: any): net.Socket;
|
|
3
|
+
export const connectBuildbotClient: (...args: any[]) => Promise<any>;
|
|
4
|
+
export function closeBuildbotClient(client: any): Promise<void>;
|
|
5
|
+
export function deploySiteWithBuildbotClient({ client, events, buildDir, repositoryRoot, constants }: {
|
|
6
|
+
client: any;
|
|
7
|
+
events: any;
|
|
8
|
+
buildDir: any;
|
|
9
|
+
repositoryRoot: any;
|
|
10
|
+
constants: any;
|
|
11
|
+
}): Promise<undefined>;
|
|
12
|
+
import net from 'net';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function shouldDeploy({ buildbotServerSocket }: {
|
|
2
|
+
buildbotServerSocket: any;
|
|
3
|
+
}): boolean;
|
|
4
|
+
export namespace deploySite {
|
|
5
|
+
export let event: string;
|
|
6
|
+
export { coreStep };
|
|
7
|
+
export let coreStepId: string;
|
|
8
|
+
export let coreStepName: string;
|
|
9
|
+
export function coreStepDescription(): string;
|
|
10
|
+
export { shouldDeploy as condition };
|
|
11
|
+
}
|
|
12
|
+
declare function coreStep({ buildDir, configPath, repositoryRoot, packagePath, constants, buildbotServerSocket, events, logs, featureFlags, context, branch, configMutations, headersPath, redirectsPath, debug, saveConfig, }: {
|
|
13
|
+
buildDir: any;
|
|
14
|
+
configPath: any;
|
|
15
|
+
repositoryRoot: any;
|
|
16
|
+
packagePath: any;
|
|
17
|
+
constants: any;
|
|
18
|
+
buildbotServerSocket: any;
|
|
19
|
+
events: any;
|
|
20
|
+
logs: any;
|
|
21
|
+
featureFlags: any;
|
|
22
|
+
context: any;
|
|
23
|
+
branch: any;
|
|
24
|
+
configMutations: any;
|
|
25
|
+
headersPath: any;
|
|
26
|
+
redirectsPath: any;
|
|
27
|
+
debug: any;
|
|
28
|
+
saveConfig: any;
|
|
29
|
+
}): Promise<{}>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Metric } from '../../core/report_metrics.js';
|
|
2
|
+
export declare const bundleEdgeFunctions: {
|
|
3
|
+
event: string;
|
|
4
|
+
coreStep: ({ buildDir, constants: { EDGE_FUNCTIONS_DIST: distDirectory, EDGE_FUNCTIONS_SRC: srcDirectory, INTERNAL_EDGE_FUNCTIONS_SRC: internalSrcDirectory, IS_LOCAL: isRunningLocally, }, debug, systemLog, featureFlags, logs, netlifyConfig, edgeFunctionsBootstrapURL, }: {
|
|
5
|
+
buildDir: string;
|
|
6
|
+
packagePath: string;
|
|
7
|
+
constants: Record<string, string>;
|
|
8
|
+
debug: boolean;
|
|
9
|
+
systemLog(...args: any[]): void;
|
|
10
|
+
featureFlags: Record<string, any>;
|
|
11
|
+
logs: any;
|
|
12
|
+
netlifyConfig: any;
|
|
13
|
+
edgeFunctionsBootstrapURL?: string | undefined;
|
|
14
|
+
}) => Promise<{
|
|
15
|
+
metrics: Metric[];
|
|
16
|
+
}>;
|
|
17
|
+
coreStepId: string;
|
|
18
|
+
coreStepName: string;
|
|
19
|
+
coreStepDescription: () => string;
|
|
20
|
+
condition: ({ buildDir, constants: { INTERNAL_EDGE_FUNCTIONS_SRC, EDGE_FUNCTIONS_SRC }, }: {
|
|
21
|
+
buildDir: any;
|
|
22
|
+
constants: {
|
|
23
|
+
INTERNAL_EDGE_FUNCTIONS_SRC: any;
|
|
24
|
+
EDGE_FUNCTIONS_SRC: any;
|
|
25
|
+
};
|
|
26
|
+
}) => Promise<boolean>;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function tagBundlingError(error: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getZipError(error: any, functionsSrc: any): Promise<any>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NodeBundlerName } from '@netlify/zip-it-and-ship-it';
|
|
2
|
+
export declare const bundleFunctions: {
|
|
3
|
+
event: string;
|
|
4
|
+
coreStep: ({ childEnv, constants: { INTERNAL_FUNCTIONS_SRC: relativeInternalFunctionsSrc, IS_LOCAL: isRunningLocally, FUNCTIONS_SRC: relativeFunctionsSrc, FUNCTIONS_DIST: relativeFunctionsDist, }, buildDir, logs, netlifyConfig, featureFlags, repositoryRoot, userNodeVersion, systemLog, }: {
|
|
5
|
+
childEnv: any;
|
|
6
|
+
constants: {
|
|
7
|
+
INTERNAL_FUNCTIONS_SRC: any;
|
|
8
|
+
IS_LOCAL: any;
|
|
9
|
+
FUNCTIONS_SRC: any;
|
|
10
|
+
FUNCTIONS_DIST: any;
|
|
11
|
+
};
|
|
12
|
+
buildDir: any;
|
|
13
|
+
logs: any;
|
|
14
|
+
netlifyConfig: any;
|
|
15
|
+
featureFlags: any;
|
|
16
|
+
repositoryRoot: any;
|
|
17
|
+
userNodeVersion: any;
|
|
18
|
+
systemLog: any;
|
|
19
|
+
}) => Promise<{
|
|
20
|
+
tags?: undefined;
|
|
21
|
+
metrics?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
tags: {
|
|
24
|
+
bundler: NodeBundlerName[];
|
|
25
|
+
};
|
|
26
|
+
metrics: {
|
|
27
|
+
type: string;
|
|
28
|
+
name: string;
|
|
29
|
+
value: number;
|
|
30
|
+
tags: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
}[];
|
|
34
|
+
}>;
|
|
35
|
+
coreStepId: string;
|
|
36
|
+
coreStepName: string;
|
|
37
|
+
coreStepDescription: () => string;
|
|
38
|
+
condition: ({ buildDir, constants: { INTERNAL_FUNCTIONS_SRC, FUNCTIONS_SRC } }: {
|
|
39
|
+
buildDir: any;
|
|
40
|
+
constants: {
|
|
41
|
+
INTERNAL_FUNCTIONS_SRC: any;
|
|
42
|
+
FUNCTIONS_SRC: any;
|
|
43
|
+
};
|
|
44
|
+
}) => Promise<boolean>;
|
|
45
|
+
};
|
|
46
|
+
export declare const zipItAndShipIt: {
|
|
47
|
+
zipFunctions(args_0: string | string[], args_1: string, args_2?: import("@netlify/zip-it-and-ship-it").ZipFunctionsOptions | undefined): Promise<(Omit<import("@netlify/zip-it-and-ship-it/dist/function.js").FunctionArchive, "runtime"> & {
|
|
48
|
+
routes?: import("@netlify/zip-it-and-ship-it/dist/utils/routes.js").Route[] | undefined;
|
|
49
|
+
runtime: import("@netlify/zip-it-and-ship-it").RuntimeName;
|
|
50
|
+
schedule?: string | undefined;
|
|
51
|
+
runtimeAPIVersion?: number | undefined;
|
|
52
|
+
})[]>;
|
|
53
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function getUserAndInternalFunctions({ featureFlags, functionsSrc, functionsSrcExists, internalFunctionsSrc, internalFunctionsSrcExists, }: {
|
|
2
|
+
featureFlags: any;
|
|
3
|
+
functionsSrc: any;
|
|
4
|
+
functionsSrcExists: any;
|
|
5
|
+
internalFunctionsSrc: any;
|
|
6
|
+
internalFunctionsSrcExists: any;
|
|
7
|
+
}): Promise<any[]>;
|
|
8
|
+
export function validateFunctionsSrc({ functionsSrc, relativeFunctionsSrc }: {
|
|
9
|
+
functionsSrc: any;
|
|
10
|
+
relativeFunctionsSrc: any;
|
|
11
|
+
}): Promise<boolean>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FunctionConfig, ZipFunctionsOptions } from '@netlify/zip-it-and-ship-it';
|
|
2
|
+
import type { FeatureFlags } from '../../core/feature_flags.js';
|
|
3
|
+
type GetZisiParametersType = {
|
|
4
|
+
buildDir: string;
|
|
5
|
+
childEnv: Record<string, string>;
|
|
6
|
+
featureFlags: FeatureFlags;
|
|
7
|
+
functionsConfig: Record<string, any>;
|
|
8
|
+
functionsDist: string;
|
|
9
|
+
internalFunctionsSrc: string;
|
|
10
|
+
isRunningLocally: boolean;
|
|
11
|
+
repositoryRoot: string;
|
|
12
|
+
userNodeVersion: string;
|
|
13
|
+
systemLog: ZipFunctionsOptions['systemLog'];
|
|
14
|
+
};
|
|
15
|
+
export declare const getZisiParameters: ({ buildDir, childEnv, featureFlags, functionsConfig, functionsDist, internalFunctionsSrc, isRunningLocally, repositoryRoot, userNodeVersion, systemLog, }: GetZisiParametersType) => ZipFunctionsOptions;
|
|
16
|
+
export declare const normalizeFunctionConfig: ({ buildDir, functionConfig, isRunningLocally, nodeVersion, }: {
|
|
17
|
+
buildDir: string;
|
|
18
|
+
functionConfig: Record<string, any>;
|
|
19
|
+
isRunningLocally: boolean;
|
|
20
|
+
nodeVersion: string | undefined;
|
|
21
|
+
}) => FunctionConfig;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export namespace saveArtifacts {
|
|
2
|
+
export let event: string;
|
|
3
|
+
export { coreStep };
|
|
4
|
+
export let coreStepId: string;
|
|
5
|
+
export let coreStepName: string;
|
|
6
|
+
export function coreStepDescription(): string;
|
|
7
|
+
export { shouldSaveArtifacts as condition };
|
|
8
|
+
}
|
|
9
|
+
declare function coreStep({ buildDir, configPath, packagePath, outputConfigPath, repositoryRoot, logs, featureFlags, context, branch, configMutations, headersPath, redirectsPath, debug, saveConfig, }: {
|
|
10
|
+
buildDir: any;
|
|
11
|
+
configPath: any;
|
|
12
|
+
packagePath: any;
|
|
13
|
+
outputConfigPath: any;
|
|
14
|
+
repositoryRoot: any;
|
|
15
|
+
logs: any;
|
|
16
|
+
featureFlags: any;
|
|
17
|
+
context: any;
|
|
18
|
+
branch: any;
|
|
19
|
+
configMutations: any;
|
|
20
|
+
headersPath: any;
|
|
21
|
+
redirectsPath: any;
|
|
22
|
+
debug: any;
|
|
23
|
+
saveConfig: any;
|
|
24
|
+
}): Promise<{}>;
|
|
25
|
+
declare function shouldSaveArtifacts(options: any): boolean;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const scanForSecrets: {
|
|
2
|
+
event: string;
|
|
3
|
+
coreStep: ({ buildDir, logs, netlifyConfig, explicitSecretKeys, systemLog }: {
|
|
4
|
+
buildDir: any;
|
|
5
|
+
logs: any;
|
|
6
|
+
netlifyConfig: any;
|
|
7
|
+
explicitSecretKeys: any;
|
|
8
|
+
systemLog: any;
|
|
9
|
+
}) => Promise<{}>;
|
|
10
|
+
coreStepId: string;
|
|
11
|
+
coreStepName: string;
|
|
12
|
+
coreStepDescription: () => string;
|
|
13
|
+
condition: ({ explicitSecretKeys }: {
|
|
14
|
+
explicitSecretKeys: any;
|
|
15
|
+
}) => boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface ScanResults {
|
|
2
|
+
matches: MatchResult[];
|
|
3
|
+
scannedFilesCount: number;
|
|
4
|
+
}
|
|
5
|
+
interface ScanArgs {
|
|
6
|
+
env: Record<string, unknown>;
|
|
7
|
+
keys: string[];
|
|
8
|
+
base: string;
|
|
9
|
+
filePaths: string[];
|
|
10
|
+
}
|
|
11
|
+
interface MatchResult {
|
|
12
|
+
lineNumber: number;
|
|
13
|
+
key: string;
|
|
14
|
+
file: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Determine if the user disabled scanning via env var
|
|
18
|
+
* @param env current envars
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function isSecretsScanningEnabled(env: Record<string, unknown>): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* given the explicit secret keys and env vars, return the list of secret keys which have non-empty or non-trivial values. This
|
|
24
|
+
* will also filter out keys passed in the SECRETS_SCAN_OMIT_KEYS env var.
|
|
25
|
+
*
|
|
26
|
+
* non-trivial values are values that are:
|
|
27
|
+
* - >4 characters/digits
|
|
28
|
+
* - not booleans
|
|
29
|
+
*
|
|
30
|
+
* @param env env vars list
|
|
31
|
+
* @param secretKeys
|
|
32
|
+
* @returns string[]
|
|
33
|
+
*/
|
|
34
|
+
export declare function getSecretKeysToScanFor(env: Record<string, unknown>, secretKeys: string[]): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Given the env and base directory, find all file paths to scan. It will look at the
|
|
37
|
+
* env vars to decide if it should omit certain paths.
|
|
38
|
+
*
|
|
39
|
+
* @param options
|
|
40
|
+
* @returns string[] of relative paths from base of files that should be searched
|
|
41
|
+
*/
|
|
42
|
+
export declare function getFilePathsToScan({ env, base }: {
|
|
43
|
+
env: any;
|
|
44
|
+
base: any;
|
|
45
|
+
}): Promise<string[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Given the env vars, the current keys, paths, etc. Look across the provided files to find the values
|
|
48
|
+
* of the secrets based on the keys provided. It will process files separately in different read streams.
|
|
49
|
+
* The values that it looks for will be a unique set of plaintext, base64 encoded, and uri encoded permutations
|
|
50
|
+
* of each value - to catch common permutations that occur post build.
|
|
51
|
+
*
|
|
52
|
+
* @param scanArgs {ScanArgs} scan options
|
|
53
|
+
* @returns promise with all of the scan results, if any
|
|
54
|
+
*/
|
|
55
|
+
export declare function scanFilesForKeyValues({ env, keys, filePaths, base }: ScanArgs): Promise<ScanResults>;
|
|
56
|
+
/**
|
|
57
|
+
* ScanResults are all of the finds for all keys and their disparate locations. Scanning is
|
|
58
|
+
* async in streams so order can change a lot. This function groups the results into an object
|
|
59
|
+
* where the keys are the env var keys and the values are all match results for that key
|
|
60
|
+
*
|
|
61
|
+
* @param scanResults
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
export declare function groupScanResultsByKey(scanResults: ScanResults): {
|
|
65
|
+
[key: string]: MatchResult[];
|
|
66
|
+
};
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StatsD } from 'hot-shots';
|
|
2
|
+
export interface InputStatsDOptions {
|
|
3
|
+
host?: string;
|
|
4
|
+
port?: number;
|
|
5
|
+
}
|
|
6
|
+
export type StatsDOptions = Required<InputStatsDOptions>;
|
|
7
|
+
export declare const validateStatsDOptions: (statsdOpts: InputStatsDOptions) => statsdOpts is Required<InputStatsDOptions>;
|
|
8
|
+
/**
|
|
9
|
+
* Start a new StatsD Client and a new UDP socket
|
|
10
|
+
*/
|
|
11
|
+
export declare const startClient: (statsdOpts: StatsDOptions) => Promise<StatsD>;
|
|
12
|
+
/**
|
|
13
|
+
* Close the StatsD Client
|
|
14
|
+
*
|
|
15
|
+
* UDP packets are buffered and flushed every 10 seconds and
|
|
16
|
+
* closing the client forces all buffered metrics to be flushed.
|
|
17
|
+
*/
|
|
18
|
+
export declare const closeClient: (client: StatsD) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Make sure the timer name does not include special characters.
|
|
21
|
+
* For example, the `packageName` of local plugins includes dots.
|
|
22
|
+
*/
|
|
23
|
+
export declare const normalizeTagName: (name: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Formats and flattens the tags as array
|
|
26
|
+
* We do this because we might send the same tag with different values `{ tag: ['a', 'b'] }`
|
|
27
|
+
* which cannot be represented in an flattened object and `hot-shots` also supports tags as array in the format `['tag:a', 'tag:b']`
|
|
28
|
+
*/
|
|
29
|
+
export declare const formatTags: (tags: Record<string, string | string[]>) => string[];
|