@vercel/config 0.0.19 → 0.0.21
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 +10 -74
- package/dist/router.js +12 -101
- package/dist/types.d.ts +169 -48
- package/dist/v1/index.d.ts +1 -1
- package/dist/v1/index.js +3 -2
- package/package.json +3 -1
package/dist/router.d.ts
CHANGED
|
@@ -466,31 +466,10 @@ export interface RouterConfig {
|
|
|
466
466
|
* When routes is present, other fields (redirects, headers, rewrites, crons) are excluded.
|
|
467
467
|
*/
|
|
468
468
|
routes?: Route[];
|
|
469
|
-
/**
|
|
470
|
-
* When true, Vercel automatically removes file extensions and normalizes
|
|
471
|
-
* certain paths, serving HTML and serverless routes extension-free.
|
|
472
|
-
*/
|
|
473
|
-
cleanUrls?: boolean;
|
|
474
|
-
/**
|
|
475
|
-
* When true, routes are normalized to include a trailing slash.
|
|
476
|
-
*/
|
|
477
|
-
trailingSlash?: boolean;
|
|
478
|
-
/**
|
|
479
|
-
* Path to a JSON file containing bulk redirect rules.
|
|
480
|
-
*/
|
|
481
|
-
bulkRedirectsPath?: string;
|
|
482
469
|
/**
|
|
483
470
|
* Array of cron definitions for scheduled invocations.
|
|
484
471
|
*/
|
|
485
472
|
crons?: CronRule[];
|
|
486
|
-
/**
|
|
487
|
-
* Custom build command to run during deployment.
|
|
488
|
-
*/
|
|
489
|
-
buildCommand?: string;
|
|
490
|
-
/**
|
|
491
|
-
* Custom install command to run during deployment.
|
|
492
|
-
*/
|
|
493
|
-
installCommand?: string;
|
|
494
473
|
}
|
|
495
474
|
/**
|
|
496
475
|
* The main Router class for building a Vercel configuration object in code.
|
|
@@ -503,35 +482,6 @@ export declare class Router {
|
|
|
503
482
|
private rewriteRules;
|
|
504
483
|
private routeRules;
|
|
505
484
|
private cronRules;
|
|
506
|
-
private cleanUrlsConfig;
|
|
507
|
-
private trailingSlashConfig;
|
|
508
|
-
private bulkRedirectsPathConfig;
|
|
509
|
-
private buildCommandConfig;
|
|
510
|
-
private installCommandConfig;
|
|
511
|
-
/**
|
|
512
|
-
* Property setter for cleanUrls configuration.
|
|
513
|
-
*/
|
|
514
|
-
set cleanUrls(value: boolean | undefined);
|
|
515
|
-
/**
|
|
516
|
-
* Property getter for cleanUrls configuration.
|
|
517
|
-
*/
|
|
518
|
-
get cleanUrls(): boolean | undefined;
|
|
519
|
-
/**
|
|
520
|
-
* Property setter for trailingSlash configuration.
|
|
521
|
-
*/
|
|
522
|
-
set trailingSlash(value: boolean | undefined);
|
|
523
|
-
/**
|
|
524
|
-
* Property getter for trailingSlash configuration.
|
|
525
|
-
*/
|
|
526
|
-
get trailingSlash(): boolean | undefined;
|
|
527
|
-
/**
|
|
528
|
-
* Property setter for bulkRedirectsPath configuration.
|
|
529
|
-
*/
|
|
530
|
-
set bulkRedirectsPath(value: string | undefined);
|
|
531
|
-
/**
|
|
532
|
-
* Property getter for bulkRedirectsPath configuration.
|
|
533
|
-
*/
|
|
534
|
-
get bulkRedirectsPath(): string | undefined;
|
|
535
485
|
/**
|
|
536
486
|
* Helper to extract path parameter names from a source pattern.
|
|
537
487
|
* Path parameters are identified by :paramName syntax.
|
|
@@ -661,27 +611,6 @@ export declare class Router {
|
|
|
661
611
|
* });
|
|
662
612
|
*/
|
|
663
613
|
route(config: Route): this;
|
|
664
|
-
/**
|
|
665
|
-
* When true, automatically serve HTML files and serverless functions
|
|
666
|
-
* without the .html or .js extension. This is a built-in Vercel feature.
|
|
667
|
-
*/
|
|
668
|
-
setCleanUrls(value: boolean): this;
|
|
669
|
-
/**
|
|
670
|
-
* When true, automatically normalize paths to include a trailing slash.
|
|
671
|
-
*/
|
|
672
|
-
setTrailingSlash(value: boolean): this;
|
|
673
|
-
/**
|
|
674
|
-
* Sets a custom build command to run during deployment.
|
|
675
|
-
* @example
|
|
676
|
-
* router.setBuildCommand('pnpm run generate-config')
|
|
677
|
-
*/
|
|
678
|
-
setBuildCommand(value: string): this;
|
|
679
|
-
/**
|
|
680
|
-
* Sets a custom install command to run during deployment.
|
|
681
|
-
* @example
|
|
682
|
-
* router.setInstallCommand('pnpm install --no-frozen-lockfile')
|
|
683
|
-
*/
|
|
684
|
-
setInstallCommand(value: string): this;
|
|
685
614
|
/**
|
|
686
615
|
* Adds a single cron rule (synchronous).
|
|
687
616
|
*/
|
|
@@ -707,7 +636,14 @@ export declare class Router {
|
|
|
707
636
|
/**
|
|
708
637
|
* A simple factory function for creating a new Router instance.
|
|
709
638
|
* @example
|
|
710
|
-
* import {
|
|
711
|
-
* const
|
|
639
|
+
* import { createRoutes } from '@vercel/router-sdk';
|
|
640
|
+
* const routes = createRoutes();
|
|
641
|
+
*/
|
|
642
|
+
export declare function createRoutes(): Router;
|
|
643
|
+
/**
|
|
644
|
+
* Default singleton router instance for convenience.
|
|
645
|
+
* @example
|
|
646
|
+
* import { routes } from '@vercel/router-sdk';
|
|
647
|
+
* routes.redirect('/old', '/new');
|
|
712
648
|
*/
|
|
713
|
-
export declare
|
|
649
|
+
export declare const routes: Router;
|
package/dist/router.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.routes = exports.createRoutes = exports.Router = exports.runtimeEnv = exports.param = void 0;
|
|
4
4
|
const pretty_cache_header_1 = require("pretty-cache-header");
|
|
5
5
|
const validation_1 = require("./utils/validation");
|
|
6
6
|
/**
|
|
@@ -62,47 +62,6 @@ class Router {
|
|
|
62
62
|
this.rewriteRules = [];
|
|
63
63
|
this.routeRules = [];
|
|
64
64
|
this.cronRules = [];
|
|
65
|
-
this.cleanUrlsConfig = undefined;
|
|
66
|
-
this.trailingSlashConfig = undefined;
|
|
67
|
-
this.bulkRedirectsPathConfig = undefined;
|
|
68
|
-
this.buildCommandConfig = undefined;
|
|
69
|
-
this.installCommandConfig = undefined;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Property setter for cleanUrls configuration.
|
|
73
|
-
*/
|
|
74
|
-
set cleanUrls(value) {
|
|
75
|
-
this.cleanUrlsConfig = value;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Property getter for cleanUrls configuration.
|
|
79
|
-
*/
|
|
80
|
-
get cleanUrls() {
|
|
81
|
-
return this.cleanUrlsConfig;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Property setter for trailingSlash configuration.
|
|
85
|
-
*/
|
|
86
|
-
set trailingSlash(value) {
|
|
87
|
-
this.trailingSlashConfig = value;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Property getter for trailingSlash configuration.
|
|
91
|
-
*/
|
|
92
|
-
get trailingSlash() {
|
|
93
|
-
return this.trailingSlashConfig;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Property setter for bulkRedirectsPath configuration.
|
|
97
|
-
*/
|
|
98
|
-
set bulkRedirectsPath(value) {
|
|
99
|
-
this.bulkRedirectsPathConfig = value;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Property getter for bulkRedirectsPath configuration.
|
|
103
|
-
*/
|
|
104
|
-
get bulkRedirectsPath() {
|
|
105
|
-
return this.bulkRedirectsPathConfig;
|
|
106
65
|
}
|
|
107
66
|
/**
|
|
108
67
|
* Helper to extract path parameter names from a source pattern.
|
|
@@ -392,39 +351,6 @@ class Router {
|
|
|
392
351
|
this.routeRules.push(config);
|
|
393
352
|
return this;
|
|
394
353
|
}
|
|
395
|
-
/**
|
|
396
|
-
* When true, automatically serve HTML files and serverless functions
|
|
397
|
-
* without the .html or .js extension. This is a built-in Vercel feature.
|
|
398
|
-
*/
|
|
399
|
-
setCleanUrls(value) {
|
|
400
|
-
this.cleanUrlsConfig = value;
|
|
401
|
-
return this;
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* When true, automatically normalize paths to include a trailing slash.
|
|
405
|
-
*/
|
|
406
|
-
setTrailingSlash(value) {
|
|
407
|
-
this.trailingSlashConfig = value;
|
|
408
|
-
return this;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Sets a custom build command to run during deployment.
|
|
412
|
-
* @example
|
|
413
|
-
* router.setBuildCommand('pnpm run generate-config')
|
|
414
|
-
*/
|
|
415
|
-
setBuildCommand(value) {
|
|
416
|
-
this.buildCommandConfig = value;
|
|
417
|
-
return this;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Sets a custom install command to run during deployment.
|
|
421
|
-
* @example
|
|
422
|
-
* router.setInstallCommand('pnpm install --no-frozen-lockfile')
|
|
423
|
-
*/
|
|
424
|
-
setInstallCommand(value) {
|
|
425
|
-
this.installCommandConfig = value;
|
|
426
|
-
return this;
|
|
427
|
-
}
|
|
428
354
|
/**
|
|
429
355
|
* Adds a single cron rule (synchronous).
|
|
430
356
|
*/
|
|
@@ -532,16 +458,6 @@ class Router {
|
|
|
532
458
|
};
|
|
533
459
|
// NOTE: crons are now handled via export const crons in vercel.ts
|
|
534
460
|
// They are no longer included in router.getConfig()
|
|
535
|
-
// Only include optional fields if they're explicitly set
|
|
536
|
-
if (this.bulkRedirectsPathConfig !== undefined) {
|
|
537
|
-
config.bulkRedirectsPath = this.bulkRedirectsPathConfig;
|
|
538
|
-
}
|
|
539
|
-
if (this.buildCommandConfig !== undefined) {
|
|
540
|
-
config.buildCommand = this.buildCommandConfig;
|
|
541
|
-
}
|
|
542
|
-
if (this.installCommandConfig !== undefined) {
|
|
543
|
-
config.installCommand = this.installCommandConfig;
|
|
544
|
-
}
|
|
545
461
|
return config;
|
|
546
462
|
}
|
|
547
463
|
// Otherwise, return the legacy format
|
|
@@ -549,20 +465,8 @@ class Router {
|
|
|
549
465
|
redirects: this.redirectRules,
|
|
550
466
|
headers: this.headerRules,
|
|
551
467
|
rewrites: legacyRewrites,
|
|
552
|
-
cleanUrls: this.cleanUrlsConfig,
|
|
553
|
-
trailingSlash: this.trailingSlashConfig,
|
|
554
468
|
// NOTE: crons are now handled via export const crons in vercel.ts
|
|
555
469
|
};
|
|
556
|
-
// Only include optional fields if they're explicitly set
|
|
557
|
-
if (this.bulkRedirectsPathConfig !== undefined) {
|
|
558
|
-
config.bulkRedirectsPath = this.bulkRedirectsPathConfig;
|
|
559
|
-
}
|
|
560
|
-
if (this.buildCommandConfig !== undefined) {
|
|
561
|
-
config.buildCommand = this.buildCommandConfig;
|
|
562
|
-
}
|
|
563
|
-
if (this.installCommandConfig !== undefined) {
|
|
564
|
-
config.installCommand = this.installCommandConfig;
|
|
565
|
-
}
|
|
566
470
|
return config;
|
|
567
471
|
}
|
|
568
472
|
/**
|
|
@@ -633,10 +537,17 @@ exports.Router = Router;
|
|
|
633
537
|
/**
|
|
634
538
|
* A simple factory function for creating a new Router instance.
|
|
635
539
|
* @example
|
|
636
|
-
* import {
|
|
637
|
-
* const
|
|
540
|
+
* import { createRoutes } from '@vercel/router-sdk';
|
|
541
|
+
* const routes = createRoutes();
|
|
638
542
|
*/
|
|
639
|
-
function
|
|
543
|
+
function createRoutes() {
|
|
640
544
|
return new Router();
|
|
641
545
|
}
|
|
642
|
-
exports.
|
|
546
|
+
exports.createRoutes = createRoutes;
|
|
547
|
+
/**
|
|
548
|
+
* Default singleton router instance for convenience.
|
|
549
|
+
* @example
|
|
550
|
+
* import { routes } from '@vercel/router-sdk';
|
|
551
|
+
* routes.redirect('/old', '/new');
|
|
552
|
+
*/
|
|
553
|
+
exports.routes = new Router();
|
package/dist/types.d.ts
CHANGED
|
@@ -3,36 +3,123 @@
|
|
|
3
3
|
* https://openapi.vercel.sh/vercel.json
|
|
4
4
|
*/
|
|
5
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;
|
|
6
|
-
export interface CronJob {
|
|
7
|
-
schedule: string;
|
|
8
|
-
path: string;
|
|
9
|
-
}
|
|
10
6
|
export interface FunctionConfig {
|
|
7
|
+
/**
|
|
8
|
+
* 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.
|
|
9
|
+
*/
|
|
11
10
|
excludeFiles?: string;
|
|
11
|
+
/**
|
|
12
|
+
* A glob pattern to match files that should be included in your Serverless Function. If you’re using a Community Runtime, the behavior might vary.
|
|
13
|
+
*/
|
|
12
14
|
includeFiles?: string;
|
|
15
|
+
/**
|
|
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).
|
|
17
|
+
*/
|
|
13
18
|
maxDuration?: number;
|
|
19
|
+
/**
|
|
20
|
+
* An integer defining the memory your Serverless Function should be provided with (between 128 and 10240).
|
|
21
|
+
*/
|
|
14
22
|
memory?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The npm package name of a Runtime, including its version
|
|
25
|
+
*/
|
|
15
26
|
runtime?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A boolean that defines whether the Function supports cancellation (default: false)
|
|
29
|
+
*/
|
|
16
30
|
supportsCancellation?: boolean;
|
|
17
|
-
|
|
18
|
-
|
|
31
|
+
/**
|
|
32
|
+
* An array of experimental triggers for this Serverless Function. Currently only supports queue triggers.
|
|
33
|
+
*/
|
|
34
|
+
experimentalTriggers?: {
|
|
35
|
+
/**
|
|
36
|
+
* Event type pattern this trigger handles
|
|
37
|
+
*/
|
|
38
|
+
type: string;
|
|
39
|
+
/**
|
|
40
|
+
* Name of the queue topic to consume from
|
|
41
|
+
*/
|
|
19
42
|
topic: string;
|
|
43
|
+
/**
|
|
44
|
+
* Name of the consumer group for this trigger
|
|
45
|
+
*/
|
|
20
46
|
consumer: string;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum number of delivery attempts
|
|
49
|
+
*/
|
|
21
50
|
maxDeliveries?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Delay in seconds before retrying failed executions
|
|
53
|
+
*/
|
|
22
54
|
retryAfterSeconds?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Initial delay in seconds before first execution attempt
|
|
57
|
+
*/
|
|
23
58
|
initialDelaySeconds?: number;
|
|
24
|
-
}
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
export interface CronJob {
|
|
62
|
+
schedule: string;
|
|
63
|
+
path: string;
|
|
25
64
|
}
|
|
26
65
|
export interface GitDeploymentConfig {
|
|
27
66
|
[branch: string]: boolean;
|
|
28
67
|
}
|
|
29
68
|
export interface GitConfig {
|
|
69
|
+
/**
|
|
70
|
+
* Specifies the branches that will not trigger an auto-deployment when committing to them. Any non specified branch is `true` by default.
|
|
71
|
+
*/
|
|
30
72
|
deploymentEnabled?: boolean | GitDeploymentConfig;
|
|
73
|
+
/**
|
|
74
|
+
* If specified, the git repository will be exclusive to the specificed Team IDs. Teams that are not specified in the list will not be able to link new projects or create new deployments.
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
exclusivity?: {
|
|
78
|
+
/**
|
|
79
|
+
* A list of allowed Team IDs.
|
|
80
|
+
*/
|
|
81
|
+
teams?: string[];
|
|
82
|
+
};
|
|
31
83
|
}
|
|
32
84
|
export interface GithubConfig {
|
|
33
|
-
|
|
85
|
+
/**
|
|
86
|
+
* When set to `false`, Vercel for GitHub will not deploy the given project regardless of the GitHub app being installed.
|
|
87
|
+
*/
|
|
34
88
|
autoAlias?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* When set to `false`, Vercel for GitHub will always build pushes in sequence without cancelling a build for the most recent commit.
|
|
91
|
+
*/
|
|
35
92
|
autoJobCancelation?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* When set to false, Vercel for GitHub will not apply the alias upon merge.
|
|
95
|
+
*/
|
|
96
|
+
enabled?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* [deprecated] Please use the Project Settings in the dashboard instead: https://vercel.link/46vERTS When set to `true`, Vercel for GitHub will stop commenting on pull requests and commits.
|
|
99
|
+
* @deprecated
|
|
100
|
+
*/
|
|
101
|
+
silent?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface ImageConfig {
|
|
104
|
+
contentDispositionType?: 'inline' | 'attachment';
|
|
105
|
+
contentSecurityPolicy?: string;
|
|
106
|
+
dangerouslyAllowSVG?: boolean;
|
|
107
|
+
domains?: string[];
|
|
108
|
+
formats?: 'image/avif' | 'image/webp' | 'image/jpeg' | 'image/png'[];
|
|
109
|
+
localPatterns?: {
|
|
110
|
+
pathname?: string;
|
|
111
|
+
search?: string;
|
|
112
|
+
}[];
|
|
113
|
+
minimumCacheTTL?: number;
|
|
114
|
+
qualities?: number[];
|
|
115
|
+
remotePatterns?: {
|
|
116
|
+
protocol?: 'http' | 'https';
|
|
117
|
+
hostname: string;
|
|
118
|
+
port?: string;
|
|
119
|
+
pathname?: string;
|
|
120
|
+
search?: string;
|
|
121
|
+
}[];
|
|
122
|
+
sizes: number[];
|
|
36
123
|
}
|
|
37
124
|
/**
|
|
38
125
|
* HTTP header key/value pair
|
|
@@ -48,10 +135,13 @@ export interface Condition {
|
|
|
48
135
|
type: 'header' | 'cookie' | 'host' | 'query' | 'path';
|
|
49
136
|
key?: string;
|
|
50
137
|
value?: string | number;
|
|
51
|
-
inc?: string[];
|
|
52
|
-
pre?: string;
|
|
53
138
|
eq?: string | number;
|
|
54
139
|
neq?: string;
|
|
140
|
+
inc?: string[];
|
|
141
|
+
ninc?: string[];
|
|
142
|
+
pre?: string;
|
|
143
|
+
suf?: string;
|
|
144
|
+
re?: string;
|
|
55
145
|
gt?: number;
|
|
56
146
|
gte?: number;
|
|
57
147
|
lt?: number;
|
|
@@ -99,112 +189,143 @@ export interface WildcardDomain {
|
|
|
99
189
|
domain: string;
|
|
100
190
|
value: string;
|
|
101
191
|
}
|
|
192
|
+
export interface BuildConfig {
|
|
193
|
+
env?: Record<string, string>;
|
|
194
|
+
}
|
|
195
|
+
export interface BuildItem {
|
|
196
|
+
config?: Record<string, any>;
|
|
197
|
+
src?: string;
|
|
198
|
+
use: string;
|
|
199
|
+
}
|
|
102
200
|
export interface VercelConfig {
|
|
103
201
|
/**
|
|
104
|
-
* Aliases that will get assigned when the deployment is `READY` and the target is `production`.
|
|
202
|
+
* Aliases that will get assigned when the deployment is `READY` and the target is `production`. The client needs to make a `GET` request to its API to ensure the assignment
|
|
105
203
|
*/
|
|
106
204
|
alias?: string | string[];
|
|
107
205
|
/**
|
|
108
|
-
*
|
|
206
|
+
* An object containing another object with information to be passed to the Build Process
|
|
207
|
+
* @deprecated
|
|
109
208
|
*/
|
|
110
|
-
|
|
209
|
+
build?: BuildConfig;
|
|
111
210
|
/**
|
|
112
|
-
*
|
|
211
|
+
* A list of build descriptions whose src references valid source files.
|
|
212
|
+
* @deprecated
|
|
113
213
|
*/
|
|
114
|
-
|
|
214
|
+
builds?: BuildItem[];
|
|
115
215
|
/**
|
|
116
|
-
*
|
|
216
|
+
* When set to `true`, all HTML files and Serverless Functions will have their extension removed. When visiting a path that ends with the extension, a 308 response will redirect the client to the extensionless path.
|
|
217
|
+
*/
|
|
218
|
+
cleanUrls?: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* An object containing the deployment's environment variable names and values. Secrets can be referenced by prefixing the value with `@`
|
|
221
|
+
* @deprecated
|
|
117
222
|
*/
|
|
118
223
|
env?: Record<string, string>;
|
|
119
224
|
/**
|
|
120
|
-
* An array of the passive regions the deployment's Serverless Functions should be deployed to
|
|
225
|
+
* An array of the passive regions the deployment's Serverless Functions should be deployed to that can be failed over to during a lambda outage
|
|
121
226
|
*/
|
|
122
227
|
passiveRegions?: string[];
|
|
123
228
|
/**
|
|
124
|
-
* Same as passiveRegions. An array of passive regions
|
|
229
|
+
* Same as passiveRegions. An array of the passive regions the deployment's Serverless Functions should be deployed to so we can failover to these regions on lambda outages
|
|
125
230
|
*/
|
|
126
231
|
functionFailoverRegions?: string[];
|
|
127
232
|
/**
|
|
128
|
-
* An object describing custom options for Serverless Functions.
|
|
233
|
+
* An object describing custom options for your Serverless Functions. Each key must be glob pattern that matches the paths of the Serverless Functions you would like to customize (like `api/*.js` or `api/test.js`).
|
|
129
234
|
*/
|
|
130
235
|
functions?: Record<string, FunctionConfig>;
|
|
131
|
-
/**
|
|
132
|
-
* Git-related configuration.
|
|
133
|
-
*/
|
|
134
236
|
git?: GitConfig;
|
|
135
237
|
/**
|
|
136
|
-
*
|
|
238
|
+
* @private
|
|
137
239
|
*/
|
|
138
240
|
github?: GithubConfig;
|
|
139
241
|
/**
|
|
140
|
-
*
|
|
141
|
-
* Can use router.header() and router.cacheControl() helpers.
|
|
242
|
+
* A list of header definitions.
|
|
142
243
|
*/
|
|
143
244
|
headers?: RouteType[];
|
|
245
|
+
images?: ImageConfig;
|
|
246
|
+
/**
|
|
247
|
+
* A name for the deployment
|
|
248
|
+
*/
|
|
249
|
+
name?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Whether a deployment's source and logs are available publicly
|
|
252
|
+
*/
|
|
253
|
+
public?: boolean;
|
|
144
254
|
/**
|
|
145
|
-
*
|
|
146
|
-
* Can use router.redirect() helper.
|
|
255
|
+
* A list of redirect definitions.
|
|
147
256
|
*/
|
|
148
257
|
redirects?: RouteType[];
|
|
149
258
|
/**
|
|
150
|
-
*
|
|
151
|
-
|
|
259
|
+
* The path to a file containing bulk redirects; supports JSON, JSONL, and CSV
|
|
260
|
+
*/
|
|
261
|
+
bulkRedirectsPath?: string | null;
|
|
262
|
+
/**
|
|
263
|
+
* An array of the regions the deployment's Serverless Functions should be deployed to
|
|
264
|
+
*/
|
|
265
|
+
regions?: string[];
|
|
266
|
+
/**
|
|
267
|
+
* A list of rewrite definitions.
|
|
152
268
|
*/
|
|
153
269
|
rewrites?: RouteType[];
|
|
154
270
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* Cannot be mixed with headers, redirects, or rewrites.
|
|
271
|
+
* A list of routes objects used to rewrite paths to point towards other internal or external paths
|
|
272
|
+
* @deprecated
|
|
158
273
|
*/
|
|
159
274
|
routes?: RouteType[];
|
|
160
275
|
/**
|
|
161
|
-
*
|
|
276
|
+
* This property determines the scope (user or team) under which the project will be deployed by Vercel CLI.
|
|
277
|
+
* @private
|
|
162
278
|
*/
|
|
163
|
-
|
|
279
|
+
scope?: string;
|
|
164
280
|
/**
|
|
165
|
-
*
|
|
281
|
+
* When `false`, visiting a path that ends with a forward slash will respond with a `308` status code and redirect to the path without the trailing slash.
|
|
166
282
|
*/
|
|
167
|
-
|
|
283
|
+
trailingSlash?: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* @private
|
|
286
|
+
*/
|
|
287
|
+
version?: number;
|
|
168
288
|
/**
|
|
169
|
-
*
|
|
289
|
+
* @private
|
|
170
290
|
*/
|
|
291
|
+
wildcard?: WildcardDomain[];
|
|
292
|
+
/**
|
|
293
|
+
* The build command for this project. When `null` is used this value will be automatically detected
|
|
294
|
+
*/
|
|
295
|
+
buildCommand?: string | null;
|
|
171
296
|
ignoreCommand?: string | null;
|
|
172
297
|
/**
|
|
173
|
-
* The dev command for this project. When `null
|
|
298
|
+
* The dev command for this project. When `null` is used this value will be automatically detected
|
|
174
299
|
*/
|
|
175
300
|
devCommand?: string | null;
|
|
176
301
|
/**
|
|
177
|
-
* The framework being used. When `null
|
|
302
|
+
* The framework that is being used for this project. When `null` is used no framework is selected
|
|
178
303
|
*/
|
|
179
304
|
framework?: Framework;
|
|
180
305
|
/**
|
|
181
|
-
* The install command for this project. When `null
|
|
306
|
+
* The install command for this project. When `null` is used this value will be automatically detected
|
|
182
307
|
*/
|
|
183
308
|
installCommand?: string | null;
|
|
184
309
|
/**
|
|
185
|
-
* The output directory of the project. When `null
|
|
310
|
+
* The output directory of the project. When `null` is used this value will be automatically detected
|
|
186
311
|
*/
|
|
187
312
|
outputDirectory?: string | null;
|
|
188
313
|
/**
|
|
189
|
-
*
|
|
314
|
+
* An array of cron jobs that should be created for production Deployments.
|
|
190
315
|
*/
|
|
191
|
-
|
|
316
|
+
crons?: CronJob[];
|
|
192
317
|
/**
|
|
193
318
|
* An array of projectIds to associate with the current project.
|
|
194
319
|
*/
|
|
195
320
|
relatedProjects?: string[];
|
|
196
321
|
/**
|
|
197
|
-
* Enables Fluid compute for the project.
|
|
322
|
+
* Enables Fluid compute for the project. It's enabled by default for new projects.
|
|
198
323
|
*/
|
|
199
324
|
fluid?: boolean;
|
|
200
325
|
/**
|
|
201
326
|
* Enables Bun for the project and specifies the version to use.
|
|
202
327
|
*/
|
|
203
328
|
bunVersion?: string;
|
|
204
|
-
/**
|
|
205
|
-
* Node.js version for this project.
|
|
206
|
-
*/
|
|
207
|
-
nodeVersion?: string;
|
|
208
329
|
}
|
|
209
330
|
/**
|
|
210
331
|
* Runtime placeholder for VercelConfig to allow named imports.
|
package/dist/v1/index.d.ts
CHANGED
package/dist/v1/index.js
CHANGED
|
@@ -14,9 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.validateStaticFields = exports.validateStaticStringArray = exports.validateStaticObject = exports.validateStaticBoolean = exports.validateStaticString = exports.VercelConfig = exports.Router = exports.
|
|
17
|
+
exports.validateStaticFields = exports.validateStaticStringArray = exports.validateStaticObject = exports.validateStaticBoolean = exports.validateStaticString = exports.VercelConfig = exports.Router = exports.routes = exports.createRoutes = void 0;
|
|
18
18
|
var router_1 = require("../router");
|
|
19
|
-
Object.defineProperty(exports, "
|
|
19
|
+
Object.defineProperty(exports, "createRoutes", { enumerable: true, get: function () { return router_1.createRoutes; } });
|
|
20
|
+
Object.defineProperty(exports, "routes", { enumerable: true, get: function () { return router_1.routes; } });
|
|
20
21
|
Object.defineProperty(exports, "Router", { enumerable: true, get: function () { return router_1.Router; } });
|
|
21
22
|
__exportStar(require("../router"), exports);
|
|
22
23
|
var types_1 = require("../types");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "A TypeScript SDK for programmatically configuring Vercel projects",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/vercel/config/issues"
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@typescript-eslint/parser": "^5.0.0",
|
|
41
41
|
"eslint": "^8.0.0",
|
|
42
42
|
"prettier": "^2.8.0",
|
|
43
|
+
"tsx": "^4.7.0",
|
|
43
44
|
"typescript": "^4.9.0",
|
|
44
45
|
"vitest": "^1.0.0"
|
|
45
46
|
},
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"scripts": {
|
|
50
51
|
"build": "tsc",
|
|
51
52
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
53
|
+
"generate-types": "tsx scripts/generate-types.ts",
|
|
52
54
|
"lint": "eslint . --ext .ts",
|
|
53
55
|
"release": "npm run build && changeset publish",
|
|
54
56
|
"test": "vitest",
|