@netlify/config 19.0.2 → 19.1.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.
|
@@ -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.
|
|
3
|
+
"version": "19.1.1",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/main.js",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"map-obj": "^5.0.0",
|
|
73
73
|
"netlify": "^13.0.1",
|
|
74
74
|
"netlify-headers-parser": "^7.0.0",
|
|
75
|
-
"netlify-redirect-parser": "^14.0.
|
|
75
|
+
"netlify-redirect-parser": "^14.0.1",
|
|
76
76
|
"omit.js": "^2.0.2",
|
|
77
77
|
"p-locate": "^6.0.0",
|
|
78
78
|
"path-exists": "^5.0.0",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"engines": {
|
|
96
96
|
"node": "^14.16.0 || >=16.0.0"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "a17c26b151dd163548b4c8f9d6836ff290305a4a"
|
|
99
99
|
}
|