@vercel/config 0.0.30 → 0.0.32
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/dist/router.d.ts +6 -0
- package/dist/router.js +26 -1
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/router.d.ts
CHANGED
|
@@ -173,6 +173,12 @@ export interface Condition extends ConditionOperators {
|
|
|
173
173
|
*/
|
|
174
174
|
value?: string;
|
|
175
175
|
}
|
|
176
|
+
export declare const matchers: {
|
|
177
|
+
header: (key: string, value?: string | ConditionOperators) => Condition;
|
|
178
|
+
cookie: (key: string, value?: string | ConditionOperators) => Condition;
|
|
179
|
+
query: (key: string, value?: string | ConditionOperators) => Condition;
|
|
180
|
+
host: (value: string | ConditionOperators) => Condition;
|
|
181
|
+
};
|
|
176
182
|
/**
|
|
177
183
|
* Transform type specifies the scope of what the transform will apply to.
|
|
178
184
|
* - 'request.query': Transform query parameters in the request
|
package/dist/router.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.routes = exports.createRoutes = exports.Router = exports.deploymentEnv = void 0;
|
|
3
|
+
exports.routes = exports.createRoutes = exports.Router = exports.matchers = exports.deploymentEnv = void 0;
|
|
4
4
|
const pretty_cache_header_1 = require("pretty-cache-header");
|
|
5
5
|
const validation_1 = require("./utils/validation");
|
|
6
6
|
/**
|
|
@@ -21,6 +21,31 @@ function deploymentEnv(name) {
|
|
|
21
21
|
return `$${name}`;
|
|
22
22
|
}
|
|
23
23
|
exports.deploymentEnv = deploymentEnv;
|
|
24
|
+
function createKeyedConditionHelper(type) {
|
|
25
|
+
return (key, value) => {
|
|
26
|
+
if (value === undefined) {
|
|
27
|
+
return { type, key };
|
|
28
|
+
}
|
|
29
|
+
if (typeof value === 'string') {
|
|
30
|
+
return { type, key, value };
|
|
31
|
+
}
|
|
32
|
+
return { type, key, ...value };
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function createKeylessConditionHelper(type) {
|
|
36
|
+
return (value) => {
|
|
37
|
+
if (typeof value === 'string') {
|
|
38
|
+
return { type, value };
|
|
39
|
+
}
|
|
40
|
+
return { type, ...value };
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
exports.matchers = {
|
|
44
|
+
header: createKeyedConditionHelper('header'),
|
|
45
|
+
cookie: createKeyedConditionHelper('cookie'),
|
|
46
|
+
query: createKeyedConditionHelper('query'),
|
|
47
|
+
host: createKeylessConditionHelper('host'),
|
|
48
|
+
};
|
|
24
49
|
/**
|
|
25
50
|
* Extract environment variable names from a string or array of strings
|
|
26
51
|
* Returns env var names without the $ prefix, excluding path parameters
|
package/dist/types.d.ts
CHANGED
|
@@ -25,6 +25,11 @@ export interface FunctionConfig {
|
|
|
25
25
|
* This setting overrides the top-level `regions` setting for matching functions.
|
|
26
26
|
*/
|
|
27
27
|
regions?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* An array of passive regions where this Serverless Function can fail over during outages.
|
|
30
|
+
* This setting overrides top-level `functionFailoverRegions` for matching functions.
|
|
31
|
+
*/
|
|
32
|
+
functionFailoverRegions?: string[];
|
|
28
33
|
/**
|
|
29
34
|
* The npm package name of a Runtime, including its version
|
|
30
35
|
*/
|
package/package.json
CHANGED