@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.
Files changed (154) hide show
  1. package/lib/core/bin.d.ts +2 -0
  2. package/lib/core/bin.js +2 -2
  3. package/lib/core/build.d.ts +84 -0
  4. package/lib/core/config.d.ts +65 -0
  5. package/lib/core/constants.d.ts +26 -0
  6. package/lib/core/dev.d.ts +18 -0
  7. package/lib/core/dry.d.ts +8 -0
  8. package/lib/core/feature_flags.d.ts +3 -0
  9. package/lib/core/flags.d.ts +230 -0
  10. package/lib/core/lingering.d.ts +7 -0
  11. package/lib/core/main.d.ts +14 -0
  12. package/lib/core/main.js +1 -3
  13. package/lib/core/missing_side_file.d.ts +9 -0
  14. package/lib/core/normalize_flags.d.ts +38 -0
  15. package/lib/core/report_metrics.d.ts +12 -0
  16. package/lib/core/severity.d.ts +38 -0
  17. package/lib/core/types.d.ts +83 -0
  18. package/lib/core/user_node_version.d.ts +1 -0
  19. package/lib/env/changes.d.ts +6 -0
  20. package/lib/env/main.d.ts +4 -0
  21. package/lib/env/metadata.d.ts +1 -0
  22. package/lib/error/api.d.ts +1 -0
  23. package/lib/error/build.d.ts +7 -0
  24. package/lib/error/cancel.d.ts +4 -0
  25. package/lib/error/colors.d.ts +1 -0
  26. package/lib/error/handle.d.ts +17 -0
  27. package/lib/error/info.d.ts +6 -0
  28. package/lib/error/monitor/location.d.ts +1 -0
  29. package/lib/error/monitor/normalize.d.ts +1 -0
  30. package/lib/error/monitor/print.d.ts +22 -0
  31. package/lib/error/monitor/report.d.ts +7 -0
  32. package/lib/error/monitor/start.d.ts +7 -0
  33. package/lib/error/parse/clean_stack.d.ts +5 -0
  34. package/lib/error/parse/location.d.ts +5 -0
  35. package/lib/error/parse/normalize.d.ts +1 -0
  36. package/lib/error/parse/parse.d.ts +39 -0
  37. package/lib/error/parse/plugin.d.ts +9 -0
  38. package/lib/error/parse/properties.d.ts +5 -0
  39. package/lib/error/parse/serialize_log.d.ts +14 -0
  40. package/lib/error/parse/serialize_status.d.ts +16 -0
  41. package/lib/error/parse/stack.d.ts +11 -0
  42. package/lib/error/report.d.ts +6 -0
  43. package/lib/error/type.d.ts +3 -0
  44. package/lib/index.d.ts +5 -0
  45. package/lib/index.js +6 -0
  46. package/lib/install/functions.d.ts +1 -0
  47. package/lib/install/local.d.ts +8 -0
  48. package/lib/install/main.d.ts +9 -0
  49. package/lib/install/missing.d.ts +12 -0
  50. package/lib/log/colors.d.ts +19 -0
  51. package/lib/log/description.d.ts +3 -0
  52. package/lib/log/header.d.ts +2 -0
  53. package/lib/log/header_func.d.ts +2 -0
  54. package/lib/log/logger.d.ts +32 -0
  55. package/lib/log/messages/compatibility.d.ts +6 -0
  56. package/lib/log/messages/config.d.ts +21 -0
  57. package/lib/log/messages/core.d.ts +12 -0
  58. package/lib/log/messages/core_steps.d.ts +21 -0
  59. package/lib/log/messages/dry.d.ts +18 -0
  60. package/lib/log/messages/install.d.ts +4 -0
  61. package/lib/log/messages/ipc.d.ts +7 -0
  62. package/lib/log/messages/mutations.d.ts +16 -0
  63. package/lib/log/messages/plugins.d.ts +8 -0
  64. package/lib/log/messages/status.d.ts +1 -0
  65. package/lib/log/messages/steps.d.ts +10 -0
  66. package/lib/log/serialize.d.ts +2 -0
  67. package/lib/log/stream.d.ts +10 -0
  68. package/lib/log/theme.d.ts +19 -0
  69. package/lib/plugins/child/diff.d.ts +2 -0
  70. package/lib/plugins/child/error.d.ts +2 -0
  71. package/lib/plugins/child/lazy.d.ts +1 -0
  72. package/lib/plugins/child/load.d.ts +14 -0
  73. package/lib/plugins/child/logic.d.ts +5 -0
  74. package/lib/plugins/child/main.d.ts +1 -0
  75. package/lib/plugins/child/run.d.ts +18 -0
  76. package/lib/plugins/child/status.d.ts +1 -0
  77. package/lib/plugins/child/typescript.d.ts +2 -0
  78. package/lib/plugins/child/utils.d.ts +32 -0
  79. package/lib/plugins/child/validate.d.ts +1 -0
  80. package/lib/plugins/compatibility.d.ts +33 -0
  81. package/lib/plugins/error.d.ts +4 -0
  82. package/lib/plugins/events.d.ts +5 -0
  83. package/lib/plugins/expected_version.d.ts +10 -0
  84. package/lib/plugins/internal.d.ts +1 -0
  85. package/lib/plugins/ipc.d.ts +10 -0
  86. package/lib/plugins/list.d.ts +9 -0
  87. package/lib/plugins/load.d.ts +9 -0
  88. package/lib/plugins/manifest/check.d.ts +10 -0
  89. package/lib/plugins/manifest/load.d.ts +7 -0
  90. package/lib/plugins/manifest/main.d.ts +18 -0
  91. package/lib/plugins/manifest/path.d.ts +5 -0
  92. package/lib/plugins/manifest/validate.d.ts +1 -0
  93. package/lib/plugins/node_version.d.ts +22 -0
  94. package/lib/plugins/options.d.ts +18 -0
  95. package/lib/plugins/pinned_version.d.ts +24 -0
  96. package/lib/plugins/resolve.d.ts +17 -0
  97. package/lib/plugins/spawn.d.ts +2 -0
  98. package/lib/plugins_core/add.d.ts +13 -0
  99. package/lib/plugins_core/build_command.d.ts +36 -0
  100. package/lib/plugins_core/deploy/buildbot_client.d.ts +12 -0
  101. package/lib/plugins_core/deploy/index.d.ts +30 -0
  102. package/lib/plugins_core/edge_functions/index.d.ts +27 -0
  103. package/lib/plugins_core/edge_functions/lib/error.d.ts +1 -0
  104. package/lib/plugins_core/edge_functions/validate_manifest/validate_edge_functions_manifest.d.ts +2 -0
  105. package/lib/plugins_core/functions/error.d.ts +1 -0
  106. package/lib/plugins_core/functions/feature_flags.d.ts +2 -0
  107. package/lib/plugins_core/functions/index.d.ts +53 -0
  108. package/lib/plugins_core/functions/utils.d.ts +11 -0
  109. package/lib/plugins_core/functions/zisi.d.ts +22 -0
  110. package/lib/plugins_core/functions_install/index.d.ts +6 -0
  111. package/lib/plugins_core/list.d.ts +8 -0
  112. package/lib/plugins_core/save_artifacts/index.d.ts +26 -0
  113. package/lib/plugins_core/secrets_scanning/index.d.ts +16 -0
  114. package/lib/plugins_core/secrets_scanning/utils.d.ts +67 -0
  115. package/lib/report/statsd.d.ts +29 -0
  116. package/lib/status/add.d.ts +9 -0
  117. package/lib/status/colors.d.ts +1 -0
  118. package/lib/status/load_error.d.ts +6 -0
  119. package/lib/status/report.d.ts +14 -0
  120. package/lib/status/success.d.ts +5 -0
  121. package/lib/steps/core_step.d.ts +50 -0
  122. package/lib/steps/error.d.ts +48 -0
  123. package/lib/steps/get.d.ts +8 -0
  124. package/lib/steps/plugin.d.ts +39 -0
  125. package/lib/steps/return.d.ts +55 -0
  126. package/lib/steps/run_core_steps.d.ts +5 -0
  127. package/lib/steps/run_step.d.ts +52 -0
  128. package/lib/steps/run_steps.d.ts +44 -0
  129. package/lib/steps/update_config.d.ts +23 -0
  130. package/lib/telemetry/main.d.ts +18 -0
  131. package/lib/time/aggregate.d.ts +1 -0
  132. package/lib/time/main.d.ts +16 -0
  133. package/lib/time/measure.d.ts +10 -0
  134. package/lib/time/report.d.ts +14 -0
  135. package/lib/tracing/main.d.ts +29 -0
  136. package/lib/utils/errors.d.ts +1 -0
  137. package/lib/utils/json.d.ts +7 -0
  138. package/lib/utils/omit.d.ts +1 -0
  139. package/lib/utils/package.d.ts +10 -0
  140. package/lib/utils/remove_falsy.d.ts +1 -0
  141. package/lib/utils/resolve.d.ts +8 -0
  142. package/lib/utils/runtime.d.ts +1 -0
  143. package/lib/utils/semver.d.ts +2 -0
  144. package/package.json +12 -15
  145. package/types/config/inputs.d.ts +1 -1
  146. package/types/config/netlify_config.d.ts +4 -4
  147. package/types/index.d.ts +7 -7
  148. package/types/netlify_event_handler.d.ts +2 -2
  149. package/types/netlify_plugin.d.ts +2 -2
  150. package/types/netlify_plugin_options.d.ts +5 -5
  151. package/types/options/netlify_plugin_cache_util.d.ts +1 -1
  152. package/types/options/netlify_plugin_run_util.d.ts +1 -1
  153. package/types/options/netlify_plugin_utils.d.ts +6 -6
  154. 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,5 @@
1
+ export const isSoftFailEvent: any;
2
+ export const runsAlsoOnBuildFailure: any;
3
+ export const runsOnlyOnBuildFailure: any;
4
+ export const runsAfterDeploy: any;
5
+ export { DEV_EVENTS, EVENTS } from "@netlify/config";
@@ -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,9 @@
1
+ export function getPluginsList({ debug, logs, testOpts: { pluginsListUrl } }: {
2
+ debug: any;
3
+ logs: any;
4
+ testOpts: {
5
+ pluginsListUrl: any;
6
+ };
7
+ }): Promise<never[] | {
8
+ [k: string]: any;
9
+ }>;
@@ -0,0 +1,9 @@
1
+ export function loadPlugins({ pluginsOptions, childProcesses, packageJson, timers, logs, debug, verbose, }: {
2
+ pluginsOptions: any;
3
+ childProcesses: any;
4
+ packageJson: any;
5
+ timers: any;
6
+ logs: any;
7
+ debug: any;
8
+ verbose: any;
9
+ }): Promise<any>;
@@ -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,7 @@
1
+ export function loadManifest({ manifestPath, packageName, pluginPackageJson, loadedFrom, origin }: {
2
+ manifestPath: any;
3
+ packageName: any;
4
+ pluginPackageJson: any;
5
+ loadedFrom: any;
6
+ origin: any;
7
+ }): Promise<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,5 @@
1
+ export function getManifestPath({ pluginDir, packageDir, packageName }: {
2
+ pluginDir: any;
3
+ packageDir: any;
4
+ packageName: any;
5
+ }): Promise<string | undefined>;
@@ -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,2 @@
1
+ export declare const startPlugins: any;
2
+ export declare const stopPlugins: (childProcesses: any) => void;
@@ -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,2 @@
1
+ import type { FeatureFlags } from '../../../core/feature_flags.js';
2
+ export declare const validateEdgeFunctionsManifest: (manifest: any, featureFlags?: FeatureFlags) => Promise<{}>;
@@ -0,0 +1 @@
1
+ export function getZipError(error: any, functionsSrc: any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ import type { FeatureFlags } from '../../core/feature_flags.js';
2
+ export declare const getZisiFeatureFlags: (featureFlags: FeatureFlags) => FeatureFlags;
@@ -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,6 @@
1
+ export function onPreBuild({ constants: { FUNCTIONS_SRC, IS_LOCAL } }: {
2
+ constants: {
3
+ FUNCTIONS_SRC: any;
4
+ IS_LOCAL: any;
5
+ };
6
+ }): Promise<{}>;
@@ -0,0 +1,8 @@
1
+ export function listCorePlugins({ FUNCTIONS_SRC }: {
2
+ FUNCTIONS_SRC: any;
3
+ }): ({
4
+ package: string;
5
+ pluginPath: string;
6
+ optional: boolean;
7
+ } | undefined)[];
8
+ export function isCorePlugin(packageName: any): boolean;
@@ -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[];