@netlify/config 20.13.2 → 20.14.1

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 (63) hide show
  1. package/lib/api/build_settings.d.ts +11 -0
  2. package/lib/api/client.d.ts +9 -0
  3. package/lib/api/integrations.d.ts +12 -0
  4. package/lib/api/site_info.d.ts +28 -0
  5. package/lib/base.d.ts +34 -0
  6. package/lib/bin/flags.d.ts +29 -0
  7. package/lib/bin/main.d.ts +2 -0
  8. package/lib/build_dir.d.ts +8 -0
  9. package/lib/cached_config.d.ts +6 -0
  10. package/lib/case.d.ts +16 -0
  11. package/lib/context.d.ts +9 -0
  12. package/lib/default.d.ts +11 -0
  13. package/lib/edge_functions.d.ts +31 -0
  14. package/lib/env/envelope.d.ts +7 -0
  15. package/lib/env/git.d.ts +1 -0
  16. package/lib/env/main.d.ts +13 -0
  17. package/lib/error.d.ts +2 -0
  18. package/lib/events.d.ts +2 -0
  19. package/lib/files.d.ts +12 -0
  20. package/lib/functions_config.d.ts +26 -0
  21. package/lib/headers.d.ts +16 -0
  22. package/lib/index.d.ts +6 -0
  23. package/lib/inline_config.d.ts +6 -0
  24. package/lib/integrations.d.ts +18 -0
  25. package/lib/log/cleanup.d.ts +22 -0
  26. package/lib/log/logger.d.ts +13 -0
  27. package/lib/log/main.d.ts +26 -0
  28. package/lib/log/messages.d.ts +11 -0
  29. package/lib/log/options.d.ts +12 -0
  30. package/lib/log/serialize.d.ts +1 -0
  31. package/lib/log/theme.d.ts +6 -0
  32. package/lib/main.d.ts +6 -0
  33. package/lib/merge.d.ts +3 -0
  34. package/lib/merge_normalize.d.ts +11 -0
  35. package/lib/mutations/apply.d.ts +1 -0
  36. package/lib/mutations/apply.js +4 -0
  37. package/lib/mutations/config_prop_name.d.ts +2 -0
  38. package/lib/mutations/update.d.ts +17 -0
  39. package/lib/normalize.d.ts +4 -0
  40. package/lib/options/base.d.ts +10 -0
  41. package/lib/options/branch.d.ts +4 -0
  42. package/lib/options/feature_flags.d.ts +2 -0
  43. package/lib/options/main.d.ts +7 -0
  44. package/lib/options/repository_root.d.ts +4 -0
  45. package/lib/origin.d.ts +10 -0
  46. package/lib/parse.d.ts +11 -0
  47. package/lib/path.d.ts +15 -0
  48. package/lib/redirects.d.ts +10 -0
  49. package/lib/simplify.d.ts +24 -0
  50. package/lib/types/api.d.ts +5 -0
  51. package/lib/types/integrations.d.ts +8 -0
  52. package/lib/types/options.d.ts +5 -0
  53. package/lib/utils/group.d.ts +1 -0
  54. package/lib/utils/remove_falsy.d.ts +11 -0
  55. package/lib/utils/set.d.ts +1 -0
  56. package/lib/utils/toml.d.ts +2 -0
  57. package/lib/validate/context.d.ts +6 -0
  58. package/lib/validate/example.d.ts +7 -0
  59. package/lib/validate/helpers.d.ts +17 -0
  60. package/lib/validate/identical.d.ts +3 -0
  61. package/lib/validate/main.d.ts +5 -0
  62. package/lib/validate/validations.d.ts +280 -0
  63. package/package.json +4 -3
@@ -0,0 +1,11 @@
1
+ export function addBuildSettings({ defaultConfig, baseRelDir, siteInfo: { build_settings: buildSettings, plugins }, }: {
2
+ defaultConfig: any;
3
+ baseRelDir: any;
4
+ siteInfo: {
5
+ build_settings: any;
6
+ plugins: any;
7
+ };
8
+ }): {
9
+ defaultConfig: any;
10
+ baseRelDir: any;
11
+ };
@@ -0,0 +1,9 @@
1
+ export function getApiClient({ token, offline, testOpts, host, scheme, pathPrefix }: {
2
+ token: any;
3
+ offline: any;
4
+ testOpts?: {} | undefined;
5
+ host: any;
6
+ scheme: any;
7
+ pathPrefix: any;
8
+ }): NetlifyAPI | undefined;
9
+ import { NetlifyAPI } from 'netlify';
@@ -0,0 +1,12 @@
1
+ import { TestOptions } from '../types/options.js';
2
+ type AvailableIntegration = {
3
+ slug: string;
4
+ hostSiteUrl: string;
5
+ hasBuild?: boolean;
6
+ };
7
+ type GetAvailableIntegrationsOpts = {
8
+ testOpts: TestOptions;
9
+ offline: boolean;
10
+ };
11
+ export declare const getAvailableIntegrations: ({ testOpts, offline, }: GetAvailableIntegrationsOpts) => Promise<AvailableIntegration[]>;
12
+ export {};
@@ -0,0 +1,28 @@
1
+ import { NetlifyAPI } from 'netlify';
2
+ import { ModeOption, TestOptions } from '../types/options.js';
3
+ type GetSiteInfoOpts = {
4
+ siteId: string;
5
+ mode: ModeOption;
6
+ siteFeatureFlagPrefix: string;
7
+ offline?: boolean;
8
+ api?: NetlifyAPI;
9
+ context?: string;
10
+ featureFlags?: Record<string, boolean>;
11
+ testOpts?: TestOptions;
12
+ };
13
+ /**
14
+ * Retrieve Netlify Site information, if available.
15
+ * Used to retrieve local build environment variables and UI build settings.
16
+ * This is not used in production builds since the buildbot passes this
17
+ * information instead.
18
+ * Requires knowing the `siteId` and having the access `token`.
19
+ * Silently ignore API errors. For example the network connection might be down,
20
+ * but local builds should still work regardless.
21
+ */
22
+ export declare const getSiteInfo: ({ api, siteId, mode, siteFeatureFlagPrefix, context, offline, testOpts, }: GetSiteInfoOpts) => Promise<{
23
+ siteInfo: any;
24
+ accounts: any;
25
+ addons: any;
26
+ integrations: any;
27
+ }>;
28
+ export {};
package/lib/base.d.ts ADDED
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Retrieve the first `base` directory used to load the first config file.
3
+ */
4
+ export declare const getInitialBase: ({ repositoryRoot, defaultConfig: { build: { base: defaultBase } }, inlineConfig: { build: { base: initialBase } }, }: {
5
+ repositoryRoot: any;
6
+ defaultConfig: {
7
+ build?: {
8
+ base: any;
9
+ } | undefined;
10
+ };
11
+ inlineConfig: {
12
+ build?: {
13
+ base?: any;
14
+ } | undefined;
15
+ };
16
+ }) => string | undefined;
17
+ /**
18
+ * Two config files can be used:
19
+ * - The first one, using the `config` property or doing a default lookup
20
+ * of `netlify.toml`
21
+ * - If the first one has a `base` property pointing to a directory with
22
+ * another `netlify.toml`, that second config file is used instead.
23
+ * This retrieves the final `base` directory used:
24
+ * - To load the second config file
25
+ * - As the `buildDir`
26
+ * - To resolve file paths
27
+ * If the second file has a `base` property, it is ignored, i.e. it is not
28
+ * recursive.
29
+ */
30
+ export declare const getBase: (base: string | undefined, repositoryRoot: string, config: $TSFixMe) => string | undefined;
31
+ /**
32
+ * Also `config.build.base`.
33
+ */
34
+ export declare const addBase: (config: any, base: any) => any;
@@ -0,0 +1,29 @@
1
+ export declare const parseFlags: () => Partial<{
2
+ featureFlags: any;
3
+ config: unknown;
4
+ defaultConfig: any;
5
+ cachedConfig: any;
6
+ cachedConfigPath: unknown;
7
+ inlineConfig: any;
8
+ configMutations: any;
9
+ cwd: unknown;
10
+ packagePath: unknown;
11
+ repositoryRoot: unknown;
12
+ output: unknown;
13
+ stable: boolean;
14
+ token: unknown;
15
+ host: unknown;
16
+ scheme: unknown;
17
+ pathPrefix: unknown;
18
+ siteId: unknown;
19
+ context: unknown;
20
+ branch: unknown;
21
+ baseRelDir: unknown;
22
+ mode: unknown;
23
+ debug: unknown;
24
+ testOpts: unknown;
25
+ offline: unknown;
26
+ buffer: unknown;
27
+ _: (string | number)[];
28
+ $0: string;
29
+ }>;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Retrieve the build directory used to resolve most paths.
3
+ * This is (in priority order):
4
+ * - `build.base`
5
+ * - `--repositoryRoot`
6
+ * - the current directory (default value of `--repositoryRoot`)
7
+ */
8
+ export declare const getBuildDir: (repositoryRoot: string, base?: string) => Promise<string>;
@@ -0,0 +1,6 @@
1
+ export function getCachedConfig({ cachedConfig, cachedConfigPath, token, api }: {
2
+ cachedConfig: any;
3
+ cachedConfigPath: any;
4
+ token: any;
5
+ api: any;
6
+ }): Promise<any>;
package/lib/case.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ export function normalizeConfigCase({ Build, build, ...config }: {
2
+ [x: string]: any;
3
+ Build: any;
4
+ build?: any;
5
+ }): {
6
+ build: {
7
+ base: any;
8
+ command: any;
9
+ edge_functions: any;
10
+ environment: any;
11
+ functions: any;
12
+ ignore: any;
13
+ processing: any;
14
+ publish: any;
15
+ };
16
+ };
@@ -0,0 +1,9 @@
1
+ export declare const normalizeContextProps: ({ config, config: { context: contextProps }, origin }: $TSFixMe) => any;
2
+ export declare const mergeContext: ({ config: { context: contextProps, ...config }, config: { plugins }, context, branch, logs, }: $TSFixMe) => any;
3
+ export declare const ensureConfigPriority: ({ build, ...config }: {
4
+ [x: string]: any;
5
+ build?: {} | undefined;
6
+ }, context: any, branch: any) => {
7
+ context: any;
8
+ build: {};
9
+ };
@@ -0,0 +1,11 @@
1
+ export function parseDefaultConfig({ defaultConfig, base, baseRelDir, siteInfo, logs, debug }: {
2
+ defaultConfig: any;
3
+ base: any;
4
+ baseRelDir: any;
5
+ siteInfo: any;
6
+ logs: any;
7
+ debug: any;
8
+ }): {
9
+ defaultConfig: any;
10
+ baseRelDir: any;
11
+ };
@@ -0,0 +1,31 @@
1
+ export declare const validations: ({
2
+ example: () => {
3
+ edge_functions: {
4
+ path: string;
5
+ function: string;
6
+ }[];
7
+ };
8
+ check: (value: any) => boolean;
9
+ message: string;
10
+ property: string;
11
+ } | {
12
+ property: string;
13
+ check: (value: any) => boolean;
14
+ message: string;
15
+ example: () => {
16
+ edge_functions: {
17
+ pattern: string;
18
+ function: string;
19
+ }[];
20
+ };
21
+ } | {
22
+ property: string;
23
+ check: (pathName: any) => any;
24
+ message: string;
25
+ example: () => {
26
+ edge_functions: {
27
+ path: string;
28
+ function: string;
29
+ }[];
30
+ };
31
+ })[];
@@ -0,0 +1,7 @@
1
+ import type { NetlifyAPI } from 'netlify';
2
+ export declare const getEnvelope: ({ api, accountId, siteId, context, }: {
3
+ api: NetlifyAPI;
4
+ accountId: string;
5
+ siteId?: string;
6
+ context?: string;
7
+ }) => Promise<any>;
@@ -0,0 +1 @@
1
+ export function getGitEnv(buildDir: any, branch: any): Promise<Partial<any>>;
@@ -0,0 +1,13 @@
1
+ export declare const getEnv: ({ api, mode, config, siteInfo, accounts, addons, buildDir, branch, deployId, buildId, context, }: {
2
+ api: any;
3
+ mode: any;
4
+ config: any;
5
+ siteInfo: any;
6
+ accounts: any;
7
+ addons: any;
8
+ buildDir: any;
9
+ branch: any;
10
+ deployId: any;
11
+ buildId: any;
12
+ context: any;
13
+ }) => Promise<any>;
package/lib/error.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const throwUserError: (messageOrError: string | Error, error?: Error) => never;
2
+ export declare const isUserError: (error: any) => boolean;
@@ -0,0 +1,2 @@
1
+ export const EVENTS: string[];
2
+ export const DEV_EVENTS: string[];
package/lib/files.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Make configuration paths relative to `buildDir` and converts them to
3
+ * absolute paths
4
+ */
5
+ export declare const resolveConfigPaths: (options: {
6
+ config: $TSFixMe;
7
+ repositoryRoot: string;
8
+ buildDir: string;
9
+ baseRelDir?: boolean;
10
+ packagePath?: string;
11
+ }) => object;
12
+ export declare const resolvePath: (repositoryRoot: string, baseRel: string, originalPath: string, propName: string) => string | undefined;
@@ -0,0 +1,26 @@
1
+ export const bundlers: string[];
2
+ export const WILDCARD_ALL: "*";
3
+ export function normalizeFunctionsProps({ functions: v1FunctionsDirectory, ...build }: {
4
+ [x: string]: any;
5
+ functions: any;
6
+ }, { [WILDCARD_ALL]: wildcardProps, ...functions }: {
7
+ [x: string]: any;
8
+ "*": any;
9
+ }): {
10
+ build: {
11
+ [x: string]: any;
12
+ };
13
+ functions: {
14
+ "*": {
15
+ [x: string]: any;
16
+ };
17
+ };
18
+ functionsDirectoryProps: {
19
+ functionsDirectory: any;
20
+ functionsDirectoryOrigin: string;
21
+ } | {
22
+ functionsDirectory?: undefined;
23
+ functionsDirectoryOrigin?: undefined;
24
+ };
25
+ };
26
+ export const FUNCTION_CONFIG_PROPERTIES: Set<string>;
@@ -0,0 +1,16 @@
1
+ export function getHeadersPath({ build: { publish } }: {
2
+ build: {
3
+ publish: any;
4
+ };
5
+ }): string;
6
+ export function addHeaders({ config: { headers: configHeaders, ...config }, headersPath, logs, featureFlags, }: {
7
+ config: {
8
+ [x: string]: any;
9
+ headers: any;
10
+ };
11
+ headersPath: any;
12
+ logs: any;
13
+ featureFlags: any;
14
+ }): Promise<{
15
+ headers: import("packages/headers-parser/lib/types.js").Header[];
16
+ }>;
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { DEV_EVENTS, EVENTS } from './events.js';
2
+ export { cleanupConfig } from './log/cleanup.js';
3
+ export { resolveConfig } from './main.js';
4
+ export { mergeConfigs } from './merge.js';
5
+ export { applyMutations } from './mutations/apply.js';
6
+ export { restoreConfig, updateConfig } from './mutations/update.js';
@@ -0,0 +1,6 @@
1
+ export function getInlineConfig({ inlineConfig, configMutations, logs, debug }: {
2
+ inlineConfig: any;
3
+ configMutations: any;
4
+ logs: any;
5
+ debug: any;
6
+ }): any;
@@ -0,0 +1,18 @@
1
+ import { IntegrationResponse } from './types/api.js';
2
+ import { Integration } from './types/integrations.js';
3
+ import { TestOptions } from './types/options.js';
4
+ type MergeIntegrationsOpts = {
5
+ configIntegrations?: {
6
+ name: string;
7
+ dev?: {
8
+ path: string;
9
+ force_run_in_build?: boolean;
10
+ };
11
+ }[];
12
+ apiIntegrations: IntegrationResponse[];
13
+ context: string;
14
+ testOpts?: TestOptions;
15
+ offline: boolean;
16
+ };
17
+ export declare const mergeIntegrations: ({ configIntegrations, apiIntegrations, context, testOpts, offline, }: MergeIntegrationsOpts) => Promise<Integration[]>;
18
+ export {};
@@ -0,0 +1,22 @@
1
+ export function cleanupConfig({ build: { base, command, commandOrigin, environment, edge_functions: edgeFunctions, ignore, processing, publish, publishOrigin, }, headers, headersOrigin, plugins, redirects, redirectsOrigin, baseRelDir, functions, functionsDirectory, }: {
2
+ build?: {
3
+ base: any;
4
+ command: any;
5
+ commandOrigin: any;
6
+ environment?: {} | undefined;
7
+ edge_functions: any;
8
+ ignore: any;
9
+ processing: any;
10
+ publish: any;
11
+ publishOrigin: any;
12
+ } | undefined;
13
+ headers: any;
14
+ headersOrigin: any;
15
+ plugins?: any[] | undefined;
16
+ redirects: any;
17
+ redirectsOrigin: any;
18
+ baseRelDir: any;
19
+ functions: any;
20
+ functionsDirectory: any;
21
+ }): any;
22
+ export function cleanupEnvironment(environment: any): string[];
@@ -0,0 +1,13 @@
1
+ export function logsAreBuffered(logs: any): boolean;
2
+ export function getBufferLogs({ buffer }: {
3
+ buffer: any;
4
+ }): {
5
+ stdout: never[];
6
+ stderr: never[];
7
+ } | undefined;
8
+ export function log(logs: any, string: any, { color }?: {
9
+ color: any;
10
+ }): void;
11
+ export function logWarning(logs: any, string: any, opts: any): void;
12
+ export function logObject(logs: any, object: any, opts: any): void;
13
+ export function logSubHeader(logs: any, string: any, opts: any): void;
@@ -0,0 +1,26 @@
1
+ export function logOpts(opts: any, { logs, debug, cachedConfig, cachedConfigPath }: {
2
+ logs: any;
3
+ debug: any;
4
+ cachedConfig: any;
5
+ cachedConfigPath: any;
6
+ }): void;
7
+ export function logDefaultConfig(defaultConfig: any, { logs, debug, baseRelDir }: {
8
+ logs: any;
9
+ debug: any;
10
+ baseRelDir: any;
11
+ }): void;
12
+ export function logInlineConfig(initialConfig: any, { logs, debug }: {
13
+ logs: any;
14
+ debug: any;
15
+ }): void;
16
+ export function logResult({ configPath, buildDir, config, context, branch, env }: {
17
+ configPath: any;
18
+ buildDir: any;
19
+ config: any;
20
+ context: any;
21
+ branch: any;
22
+ env: any;
23
+ }, { logs, debug }: {
24
+ logs: any;
25
+ debug: any;
26
+ }): void;
@@ -0,0 +1,11 @@
1
+ export const ERROR_CALL_TO_ACTION: "Double-check your login status with 'netlify status' or contact support with details of your error.";
2
+ export function throwOnInvalidTomlSequence(invalidSequence: any): void;
3
+ export function warnLegacyFunctionsDirectory({ config, logs }: {
4
+ config?: {} | undefined;
5
+ logs: any;
6
+ }): void;
7
+ export function warnContextPluginConfig(logs: any, packageName: any, context: any): void;
8
+ export function throwContextPluginsConfig(packageName: any, context: any): void;
9
+ export function warnHeadersParsing(logs: any, errors: any): void;
10
+ export function warnHeadersCaseSensitivity(logs: any, headers: any): void;
11
+ export function warnRedirectsParsing(logs: any, errors: any): void;
@@ -0,0 +1,12 @@
1
+ export function cleanupConfigOpts({ config, cwd, context, branch, mode, repositoryRoot, siteId, baseRelDir, env, featureFlags, }: {
2
+ config: any;
3
+ cwd: any;
4
+ context: any;
5
+ branch: any;
6
+ mode: any;
7
+ repositoryRoot: any;
8
+ siteId: any;
9
+ baseRelDir: any;
10
+ env?: {} | undefined;
11
+ featureFlags?: {} | undefined;
12
+ }): Partial<any>;
@@ -0,0 +1 @@
1
+ export function serializeObject(object: any): any;
@@ -0,0 +1,6 @@
1
+ export namespace THEME {
2
+ let subHeader: import("chalk").ChalkInstance;
3
+ let errorSubHeader: import("chalk").ChalkInstance;
4
+ let warningLine: import("chalk").ChalkInstance;
5
+ let highlightWords: import("chalk").ChalkInstance;
6
+ }
package/lib/main.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Load the configuration file.
3
+ * Takes an optional configuration file path as input and return the resolved
4
+ * `config` together with related properties such as the `configPath`.
5
+ */
6
+ export declare const resolveConfig: (opts: any) => Promise<any>;
package/lib/merge.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export function mergeConfigs(configs: any, { concatenateArrays }?: {
2
+ concatenateArrays: any;
3
+ }): object;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Perform validation and normalization logic to apply to all of:
3
+ * - config, defaultConfig, inlineConfig
4
+ * - context-specific configs
5
+ * Therefore, this is performing before merging those together.
6
+ */
7
+ export declare const normalizeBeforeConfigMerge: (config: $TSFixMe, origin: any) => any;
8
+ /**
9
+ * Validation and normalization logic performed after merging
10
+ */
11
+ export declare const normalizeAfterConfigMerge: (config: $TSFixMe, packagePath?: string) => any;
@@ -0,0 +1 @@
1
+ export function applyMutations(inlineConfig: any, configMutations: any): any;
@@ -65,4 +65,8 @@ const MUTABLE_PROPS = {
65
65
  images: { lastEvent: 'onPostBuild' },
66
66
  'images.remote_images': { lastEvent: 'onPostBuild' },
67
67
  redirects: { lastEvent: 'onPostBuild' },
68
+ dev: { lastEvent: 'onPreDev' },
69
+ 'dev.processing': { lastEvent: 'onPreDev' },
70
+ 'dev.processing.html': { lastEvent: 'onPreDev' },
71
+ 'dev.processing.html.injections': { lastEvent: 'onPreDev' },
68
72
  };
@@ -0,0 +1,2 @@
1
+ /** Retrieve normalized property name */
2
+ export declare const getPropName: (keys: string[]) => string;
@@ -0,0 +1,17 @@
1
+ export function updateConfig(configMutations: any, { buildDir, configPath, headersPath, outputConfigPath, redirectsPath, context, branch, logs, featureFlags, }: {
2
+ buildDir: any;
3
+ configPath: any;
4
+ headersPath: any;
5
+ outputConfigPath?: any;
6
+ redirectsPath: any;
7
+ context: any;
8
+ branch: any;
9
+ logs: any;
10
+ featureFlags: any;
11
+ }): Promise<void>;
12
+ export function restoreConfig(configMutations: any, { buildDir, configPath, headersPath, redirectsPath }: {
13
+ buildDir: any;
14
+ configPath: any;
15
+ headersPath: any;
16
+ redirectsPath: any;
17
+ }): Promise<void>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Normalize configuration object
3
+ */
4
+ export declare const normalizeConfig: (config: $TSFixMe, packagePath?: string) => any;
@@ -0,0 +1,10 @@
1
+ export function getBaseOverride({ repositoryRoot, cwd }: {
2
+ repositoryRoot: any;
3
+ cwd: any;
4
+ }): Promise<{
5
+ base?: undefined;
6
+ baseRelDir?: undefined;
7
+ } | {
8
+ base: string;
9
+ baseRelDir: boolean;
10
+ }>;
@@ -0,0 +1,4 @@
1
+ export function getBranch({ branch, repositoryRoot }: {
2
+ branch: any;
3
+ repositoryRoot: any;
4
+ }): Promise<any>;
@@ -0,0 +1,2 @@
1
+ export function normalizeCliFeatureFlags(cliFeatureFlags: any): any;
2
+ export const DEFAULT_FEATURE_FLAGS: {};
@@ -0,0 +1,7 @@
1
+ export function addDefaultOpts(opts?: {}): {
2
+ logs: {
3
+ stdout: never[];
4
+ stderr: never[];
5
+ } | undefined;
6
+ };
7
+ export function normalizeOpts(opts: any): Promise<any>;
@@ -0,0 +1,4 @@
1
+ export function getRepositoryRoot({ repositoryRoot, cwd }: {
2
+ repositoryRoot: any;
3
+ cwd: any;
4
+ }): Promise<any>;
@@ -0,0 +1,10 @@
1
+ export const UI_ORIGIN: "ui";
2
+ export const CONFIG_ORIGIN: "config";
3
+ export const DEFAULT_ORIGIN: "default";
4
+ export const INLINE_ORIGIN: "inline";
5
+ export function addOrigins(config: any, origin: any): {
6
+ redirects: any;
7
+ } | {
8
+ redirectsOrigin: any;
9
+ redirects: any;
10
+ };
package/lib/parse.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Load the configuration file and parse it (TOML)
3
+ * @param configPath The path to the toml file
4
+ * @returns
5
+ */
6
+ export declare const parseConfig: (configPath?: string) => Promise<any>;
7
+ /**
8
+ * Same but `configPath` is required and `configPath` might point to a
9
+ * non-existing file.
10
+ */
11
+ export declare const parseOptionalConfig: (configPath: any) => Promise<any>;
package/lib/path.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Configuration location can be:
3
+ * - a local path with the --config CLI flag
4
+ * - a `netlify.*` file in the `repositoryRoot/{base}/{packagePath}`
5
+ * - a `netlify.*` file in the `repositoryRoot/{base}`
6
+ * - a `netlify.*` file in the `repositoryRoot`
7
+ * - a `netlify.*` file in the current directory or any parent
8
+ */
9
+ export declare const getConfigPath: ({ configOpt, cwd, repositoryRoot, configBase, packagePath, }: {
10
+ cwd: string;
11
+ repositoryRoot: string;
12
+ configBase;
13
+ configOpt?: string;
14
+ packagePath?: string;
15
+ }) => Promise<string | undefined>;
@@ -0,0 +1,10 @@
1
+ export declare const getRedirectsPath: ({ build: { publish } }: $TSFixMe) => string;
2
+ /**
3
+ * Add `config.redirects`
4
+ */
5
+ export declare const addRedirects: ({ config: { redirects: configRedirects, ...config }, redirectsPath, logs, }: {
6
+ config: $TSFixMe;
7
+ redirectsPath: string;
8
+ logs: $TSFixMe;
9
+ featureFlags?: $TSFixMe;
10
+ }) => Promise<any>;
@@ -0,0 +1,24 @@
1
+ export function simplifyConfig({ build: { environment, processing: { css, html, images, js, ...processing }, services, ...build }, functions, plugins, headers, redirects, context, ...config }: {
2
+ [x: string]: any;
3
+ build?: {
4
+ environment: any;
5
+ processing?: {
6
+ css: any;
7
+ html: any;
8
+ images: any;
9
+ js: any;
10
+ } | undefined;
11
+ services: any;
12
+ } | undefined;
13
+ functions: any;
14
+ plugins: any;
15
+ headers: any;
16
+ redirects: any;
17
+ context?: {} | undefined;
18
+ }): any;
19
+ export function removeEmptyObject(object: any, propName: any): {
20
+ [x: number]: Partial<any>;
21
+ };
22
+ export function removeEmptyArray(array: any, propName: any): {
23
+ [x: number]: any[];
24
+ };
@@ -0,0 +1,5 @@
1
+ export type IntegrationResponse = {
2
+ slug: string;
3
+ version: string;
4
+ has_build: boolean;
5
+ };
@@ -0,0 +1,8 @@
1
+ export type Integration = {
2
+ slug: string;
3
+ version?: string;
4
+ has_build?: boolean;
5
+ dev?: {
6
+ path: string;
7
+ };
8
+ };
@@ -0,0 +1,5 @@
1
+ export type ModeOption = 'buildbot' | 'cli' | 'require';
2
+ export type TestOptions = {
3
+ env?: boolean;
4
+ host?: string;
5
+ };
@@ -0,0 +1 @@
1
+ export function groupBy(objects: any, keyName: any): any[];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Remove falsy values from object
3
+ */
4
+ export declare const removeFalsy: (obj: any) => Partial<any>;
5
+ type NoUndefinedField<T> = {
6
+ [P in keyof T]: Exclude<T[P], null | undefined>;
7
+ };
8
+ export declare const removeUndefined: <T extends object>(obj: T) => NoUndefinedField<T>;
9
+ export declare const isTruthy: <T>(value: T | false | undefined | null | '' | ' ') => value is T;
10
+ export declare const isDefined: <T>(value: T | undefined | null) => value is T;
11
+ export {};
@@ -0,0 +1 @@
1
+ export function setProp(parent: any, keys: any, value: any): any;
@@ -0,0 +1,2 @@
1
+ export function parseToml(configString: any): any;
2
+ export function serializeToml(object: any): any;
@@ -0,0 +1,6 @@
1
+ export function validateContextsPluginsConfig({ contextProps, plugins, contexts, logs }: {
2
+ contextProps: any;
3
+ plugins: any;
4
+ contexts: any;
5
+ logs: any;
6
+ }): void;
@@ -0,0 +1,7 @@
1
+ export function getExample({ value, key, prevPath, example, formatInvalid }: {
2
+ value: any;
3
+ key: any;
4
+ prevPath: any;
5
+ example: any;
6
+ formatInvalid: any;
7
+ }): string;
@@ -0,0 +1,17 @@
1
+ export function isArrayOfObjects(value: any): boolean;
2
+ export function isArrayOfStrings(value: any): boolean;
3
+ export function isString(value: any): boolean;
4
+ export function validProperties(propNames: any, legacyPropNames: any): {
5
+ check: (value: any) => boolean;
6
+ message: string;
7
+ };
8
+ export namespace functionsDirectoryCheck {
9
+ function formatInvalid({ functionsDirectory }?: {
10
+ functionsDirectory: any;
11
+ }): {
12
+ functions: {
13
+ directory: any;
14
+ };
15
+ };
16
+ let propertyName: string;
17
+ }
@@ -0,0 +1,3 @@
1
+ export function validateIdenticalPlugins({ plugins }: {
2
+ plugins?: any[] | undefined;
3
+ }): void;
@@ -0,0 +1,5 @@
1
+ export function validatePreCaseNormalize(config: any): void;
2
+ export function validatePreMergeConfig(config: any): void;
3
+ export function validatePreContextConfig(config: any): void;
4
+ export function validatePreNormalizeConfig(config: any): void;
5
+ export function validatePostNormalizeConfig(config: any): void;
@@ -0,0 +1,280 @@
1
+ export const PRE_CASE_NORMALIZE_VALIDATIONS: {
2
+ property: string;
3
+ check: typeof isPlainObj;
4
+ message: string;
5
+ example: () => {
6
+ build: {
7
+ command: string;
8
+ };
9
+ };
10
+ }[];
11
+ export const PRE_MERGE_VALIDATIONS: ({
12
+ property: string;
13
+ check: (value: any) => boolean;
14
+ message: string;
15
+ example: () => {
16
+ build: {
17
+ command: string;
18
+ };
19
+ };
20
+ } | {
21
+ property: string;
22
+ check: (value: any) => boolean;
23
+ message: string;
24
+ example: () => {
25
+ plugins: {
26
+ package: string;
27
+ }[];
28
+ };
29
+ })[];
30
+ export const PRE_CONTEXT_VALIDATIONS: ({
31
+ property: string;
32
+ check: typeof isPlainObj;
33
+ message: string;
34
+ example: () => {
35
+ context: {
36
+ production: {
37
+ publish: string;
38
+ };
39
+ };
40
+ };
41
+ } | {
42
+ property: string;
43
+ check: typeof isPlainObj;
44
+ message: string;
45
+ example: (contextProps: any, key: any) => {
46
+ context: {
47
+ [x: number]: {
48
+ publish: string;
49
+ };
50
+ };
51
+ };
52
+ })[];
53
+ export const PRE_NORMALIZE_VALIDATIONS: ({
54
+ property: string;
55
+ check: (value: any) => boolean;
56
+ message: string;
57
+ example: () => {
58
+ build: {
59
+ command: string;
60
+ };
61
+ };
62
+ } | {
63
+ property: string;
64
+ check: (value: any) => boolean;
65
+ message: string;
66
+ example: () => {
67
+ plugins: {
68
+ package: string;
69
+ }[];
70
+ };
71
+ } | {
72
+ property: string;
73
+ check: typeof isPlainObj;
74
+ message: string;
75
+ example: () => {
76
+ functions: {
77
+ external_node_modules: string[];
78
+ };
79
+ };
80
+ } | {
81
+ property: string;
82
+ check: typeof isPlainObj;
83
+ message: string;
84
+ example: () => {
85
+ functions: {
86
+ ignored_node_modules: string[];
87
+ };
88
+ };
89
+ } | {
90
+ property: string;
91
+ check: (value: any) => boolean;
92
+ message: string;
93
+ example: () => {
94
+ edge_functions: {
95
+ path: string;
96
+ function: string;
97
+ }[];
98
+ };
99
+ })[];
100
+ export const POST_NORMALIZE_VALIDATIONS: ({
101
+ example: () => {
102
+ edge_functions: {
103
+ path: string;
104
+ function: string;
105
+ }[];
106
+ };
107
+ check: (value: any) => boolean;
108
+ message: string;
109
+ property: string;
110
+ } | {
111
+ property: string;
112
+ check: (value: any) => boolean;
113
+ message: string;
114
+ example: () => {
115
+ edge_functions: {
116
+ pattern: string;
117
+ function: string;
118
+ }[];
119
+ };
120
+ } | {
121
+ property: string;
122
+ check: (pathName: any) => any;
123
+ message: string;
124
+ example: () => {
125
+ edge_functions: {
126
+ path: string;
127
+ function: string;
128
+ }[];
129
+ };
130
+ } | {
131
+ example: {
132
+ plugins: {
133
+ package: string;
134
+ inputs: {
135
+ port: number;
136
+ };
137
+ }[];
138
+ };
139
+ check: (value: any) => boolean;
140
+ message: string;
141
+ property: string;
142
+ } | {
143
+ property: string;
144
+ check: (packageName: any) => any;
145
+ message: string;
146
+ example: () => {
147
+ plugins: {
148
+ package: string;
149
+ }[];
150
+ };
151
+ } | {
152
+ property: string;
153
+ check: (value: any) => boolean;
154
+ message: string;
155
+ example: () => {
156
+ build: {
157
+ base: string;
158
+ };
159
+ };
160
+ } | {
161
+ property: string;
162
+ check: (value: any) => boolean;
163
+ message: string;
164
+ example: () => {
165
+ build: {
166
+ publish: string;
167
+ };
168
+ };
169
+ } | {
170
+ property: string;
171
+ check: (value: any) => boolean;
172
+ message: string;
173
+ example: () => {
174
+ build: {
175
+ functions: string;
176
+ };
177
+ };
178
+ } | {
179
+ property: string;
180
+ check: (value: any) => boolean;
181
+ message: string;
182
+ example: () => {
183
+ build: {
184
+ edge_functions: string;
185
+ };
186
+ };
187
+ } | {
188
+ property: string;
189
+ check: (value: any) => boolean;
190
+ message: string;
191
+ example: (value: any, key: any, prevPath: any) => {
192
+ functions: {
193
+ [x: number]: {
194
+ deno_import_map: string;
195
+ };
196
+ };
197
+ };
198
+ } | {
199
+ property: string;
200
+ check: (value: any) => boolean;
201
+ message: string;
202
+ example: (value: any, key: any, prevPath: any) => {
203
+ functions: {
204
+ [x: number]: {
205
+ external_node_modules: string[];
206
+ };
207
+ };
208
+ };
209
+ } | {
210
+ property: string;
211
+ check: (value: any) => boolean;
212
+ message: string;
213
+ example: (value: any, key: any, prevPath: any) => {
214
+ functions: {
215
+ [x: number]: {
216
+ ignored_node_modules: string[];
217
+ };
218
+ };
219
+ };
220
+ } | {
221
+ property: string;
222
+ check: (value: any) => boolean;
223
+ message: string;
224
+ example: (value: any, key: any, prevPath: any) => {
225
+ functions: {
226
+ [x: number]: {
227
+ included_files: string[];
228
+ };
229
+ };
230
+ };
231
+ } | {
232
+ property: string;
233
+ check: (value: any) => boolean;
234
+ message: string;
235
+ example: (value: any, key: any, prevPath: any) => {
236
+ functions: {
237
+ [x: number]: {
238
+ node_bundler: string;
239
+ };
240
+ };
241
+ };
242
+ } | {
243
+ property: string;
244
+ check: (value: any, key: any, prevPath: any) => boolean;
245
+ message: string;
246
+ example: () => {
247
+ functions: {
248
+ directory: string;
249
+ };
250
+ };
251
+ } | {
252
+ property: string;
253
+ check: (cron: string) => boolean;
254
+ message: string;
255
+ example: (value: any, key: any, prevPath: any) => {
256
+ functions: {
257
+ [x: number]: {
258
+ schedule: string;
259
+ };
260
+ };
261
+ };
262
+ } | {
263
+ example: () => {
264
+ functions: {
265
+ directory: string;
266
+ };
267
+ };
268
+ formatInvalid: ({ functionsDirectory }?: {
269
+ functionsDirectory: any;
270
+ }) => {
271
+ functions: {
272
+ directory: any;
273
+ };
274
+ };
275
+ propertyName: string;
276
+ property: string;
277
+ check: (value: any) => boolean;
278
+ message: string;
279
+ })[];
280
+ import isPlainObj from 'is-plain-obj';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "20.13.2",
3
+ "version": "20.14.1",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "files": [
13
13
  "bin.js",
14
- "lib/**/*.js"
14
+ "lib/**/*.js",
15
+ "lib/**/*.d.ts"
15
16
  ],
16
17
  "author": "Netlify Inc.",
17
18
  "contributors": [
@@ -94,5 +95,5 @@
94
95
  "engines": {
95
96
  "node": "^14.16.0 || >=16.0.0"
96
97
  },
97
- "gitHead": "6573e4d27bb60c0b1438ace279791389330286ad"
98
+ "gitHead": "c99f5dcf3198d3a279ee06d7e42c204405cd977a"
98
99
  }