@netlify/config 20.8.0 → 20.8.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.
- package/lib/edge_functions.js +9 -1
- package/lib/path.js +1 -0
- package/package.json +2 -2
package/lib/edge_functions.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { isString, validProperties } from './validate/helpers.js';
|
|
2
2
|
const cacheValues = ['manual', 'off'];
|
|
3
|
+
const methodValues = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'];
|
|
4
|
+
const isMethod = (value) => typeof value === 'string' && methodValues.includes(value.toUpperCase());
|
|
3
5
|
export const validations = [
|
|
4
6
|
{
|
|
5
7
|
property: 'edge_functions.*',
|
|
6
|
-
...validProperties(['path', 'excludedPath', 'pattern', 'excludedPattern', 'function', 'cache'], []),
|
|
8
|
+
...validProperties(['path', 'excludedPath', 'pattern', 'excludedPattern', 'function', 'cache', 'method'], []),
|
|
7
9
|
example: () => ({ edge_functions: [{ path: '/hello', function: 'hello' }] }),
|
|
8
10
|
},
|
|
9
11
|
{
|
|
@@ -76,4 +78,10 @@ export const validations = [
|
|
|
76
78
|
message: `must be one of: ${cacheValues.join(', ')}`,
|
|
77
79
|
example: () => ({ edge_functions: [{ cache: cacheValues[0], path: '/hello', function: 'hello' }] }),
|
|
78
80
|
},
|
|
81
|
+
{
|
|
82
|
+
property: 'edge_functions.*.method',
|
|
83
|
+
check: (value) => isMethod(value) || (Array.isArray(value) && value.length !== 0 && value.every(isMethod)),
|
|
84
|
+
message: `must be one of or array of: ${methodValues.join(', ')}`,
|
|
85
|
+
example: () => ({ edge_functions: [{ method: ['PUT', 'DELETE'], path: '/hello', function: 'hello' }] }),
|
|
86
|
+
},
|
|
79
87
|
];
|
package/lib/path.js
CHANGED
|
@@ -6,6 +6,7 @@ const FILENAME = 'netlify.toml';
|
|
|
6
6
|
/**
|
|
7
7
|
* Configuration location can be:
|
|
8
8
|
* - a local path with the --config CLI flag
|
|
9
|
+
* - a `netlify.*` file in the `repositoryRoot/{base}/{packagePath}`
|
|
9
10
|
* - a `netlify.*` file in the `repositoryRoot/{base}`
|
|
10
11
|
* - a `netlify.*` file in the `repositoryRoot`
|
|
11
12
|
* - a `netlify.*` file in the current directory or any parent
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/config",
|
|
3
|
-
"version": "20.8.
|
|
3
|
+
"version": "20.8.1",
|
|
4
4
|
"description": "Netlify config module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/index.js",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"engines": {
|
|
95
95
|
"node": "^14.16.0 || >=16.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "0eb6dbbfd00ba11941b1ef638811eded8a030a17"
|
|
98
98
|
}
|