@netlify/config 19.0.1 → 19.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export const modes = ['before-cache', 'after-cache'];
@@ -1,6 +1,7 @@
1
1
  import CronParser from 'cron-parser';
2
2
  import isPlainObj from 'is-plain-obj';
3
3
  import validateNpmPackageName from 'validate-npm-package-name';
4
+ import { modes } from '../edge_functions_config.js';
4
5
  import { bundlers, WILDCARD_ALL as FUNCTIONS_CONFIG_WILDCARD_ALL } from '../functions_config.js';
5
6
  import { functionsDirectoryCheck, isArrayOfObjects, isArrayOfStrings, isString, validProperties } from './helpers.js';
6
7
  /**
@@ -239,7 +240,7 @@ export const POST_NORMALIZE_VALIDATIONS = [
239
240
  },
240
241
  {
241
242
  property: 'edge_functions.*',
242
- ...validProperties(['path', 'function'], []),
243
+ ...validProperties(['path', 'function', 'mode'], []),
243
244
  example: () => ({ edge_functions: [{ path: '/hello', function: 'hello' }] }),
244
245
  },
245
246
  {
@@ -272,4 +273,10 @@ export const POST_NORMALIZE_VALIDATIONS = [
272
273
  message: 'must be a valid path.',
273
274
  example: () => ({ edge_functions: [{ path: '/hello', function: 'hello' }] }),
274
275
  },
276
+ {
277
+ property: 'edge_functions.*.mode',
278
+ check: (value) => modes.includes(value),
279
+ message: `must be one of: ${modes.join(', ')}`,
280
+ example: () => ({ edge_functions: [{ mode: modes[0], path: '/hello', function: 'hello' }] }),
281
+ },
275
282
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "19.0.1",
3
+ "version": "19.1.0",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./lib/main.js",
@@ -80,7 +80,7 @@
80
80
  "toml": "^3.0.0",
81
81
  "tomlify-j0.4": "^3.0.0",
82
82
  "validate-npm-package-name": "^4.0.0",
83
- "yargs": "^17.3.1"
83
+ "yargs": "^17.6.0"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@types/node": "^14.18.31",
@@ -95,5 +95,5 @@
95
95
  "engines": {
96
96
  "node": "^14.16.0 || >=16.0.0"
97
97
  },
98
- "gitHead": "701e883d4e19c048e8de9801e49e21de5c891a18"
98
+ "gitHead": "09ac42dfabd5ac811899f4c123452b6255c4a7f8"
99
99
  }