@vercel/config 0.0.37 → 0.0.39
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 +5 -82
- package/dist/router.js +2 -2
- package/dist/types.d.ts +273 -78
- package/dist/types.js +7 -2
- package/dist/utils/validation.js +1 -1
- package/dist/v1/index.d.ts +1 -1
- package/dist/v1/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/router.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Redirect, Rewrite } from './types';
|
|
1
|
+
import type { Condition, MatchableValueObject, Redirect, Rewrite } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Type utility to extract path parameter names from a route pattern string.
|
|
4
4
|
* Supports :paramName syntax used in path-to-regexp patterns.
|
|
@@ -96,88 +96,11 @@ export interface CacheOptions {
|
|
|
96
96
|
*/
|
|
97
97
|
staleIfError?: TimeString;
|
|
98
98
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Condition type for matching in redirects, headers, and rewrites.
|
|
101
|
-
* - 'header': Match if a specific HTTP header key/value is present (or missing).
|
|
102
|
-
* - 'cookie': Match if a specific cookie is present (or missing).
|
|
103
|
-
* - 'host': Match if the incoming host matches a given pattern.
|
|
104
|
-
* - 'query': Match if a query parameter is present (or missing).
|
|
105
|
-
* - 'path': Match if the path matches a given pattern.
|
|
106
|
-
*/
|
|
107
|
-
export type ConditionType = 'header' | 'cookie' | 'host' | 'query' | 'path';
|
|
108
|
-
/**
|
|
109
|
-
* Conditional matching operators for has/missing conditions.
|
|
110
|
-
* These can be used with the value field to perform advanced matching.
|
|
111
|
-
*/
|
|
112
|
-
export interface ConditionOperators {
|
|
113
|
-
/** Check equality on a value (exact match) */
|
|
114
|
-
eq?: string | number;
|
|
115
|
-
/** Check inequality on a value (not equal) */
|
|
116
|
-
neq?: string;
|
|
117
|
-
/** Check inclusion in an array of values (value is one of) */
|
|
118
|
-
inc?: string[];
|
|
119
|
-
/** Check non-inclusion in an array of values (value is not one of) */
|
|
120
|
-
ninc?: string[];
|
|
121
|
-
/** Check if value starts with a prefix */
|
|
122
|
-
pre?: string;
|
|
123
|
-
/** Check if value ends with a suffix */
|
|
124
|
-
suf?: string;
|
|
125
|
-
/** Check if value is greater than (numeric comparison) */
|
|
126
|
-
gt?: number;
|
|
127
|
-
/** Check if value is greater than or equal to */
|
|
128
|
-
gte?: number;
|
|
129
|
-
/** Check if value is less than (numeric comparison) */
|
|
130
|
-
lt?: number;
|
|
131
|
-
/** Check if value is less than or equal to */
|
|
132
|
-
lte?: number;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Used to define "has" or "missing" conditions with advanced matching operators.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* // Simple header presence check
|
|
139
|
-
* { type: 'header', key: 'x-api-key' }
|
|
140
|
-
*
|
|
141
|
-
* @example
|
|
142
|
-
* // Header with exact value match
|
|
143
|
-
* { type: 'header', key: 'x-api-version', value: 'v2' }
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* // Header with conditional operators
|
|
147
|
-
* { type: 'header', key: 'x-user-role', inc: ['admin', 'moderator'] }
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* // Cookie with prefix matching
|
|
151
|
-
* { type: 'cookie', key: 'session', pre: 'prod-' }
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* // Host matching
|
|
155
|
-
* { type: 'host', value: 'api.example.com' }
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* // Query parameter with numeric comparison
|
|
159
|
-
* { type: 'query', key: 'version', gte: 2 }
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* // Path pattern matching
|
|
163
|
-
* { type: 'path', value: '^/api/v[0-9]+/.*' }
|
|
164
|
-
*/
|
|
165
|
-
export interface Condition extends ConditionOperators {
|
|
166
|
-
type: ConditionType;
|
|
167
|
-
/** The key to match. Not used for 'host' or 'path' types. */
|
|
168
|
-
key?: string;
|
|
169
|
-
/**
|
|
170
|
-
* Simple string/regex pattern to match against.
|
|
171
|
-
* For 'host' and 'path' types, this is the only matching option.
|
|
172
|
-
* For other types, you can use value OR the conditional operators (eq, neq, etc).
|
|
173
|
-
*/
|
|
174
|
-
value?: string;
|
|
175
|
-
}
|
|
176
99
|
export declare const matchers: {
|
|
177
|
-
header: (key: string, value?: string |
|
|
178
|
-
cookie: (key: string, value?: string |
|
|
179
|
-
query: (key: string, value?: string |
|
|
180
|
-
host: (value: string |
|
|
100
|
+
header: (key: string, value?: string | MatchableValueObject) => Condition;
|
|
101
|
+
cookie: (key: string, value?: string | MatchableValueObject) => Condition;
|
|
102
|
+
query: (key: string, value?: string | MatchableValueObject) => Condition;
|
|
103
|
+
host: (value: string | MatchableValueObject) => Condition;
|
|
181
104
|
};
|
|
182
105
|
/**
|
|
183
106
|
* Transform type specifies the scope of what the transform will apply to.
|
package/dist/router.js
CHANGED
|
@@ -48,7 +48,7 @@ function createKeyedConditionHelper(type) {
|
|
|
48
48
|
if (typeof value === 'string') {
|
|
49
49
|
return { type, key, value };
|
|
50
50
|
}
|
|
51
|
-
return { type, key,
|
|
51
|
+
return { type, key, value };
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
function createKeylessConditionHelper(type) {
|
|
@@ -56,7 +56,7 @@ function createKeylessConditionHelper(type) {
|
|
|
56
56
|
if (typeof value === 'string') {
|
|
57
57
|
return { type, value };
|
|
58
58
|
}
|
|
59
|
-
return { type,
|
|
59
|
+
return { type, value };
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
exports.matchers = {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* AUTO-GENERATED — DO NOT EDIT
|
|
3
|
+
*
|
|
4
|
+
* This file is generated from the vercel.json OpenAPI schema.
|
|
5
|
+
* To modify, update scripts/generate-types.ts and re-run:
|
|
6
|
+
* pnpm generate-types
|
|
7
|
+
*
|
|
8
|
+
* Schema: https://openapi.vercel.sh/vercel.json
|
|
4
9
|
*/
|
|
5
|
-
export type Framework = 'blitzjs' | 'nextjs' | 'gatsby' | 'remix' | 'react-router' | 'astro' | 'hexo' | 'eleventy' | 'docusaurus-2' | 'docusaurus' | 'preact' | 'solidstart-1' | 'solidstart' | 'dojo' | 'ember' | 'vue' | 'scully' | 'ionic-angular' | 'angular' | 'polymer' | 'svelte' | 'sveltekit' | 'sveltekit-1' | 'ionic-react' | 'create-react-app' | 'gridsome' | 'umijs' | 'sapper' | 'saber' | 'stencil' | 'nuxtjs' | 'redwoodjs' | 'hugo' | 'jekyll' | 'brunch' | 'middleman' | 'zola' | 'hydrogen' | 'vite' | 'tanstack-start' | 'vitepress' | 'vuepress' | 'parcel' | 'fastapi' | 'flask' | 'fasthtml' | 'sanity-v3' | 'sanity' | 'storybook' | 'nitro' | 'hono' | 'express' | 'h3' | 'nestjs' | 'elysia' | 'fastify' | 'xmcp' | null;
|
|
10
|
+
export type Framework = 'blitzjs' | 'nextjs' | 'gatsby' | 'remix' | 'react-router' | 'astro' | 'hexo' | 'eleventy' | 'docusaurus-2' | 'docusaurus' | 'preact' | 'solidstart-1' | 'solidstart' | 'dojo' | 'ember' | 'vue' | 'scully' | 'ionic-angular' | 'angular' | 'polymer' | 'svelte' | 'sveltekit' | 'sveltekit-1' | 'ionic-react' | 'create-react-app' | 'gridsome' | 'umijs' | 'sapper' | 'saber' | 'stencil' | 'nuxtjs' | 'redwoodjs' | 'hugo' | 'jekyll' | 'brunch' | 'middleman' | 'zola' | 'hydrogen' | 'vite' | 'tanstack-start' | 'vitepress' | 'vuepress' | 'parcel' | 'fastapi' | 'flask' | 'fasthtml' | 'django' | 'sanity-v3' | 'sanity' | 'storybook' | 'nitro' | 'hono' | 'express' | 'h3' | 'koa' | 'nestjs' | 'elysia' | 'fastify' | 'xmcp' | 'python' | 'ruby' | 'rust' | 'node' | 'go' | 'services' | null;
|
|
6
11
|
export interface FunctionConfig {
|
|
7
12
|
/**
|
|
8
13
|
* A glob pattern to match files that should be excluded from your Serverless Function. If you’re using a Community Runtime, the behavior might vary.
|
|
@@ -13,27 +18,25 @@ export interface FunctionConfig {
|
|
|
13
18
|
*/
|
|
14
19
|
includeFiles?: string;
|
|
15
20
|
/**
|
|
16
|
-
* An integer defining how long your Serverless Function should be allowed to run on every request in seconds (between 1 and the maximum limit of your plan).
|
|
21
|
+
* An integer defining how long your Serverless Function should be allowed to run on every request in seconds (between 1 and the maximum limit of your plan), or the string `'max'` to use the maximum duration allowed by your plan.
|
|
17
22
|
*/
|
|
18
|
-
maxDuration?: number;
|
|
23
|
+
maxDuration?: number | 'max';
|
|
19
24
|
/**
|
|
20
25
|
* An integer defining the memory your Serverless Function should be provided with (between 128 and 10240).
|
|
21
26
|
*/
|
|
22
27
|
memory?: number;
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
25
|
-
* This setting overrides the top-level `regions` setting for matching functions.
|
|
29
|
+
* The npm package name of a Runtime, including its version
|
|
26
30
|
*/
|
|
27
|
-
|
|
31
|
+
runtime?: string;
|
|
28
32
|
/**
|
|
29
|
-
* An array of
|
|
30
|
-
* This setting overrides top-level `functionFailoverRegions` for matching functions.
|
|
33
|
+
* An array of regions this Serverless Function should be deployed to.
|
|
31
34
|
*/
|
|
32
|
-
|
|
35
|
+
regions?: string[];
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* An array of passive regions this Serverless Function can fail over to during a lambda outage.
|
|
35
38
|
*/
|
|
36
|
-
|
|
39
|
+
functionFailoverRegions?: string[];
|
|
37
40
|
/**
|
|
38
41
|
* A boolean that defines whether the Function supports cancellation (default: false)
|
|
39
42
|
*/
|
|
@@ -41,45 +44,61 @@ export interface FunctionConfig {
|
|
|
41
44
|
/**
|
|
42
45
|
* An array of experimental triggers for this Serverless Function. Currently only supports queue triggers.
|
|
43
46
|
*/
|
|
44
|
-
experimentalTriggers?: (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
47
|
+
experimentalTriggers?: ({
|
|
48
|
+
/**
|
|
49
|
+
* Event type pattern this trigger handles
|
|
50
|
+
*/
|
|
51
|
+
type: 'queue/v1beta';
|
|
52
|
+
/**
|
|
53
|
+
* Name of the queue topic to consume from
|
|
54
|
+
*/
|
|
55
|
+
topic: string;
|
|
56
|
+
/**
|
|
57
|
+
* Name of the consumer group for this trigger
|
|
58
|
+
*/
|
|
59
|
+
consumer: string;
|
|
60
|
+
/**
|
|
61
|
+
* Maximum number of delivery attempts
|
|
62
|
+
*/
|
|
63
|
+
maxDeliveries?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Delay in seconds before retrying failed executions
|
|
66
|
+
*/
|
|
67
|
+
retryAfterSeconds?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Initial delay in seconds before first execution attempt
|
|
70
|
+
*/
|
|
71
|
+
initialDelaySeconds?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Maximum number of concurrent executions for this consumer
|
|
74
|
+
*/
|
|
75
|
+
maxConcurrency?: number;
|
|
76
|
+
} | {
|
|
77
|
+
/**
|
|
78
|
+
* Event type pattern this trigger handles
|
|
79
|
+
*/
|
|
80
|
+
type: 'queue/v2beta';
|
|
81
|
+
/**
|
|
82
|
+
* Name of the queue topic to consume from
|
|
83
|
+
*/
|
|
84
|
+
topic: string;
|
|
85
|
+
/**
|
|
86
|
+
* Maximum number of delivery attempts
|
|
87
|
+
*/
|
|
88
|
+
maxDeliveries?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Delay in seconds before retrying failed executions
|
|
91
|
+
*/
|
|
92
|
+
retryAfterSeconds?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Initial delay in seconds before first execution attempt
|
|
95
|
+
*/
|
|
96
|
+
initialDelaySeconds?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Maximum number of concurrent executions for this consumer
|
|
99
|
+
*/
|
|
100
|
+
maxConcurrency?: number;
|
|
101
|
+
})[];
|
|
83
102
|
}
|
|
84
103
|
export interface CronJob {
|
|
85
104
|
schedule: string;
|
|
@@ -128,7 +147,7 @@ export interface ImageConfig {
|
|
|
128
147
|
contentSecurityPolicy?: string;
|
|
129
148
|
dangerouslyAllowSVG?: boolean;
|
|
130
149
|
domains?: string[];
|
|
131
|
-
formats?: 'image/avif' | 'image/webp' | 'image/jpeg' | 'image/png'[];
|
|
150
|
+
formats?: ('image/avif' | 'image/webp' | 'image/jpeg' | 'image/png')[];
|
|
132
151
|
localPatterns?: {
|
|
133
152
|
pathname?: string;
|
|
134
153
|
search?: string;
|
|
@@ -145,68 +164,166 @@ export interface ImageConfig {
|
|
|
145
164
|
sizes: number[];
|
|
146
165
|
}
|
|
147
166
|
/**
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
export interface Header {
|
|
151
|
-
key: string;
|
|
152
|
-
value: string;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Condition for matching in redirects, rewrites, and headers
|
|
167
|
+
* Value for condition matching - can be a string or an operator object
|
|
156
168
|
*/
|
|
157
|
-
export
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
169
|
+
export type MatchableValue = string | {
|
|
170
|
+
/**
|
|
171
|
+
* Equal to
|
|
172
|
+
*/
|
|
161
173
|
eq?: string | number;
|
|
174
|
+
/**
|
|
175
|
+
* Not equal
|
|
176
|
+
*/
|
|
162
177
|
neq?: string;
|
|
178
|
+
/**
|
|
179
|
+
* In array
|
|
180
|
+
*/
|
|
163
181
|
inc?: string[];
|
|
182
|
+
/**
|
|
183
|
+
* Not in array
|
|
184
|
+
*/
|
|
164
185
|
ninc?: string[];
|
|
186
|
+
/**
|
|
187
|
+
* Starts with
|
|
188
|
+
*/
|
|
165
189
|
pre?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Ends with
|
|
192
|
+
*/
|
|
166
193
|
suf?: string;
|
|
194
|
+
/**
|
|
195
|
+
* Regex
|
|
196
|
+
*/
|
|
167
197
|
re?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Greater than
|
|
200
|
+
*/
|
|
168
201
|
gt?: number;
|
|
202
|
+
/**
|
|
203
|
+
* Greater than or equal to
|
|
204
|
+
*/
|
|
169
205
|
gte?: number;
|
|
206
|
+
/**
|
|
207
|
+
* Less than
|
|
208
|
+
*/
|
|
170
209
|
lt?: number;
|
|
210
|
+
/**
|
|
211
|
+
* Less than or equal to
|
|
212
|
+
*/
|
|
171
213
|
lte?: number;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Condition for matching in redirects, rewrites, and headers
|
|
217
|
+
*/
|
|
218
|
+
export type Condition = {
|
|
219
|
+
type: 'host';
|
|
220
|
+
value: MatchableValue;
|
|
221
|
+
} | {
|
|
222
|
+
type: 'header' | 'cookie' | 'query';
|
|
223
|
+
key: string;
|
|
224
|
+
value?: MatchableValue;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* The object form of MatchableValue (excludes the plain string shorthand)
|
|
228
|
+
*/
|
|
229
|
+
export type MatchableValueObject = Exclude<MatchableValue, string>;
|
|
230
|
+
/**
|
|
231
|
+
* HTTP header key/value pair
|
|
232
|
+
*/
|
|
233
|
+
export interface Header {
|
|
234
|
+
key: string;
|
|
235
|
+
value: string;
|
|
172
236
|
}
|
|
173
237
|
/**
|
|
174
|
-
* Redirect matching vercel.json schema
|
|
175
|
-
* Returned by routes.redirect()
|
|
238
|
+
* Redirect definition matching vercel.json schema
|
|
176
239
|
*/
|
|
177
240
|
export interface Redirect {
|
|
241
|
+
/**
|
|
242
|
+
* A pattern that matches each incoming pathname (excluding querystring).
|
|
243
|
+
*/
|
|
178
244
|
source: string;
|
|
245
|
+
/**
|
|
246
|
+
* A location destination defined as an absolute pathname or external URL.
|
|
247
|
+
*/
|
|
179
248
|
destination: string;
|
|
249
|
+
/**
|
|
250
|
+
* A boolean to toggle between permanent and temporary redirect. When `true`, the status code is `308`. When `false` the status code is `307`.
|
|
251
|
+
*/
|
|
180
252
|
permanent?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* An optional integer to define the status code of the redirect.
|
|
255
|
+
* @private
|
|
256
|
+
*/
|
|
181
257
|
statusCode?: number;
|
|
258
|
+
/**
|
|
259
|
+
* An array of requirements that are needed to match
|
|
260
|
+
*/
|
|
182
261
|
has?: Condition[];
|
|
262
|
+
/**
|
|
263
|
+
* An array of requirements that are needed to match
|
|
264
|
+
*/
|
|
183
265
|
missing?: Condition[];
|
|
266
|
+
/**
|
|
267
|
+
* An array of environment variable names that should be replaced at runtime in the destination
|
|
268
|
+
*/
|
|
269
|
+
env?: string[];
|
|
184
270
|
}
|
|
185
271
|
/**
|
|
186
|
-
* Rewrite matching vercel.json schema
|
|
187
|
-
* Returned by routes.rewrite()
|
|
272
|
+
* Rewrite definition matching vercel.json schema
|
|
188
273
|
*/
|
|
189
274
|
export interface Rewrite {
|
|
275
|
+
/**
|
|
276
|
+
* A pattern that matches each incoming pathname (excluding querystring).
|
|
277
|
+
*/
|
|
190
278
|
source: string;
|
|
279
|
+
/**
|
|
280
|
+
* An absolute pathname to an existing resource or an external URL.
|
|
281
|
+
*/
|
|
191
282
|
destination: string;
|
|
283
|
+
/**
|
|
284
|
+
* An array of requirements that are needed to match
|
|
285
|
+
*/
|
|
192
286
|
has?: Condition[];
|
|
287
|
+
/**
|
|
288
|
+
* An array of requirements that are needed to match
|
|
289
|
+
*/
|
|
193
290
|
missing?: Condition[];
|
|
291
|
+
/**
|
|
292
|
+
* An optional integer to override the status code of the response.
|
|
293
|
+
*/
|
|
294
|
+
statusCode?: number;
|
|
295
|
+
/**
|
|
296
|
+
* An array of environment variable names that should be replaced at runtime in the destination
|
|
297
|
+
*/
|
|
298
|
+
env?: string[];
|
|
299
|
+
/**
|
|
300
|
+
* When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.
|
|
301
|
+
*/
|
|
194
302
|
respectOriginCacheControl?: boolean;
|
|
195
303
|
}
|
|
196
304
|
/**
|
|
197
|
-
* Header rule matching vercel.json schema
|
|
198
|
-
* Returned by routes.header() and routes.cacheControl()
|
|
305
|
+
* Header rule definition matching vercel.json schema
|
|
199
306
|
*/
|
|
200
307
|
export interface HeaderRule {
|
|
308
|
+
/**
|
|
309
|
+
* A pattern that matches each incoming pathname (excluding querystring)
|
|
310
|
+
*/
|
|
201
311
|
source: string;
|
|
312
|
+
/**
|
|
313
|
+
* An array of key/value pairs representing each response header.
|
|
314
|
+
*/
|
|
202
315
|
headers: Header[];
|
|
316
|
+
/**
|
|
317
|
+
* An array of requirements that are needed to match
|
|
318
|
+
*/
|
|
203
319
|
has?: Condition[];
|
|
320
|
+
/**
|
|
321
|
+
* An array of requirements that are needed to match
|
|
322
|
+
*/
|
|
204
323
|
missing?: Condition[];
|
|
205
324
|
}
|
|
206
325
|
/**
|
|
207
|
-
* Union type for all
|
|
208
|
-
* Can be simple schema objects (Redirect, Rewrite, HeaderRule) or Routes with transforms
|
|
209
|
-
* Note: Route type is defined in router.ts (uses src/dest instead of source/destination)
|
|
326
|
+
* Union type for all routing helper outputs
|
|
210
327
|
*/
|
|
211
328
|
export type RouteType = Redirect | Rewrite | HeaderRule | any;
|
|
212
329
|
export interface WildcardDomain {
|
|
@@ -265,7 +382,7 @@ export interface VercelConfig {
|
|
|
265
382
|
/**
|
|
266
383
|
* A list of header definitions.
|
|
267
384
|
*/
|
|
268
|
-
headers?:
|
|
385
|
+
headers?: HeaderRule[];
|
|
269
386
|
images?: ImageConfig;
|
|
270
387
|
/**
|
|
271
388
|
* A name for the deployment
|
|
@@ -278,7 +395,7 @@ export interface VercelConfig {
|
|
|
278
395
|
/**
|
|
279
396
|
* A list of redirect definitions.
|
|
280
397
|
*/
|
|
281
|
-
redirects?:
|
|
398
|
+
redirects?: Redirect[];
|
|
282
399
|
/**
|
|
283
400
|
* The path to a file containing bulk redirects; supports JSON, JSONL, and CSV
|
|
284
401
|
*/
|
|
@@ -290,7 +407,7 @@ export interface VercelConfig {
|
|
|
290
407
|
/**
|
|
291
408
|
* A list of rewrite definitions.
|
|
292
409
|
*/
|
|
293
|
-
rewrites?:
|
|
410
|
+
rewrites?: Rewrite[];
|
|
294
411
|
/**
|
|
295
412
|
* A list of routes objects used to rewrite paths to point towards other internal or external paths
|
|
296
413
|
*/
|
|
@@ -349,9 +466,87 @@ export interface VercelConfig {
|
|
|
349
466
|
* Enables Bun for the project and specifies the version to use.
|
|
350
467
|
*/
|
|
351
468
|
bunVersion?: string;
|
|
469
|
+
/**
|
|
470
|
+
* Enables configuration of multiple services in a single deployment. Map of service name to service configuration.
|
|
471
|
+
* @private
|
|
472
|
+
*/
|
|
473
|
+
experimentalServices?: Record<string, {
|
|
474
|
+
/**
|
|
475
|
+
* Service type: web, cron, or worker. Defaults to web.
|
|
476
|
+
*/
|
|
477
|
+
type?: 'web' | 'cron' | 'worker';
|
|
478
|
+
/**
|
|
479
|
+
* Entry file for the service, relative to the workspace directory.
|
|
480
|
+
*/
|
|
481
|
+
entrypoint?: string;
|
|
482
|
+
/**
|
|
483
|
+
* Path to the directory containing the service manifest file (package.json, pyproject.toml, etc.). Defaults to "." (project root).
|
|
484
|
+
*/
|
|
485
|
+
workspace?: string;
|
|
486
|
+
/**
|
|
487
|
+
* URL prefix for routing (web services only).
|
|
488
|
+
*/
|
|
489
|
+
routePrefix?: string;
|
|
490
|
+
/**
|
|
491
|
+
* Subdomain for host-based routing (web services only).
|
|
492
|
+
*/
|
|
493
|
+
subdomain?: string;
|
|
494
|
+
/**
|
|
495
|
+
* Framework to use.
|
|
496
|
+
*/
|
|
497
|
+
framework?: string;
|
|
498
|
+
/**
|
|
499
|
+
* Builder to use, e.g. @vercel/node, @vercel/python.
|
|
500
|
+
*/
|
|
501
|
+
builder?: string;
|
|
502
|
+
/**
|
|
503
|
+
* Specific lambda runtime to use, e.g. nodejs24.x, python3.14.
|
|
504
|
+
*/
|
|
505
|
+
runtime?: string;
|
|
506
|
+
/**
|
|
507
|
+
* Build command for the service.
|
|
508
|
+
*/
|
|
509
|
+
buildCommand?: string;
|
|
510
|
+
/**
|
|
511
|
+
* Install command for the service.
|
|
512
|
+
*/
|
|
513
|
+
installCommand?: string;
|
|
514
|
+
/**
|
|
515
|
+
* Memory allocation in MB (128-10240).
|
|
516
|
+
*/
|
|
517
|
+
memory?: number;
|
|
518
|
+
/**
|
|
519
|
+
* Max duration in seconds (1-900).
|
|
520
|
+
*/
|
|
521
|
+
maxDuration?: number;
|
|
522
|
+
/**
|
|
523
|
+
* Files to include in bundle.
|
|
524
|
+
*/
|
|
525
|
+
includeFiles?: string | string[];
|
|
526
|
+
/**
|
|
527
|
+
* Files to exclude from bundle.
|
|
528
|
+
*/
|
|
529
|
+
excludeFiles?: string | string[];
|
|
530
|
+
/**
|
|
531
|
+
* Cron schedule expression (e.g., "0 0 * * *"). Required for cron services.
|
|
532
|
+
*/
|
|
533
|
+
schedule?: string;
|
|
534
|
+
/**
|
|
535
|
+
* Topic name for worker subscription.
|
|
536
|
+
*/
|
|
537
|
+
topic?: string;
|
|
538
|
+
/**
|
|
539
|
+
* Consumer group name for worker subscription.
|
|
540
|
+
*/
|
|
541
|
+
consumer?: string;
|
|
542
|
+
}>;
|
|
543
|
+
/**
|
|
544
|
+
* Enables grouping of services. Map of service group name to an array of service names belonging to that group.
|
|
545
|
+
* @private
|
|
546
|
+
*/
|
|
547
|
+
experimentalServiceGroups?: Record<string, string[]>;
|
|
352
548
|
}
|
|
353
549
|
/**
|
|
354
550
|
* Runtime placeholder for VercelConfig to allow named imports.
|
|
355
551
|
*/
|
|
356
552
|
export declare const VercelConfig: {};
|
|
357
|
-
export {};
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* AUTO-GENERATED — DO NOT EDIT
|
|
4
|
+
*
|
|
5
|
+
* This file is generated from the vercel.json OpenAPI schema.
|
|
6
|
+
* To modify, update scripts/generate-types.ts and re-run:
|
|
7
|
+
* pnpm generate-types
|
|
8
|
+
*
|
|
9
|
+
* Schema: https://openapi.vercel.sh/vercel.json
|
|
5
10
|
*/
|
|
6
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
12
|
exports.VercelConfig = void 0;
|
package/dist/utils/validation.js
CHANGED
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createRoutes, routes, Router } from '../router';
|
|
2
2
|
export * from '../router';
|
|
3
3
|
export { VercelConfig } from '../types';
|
|
4
|
-
export type { Redirect, Rewrite, HeaderRule, Condition, RouteType, } from '../types';
|
|
4
|
+
export type { Redirect, Rewrite, HeaderRule, Condition, MatchableValue, RouteType, } from '../types';
|
|
5
5
|
export { validateStaticString, validateStaticBoolean, validateStaticObject, validateStaticStringArray, validateStaticFields, } from '../utils/validation';
|
package/dist/v1/types.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Usage:
|
|
5
5
|
* /// <reference types="@vercel/config/v1/types" />
|
|
6
6
|
*/
|
|
7
|
-
export type { VercelConfig, Framework, FunctionConfig, CronJob, GitDeploymentConfig, GitConfig, GithubConfig, ImageConfig, Header, Condition, Redirect, Rewrite, HeaderRule, RouteType, WildcardDomain, BuildConfig, BuildItem, } from '../types';
|
|
7
|
+
export type { VercelConfig, Framework, FunctionConfig, CronJob, GitDeploymentConfig, GitConfig, GithubConfig, ImageConfig, Header, Condition, MatchableValue, Redirect, Rewrite, HeaderRule, RouteType, WildcardDomain, BuildConfig, BuildItem, } from '../types';
|
package/package.json
CHANGED