vercel-cli 41.1.0__py3-none-any.whl → 46.1.1__py3-none-any.whl
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.
Potentially problematic release.
This version of vercel-cli might be problematic. Click here for more details.
- vercel_cli/vendor/README.md +1 -1
- vercel_cli/vendor/dist/index.js +72501 -59234
- vercel_cli/vendor/node_modules/.package-lock.json +12 -6
- vercel_cli/vendor/node_modules/@vercel/build-utils/CHANGELOG.md +168 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.js +7 -1
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.d.ts +11 -12
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.js +220 -87
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-prefixed-env-vars.js +4 -1
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/index.js +393 -155
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.d.ts +44 -4
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.js +91 -3
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.d.ts +12 -1
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.js +3 -2
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.d.ts +41 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.js +43 -1
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/types.d.ts +41 -10
- vercel_cli/vendor/node_modules/@vercel/build-utils/package.json +3 -2
- vercel_cli/vendor/node_modules/@vercel/detect-agent/LICENSE +202 -0
- vercel_cli/vendor/node_modules/@vercel/detect-agent/dist/index.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/detect-agent/dist/index.js +66 -0
- vercel_cli/vendor/node_modules/@vercel/detect-agent/package.json +31 -0
- vercel_cli/vendor/node_modules/@vercel/python/dist/index.js +29 -37
- vercel_cli/vendor/node_modules/@vercel/python/package.json +2 -2
- vercel_cli/vendor/node_modules/@vercel/python/vc_init.py +8 -7
- vercel_cli/vendor/package.json +4 -3
- {vercel_cli-41.1.0.dist-info → vercel_cli-46.1.1.dist-info}/METADATA +1 -1
- {vercel_cli-41.1.0.dist-info → vercel_cli-46.1.1.dist-info}/RECORD +30 -26
- {vercel_cli-41.1.0.dist-info → vercel_cli-46.1.1.dist-info}/WHEEL +0 -0
- {vercel_cli-41.1.0.dist-info → vercel_cli-46.1.1.dist-info}/entry_points.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type { Config, Env, Files, FunctionFramework } from './types';
|
|
2
|
+
import type { Config, Env, Files, FunctionFramework, TriggerEvent } from './types';
|
|
3
|
+
export type { TriggerEvent };
|
|
3
4
|
export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
|
|
4
5
|
export type LambdaArchitecture = 'x86_64' | 'arm64';
|
|
5
6
|
export interface LambdaOptionsBase {
|
|
@@ -20,6 +21,26 @@ export interface LambdaOptionsBase {
|
|
|
20
21
|
experimentalResponseStreaming?: boolean;
|
|
21
22
|
operationType?: string;
|
|
22
23
|
framework?: FunctionFramework;
|
|
24
|
+
/**
|
|
25
|
+
* Experimental trigger event definitions that this Lambda can receive.
|
|
26
|
+
* Defines what types of trigger events this Lambda can handle as an HTTP endpoint.
|
|
27
|
+
* Currently supports queue triggers for Vercel's queue system.
|
|
28
|
+
*
|
|
29
|
+
* The delivery configuration provides HINTS to the system about preferred
|
|
30
|
+
* execution behavior (concurrency, retries) but these are NOT guarantees.
|
|
31
|
+
* The system may disregard these hints based on resource constraints.
|
|
32
|
+
*
|
|
33
|
+
* IMPORTANT: HTTP request-response semantics remain synchronous regardless
|
|
34
|
+
* of delivery configuration. Callers receive immediate responses.
|
|
35
|
+
*
|
|
36
|
+
* @experimental This feature is experimental and may change.
|
|
37
|
+
*/
|
|
38
|
+
experimentalTriggers?: TriggerEvent[];
|
|
39
|
+
/**
|
|
40
|
+
* Whether this Lambda supports cancellation.
|
|
41
|
+
* When true, the Lambda runtime can be terminated mid-execution if the request is cancelled.
|
|
42
|
+
*/
|
|
43
|
+
supportsCancellation?: boolean;
|
|
23
44
|
}
|
|
24
45
|
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
|
|
25
46
|
files: Files;
|
|
@@ -49,7 +70,7 @@ export declare class Lambda {
|
|
|
49
70
|
files?: Files;
|
|
50
71
|
handler: string;
|
|
51
72
|
runtime: string;
|
|
52
|
-
architecture
|
|
73
|
+
architecture: LambdaArchitecture;
|
|
53
74
|
memory?: number;
|
|
54
75
|
maxDuration?: number;
|
|
55
76
|
environment: Env;
|
|
@@ -64,6 +85,26 @@ export declare class Lambda {
|
|
|
64
85
|
supportsResponseStreaming?: boolean;
|
|
65
86
|
framework?: FunctionFramework;
|
|
66
87
|
experimentalAllowBundling?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Experimental trigger event definitions that this Lambda can receive.
|
|
90
|
+
* Defines what types of trigger events this Lambda can handle as an HTTP endpoint.
|
|
91
|
+
* Currently supports queue triggers for Vercel's queue system.
|
|
92
|
+
*
|
|
93
|
+
* The delivery configuration provides HINTS to the system about preferred
|
|
94
|
+
* execution behavior (concurrency, retries) but these are NOT guarantees.
|
|
95
|
+
* The system may disregard these hints based on resource constraints.
|
|
96
|
+
*
|
|
97
|
+
* IMPORTANT: HTTP request-response semantics remain synchronous regardless
|
|
98
|
+
* of delivery configuration. Callers receive immediate responses.
|
|
99
|
+
*
|
|
100
|
+
* @experimental This feature is experimental and may change.
|
|
101
|
+
*/
|
|
102
|
+
experimentalTriggers?: TriggerEvent[];
|
|
103
|
+
/**
|
|
104
|
+
* Whether this Lambda supports cancellation.
|
|
105
|
+
* When true, the Lambda runtime can be terminated mid-execution if the request is cancelled.
|
|
106
|
+
*/
|
|
107
|
+
supportsCancellation?: boolean;
|
|
67
108
|
constructor(opts: LambdaOptions);
|
|
68
109
|
createZip(): Promise<Buffer>;
|
|
69
110
|
/**
|
|
@@ -77,5 +118,4 @@ export declare class Lambda {
|
|
|
77
118
|
*/
|
|
78
119
|
export declare function createLambda(opts: LambdaOptions): Promise<Lambda>;
|
|
79
120
|
export declare function createZip(files: Files): Promise<Buffer>;
|
|
80
|
-
export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'memory' | 'maxDuration'>>;
|
|
81
|
-
export {};
|
|
121
|
+
export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'architecture' | 'memory' | 'maxDuration' | 'experimentalTriggers' | 'supportsCancellation'>>;
|
|
@@ -41,6 +41,20 @@ var import_minimatch = __toESM(require("minimatch"));
|
|
|
41
41
|
var import_fs_extra = require("fs-extra");
|
|
42
42
|
var import_download = require("./fs/download");
|
|
43
43
|
var import_stream_to_buffer = __toESM(require("./fs/stream-to-buffer"));
|
|
44
|
+
function getDefaultLambdaArchitecture(architecture) {
|
|
45
|
+
if (architecture) {
|
|
46
|
+
return architecture;
|
|
47
|
+
}
|
|
48
|
+
switch (process.arch) {
|
|
49
|
+
case "arm":
|
|
50
|
+
case "arm64": {
|
|
51
|
+
return "arm64";
|
|
52
|
+
}
|
|
53
|
+
default: {
|
|
54
|
+
return "x86_64";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
44
58
|
class Lambda {
|
|
45
59
|
constructor(opts) {
|
|
46
60
|
const {
|
|
@@ -57,7 +71,9 @@ class Lambda {
|
|
|
57
71
|
supportsResponseStreaming,
|
|
58
72
|
experimentalResponseStreaming,
|
|
59
73
|
operationType,
|
|
60
|
-
framework
|
|
74
|
+
framework,
|
|
75
|
+
experimentalTriggers,
|
|
76
|
+
supportsCancellation
|
|
61
77
|
} = opts;
|
|
62
78
|
if ("files" in opts) {
|
|
63
79
|
(0, import_assert.default)(typeof opts.files === "object", '"files" must be an object');
|
|
@@ -125,12 +141,79 @@ class Lambda {
|
|
|
125
141
|
);
|
|
126
142
|
}
|
|
127
143
|
}
|
|
144
|
+
if (experimentalTriggers !== void 0) {
|
|
145
|
+
(0, import_assert.default)(
|
|
146
|
+
Array.isArray(experimentalTriggers),
|
|
147
|
+
'"experimentalTriggers" is not an Array'
|
|
148
|
+
);
|
|
149
|
+
for (let i = 0; i < experimentalTriggers.length; i++) {
|
|
150
|
+
const trigger = experimentalTriggers[i];
|
|
151
|
+
const prefix = `"experimentalTriggers[${i}]"`;
|
|
152
|
+
(0, import_assert.default)(
|
|
153
|
+
typeof trigger === "object" && trigger !== null,
|
|
154
|
+
`${prefix} is not an object`
|
|
155
|
+
);
|
|
156
|
+
(0, import_assert.default)(
|
|
157
|
+
trigger.type === "queue/v1beta",
|
|
158
|
+
`${prefix}.type must be "queue/v1beta"`
|
|
159
|
+
);
|
|
160
|
+
(0, import_assert.default)(
|
|
161
|
+
typeof trigger.topic === "string",
|
|
162
|
+
`${prefix}.topic is required and must be a string`
|
|
163
|
+
);
|
|
164
|
+
(0, import_assert.default)(trigger.topic.length > 0, `${prefix}.topic cannot be empty`);
|
|
165
|
+
(0, import_assert.default)(
|
|
166
|
+
typeof trigger.consumer === "string",
|
|
167
|
+
`${prefix}.consumer is required and must be a string`
|
|
168
|
+
);
|
|
169
|
+
(0, import_assert.default)(
|
|
170
|
+
trigger.consumer.length > 0,
|
|
171
|
+
`${prefix}.consumer cannot be empty`
|
|
172
|
+
);
|
|
173
|
+
if (trigger.maxDeliveries !== void 0) {
|
|
174
|
+
(0, import_assert.default)(
|
|
175
|
+
typeof trigger.maxDeliveries === "number",
|
|
176
|
+
`${prefix}.maxDeliveries must be a number`
|
|
177
|
+
);
|
|
178
|
+
(0, import_assert.default)(
|
|
179
|
+
Number.isInteger(trigger.maxDeliveries) && trigger.maxDeliveries >= 1,
|
|
180
|
+
`${prefix}.maxDeliveries must be at least 1`
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
if (trigger.retryAfterSeconds !== void 0) {
|
|
184
|
+
(0, import_assert.default)(
|
|
185
|
+
typeof trigger.retryAfterSeconds === "number",
|
|
186
|
+
`${prefix}.retryAfterSeconds must be a number`
|
|
187
|
+
);
|
|
188
|
+
(0, import_assert.default)(
|
|
189
|
+
trigger.retryAfterSeconds > 0,
|
|
190
|
+
`${prefix}.retryAfterSeconds must be a positive number`
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
if (trigger.initialDelaySeconds !== void 0) {
|
|
194
|
+
(0, import_assert.default)(
|
|
195
|
+
typeof trigger.initialDelaySeconds === "number",
|
|
196
|
+
`${prefix}.initialDelaySeconds must be a number`
|
|
197
|
+
);
|
|
198
|
+
(0, import_assert.default)(
|
|
199
|
+
trigger.initialDelaySeconds >= 0,
|
|
200
|
+
`${prefix}.initialDelaySeconds must be a non-negative number`
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (supportsCancellation !== void 0) {
|
|
206
|
+
(0, import_assert.default)(
|
|
207
|
+
typeof supportsCancellation === "boolean",
|
|
208
|
+
'"supportsCancellation" is not a boolean'
|
|
209
|
+
);
|
|
210
|
+
}
|
|
128
211
|
this.type = "Lambda";
|
|
129
212
|
this.operationType = operationType;
|
|
130
213
|
this.files = "files" in opts ? opts.files : void 0;
|
|
131
214
|
this.handler = handler;
|
|
132
215
|
this.runtime = runtime;
|
|
133
|
-
this.architecture = architecture;
|
|
216
|
+
this.architecture = getDefaultLambdaArchitecture(architecture);
|
|
134
217
|
this.memory = memory;
|
|
135
218
|
this.maxDuration = maxDuration;
|
|
136
219
|
this.environment = environment;
|
|
@@ -142,6 +225,8 @@ class Lambda {
|
|
|
142
225
|
this.supportsResponseStreaming = supportsResponseStreaming ?? experimentalResponseStreaming;
|
|
143
226
|
this.framework = framework;
|
|
144
227
|
this.experimentalAllowBundling = "experimentalAllowBundling" in opts ? opts.experimentalAllowBundling : void 0;
|
|
228
|
+
this.experimentalTriggers = experimentalTriggers;
|
|
229
|
+
this.supportsCancellation = supportsCancellation;
|
|
145
230
|
}
|
|
146
231
|
async createZip() {
|
|
147
232
|
let { zipBuffer } = this;
|
|
@@ -214,8 +299,11 @@ async function getLambdaOptionsFromFunction({
|
|
|
214
299
|
for (const [pattern, fn] of Object.entries(config.functions)) {
|
|
215
300
|
if (sourceFile === pattern || (0, import_minimatch.default)(sourceFile, pattern)) {
|
|
216
301
|
return {
|
|
302
|
+
architecture: fn.architecture,
|
|
217
303
|
memory: fn.memory,
|
|
218
|
-
maxDuration: fn.maxDuration
|
|
304
|
+
maxDuration: fn.maxDuration,
|
|
305
|
+
experimentalTriggers: fn.experimentalTriggers,
|
|
306
|
+
supportsCancellation: fn.supportsCancellation
|
|
219
307
|
};
|
|
220
308
|
}
|
|
221
309
|
}
|
|
@@ -2,6 +2,7 @@ import type { File, HasField, Chain } from './types';
|
|
|
2
2
|
import { Lambda } from './lambda';
|
|
3
3
|
interface PrerenderOptions {
|
|
4
4
|
expiration: number | false;
|
|
5
|
+
staleExpiration?: number;
|
|
5
6
|
lambda?: Lambda;
|
|
6
7
|
fallback: File | null;
|
|
7
8
|
group?: number;
|
|
@@ -18,7 +19,17 @@ interface PrerenderOptions {
|
|
|
18
19
|
}
|
|
19
20
|
export declare class Prerender {
|
|
20
21
|
type: 'Prerender';
|
|
22
|
+
/**
|
|
23
|
+
* `expiration` is `revalidate` in Next.js terms, and `s-maxage` in
|
|
24
|
+
* `cache-control` terms.
|
|
25
|
+
*/
|
|
21
26
|
expiration: number | false;
|
|
27
|
+
/**
|
|
28
|
+
* `staleExpiration` is `expire` in Next.js terms, and
|
|
29
|
+
* `stale-while-revalidate` + `s-maxage` in `cache-control` terms. It's
|
|
30
|
+
* expected to be undefined if `expiration` is `false`.
|
|
31
|
+
*/
|
|
32
|
+
staleExpiration?: number;
|
|
22
33
|
lambda?: Lambda;
|
|
23
34
|
fallback: File | null;
|
|
24
35
|
group?: number;
|
|
@@ -32,6 +43,6 @@ export declare class Prerender {
|
|
|
32
43
|
experimentalBypassFor?: HasField;
|
|
33
44
|
experimentalStreamingLambdaPath?: string;
|
|
34
45
|
chain?: Chain;
|
|
35
|
-
constructor({ expiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, }: PrerenderOptions);
|
|
46
|
+
constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, }: PrerenderOptions);
|
|
36
47
|
}
|
|
37
48
|
export {};
|
|
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(prerender_exports);
|
|
|
24
24
|
class Prerender {
|
|
25
25
|
constructor({
|
|
26
26
|
expiration,
|
|
27
|
+
staleExpiration,
|
|
27
28
|
lambda,
|
|
28
29
|
fallback,
|
|
29
30
|
group,
|
|
@@ -40,6 +41,7 @@ class Prerender {
|
|
|
40
41
|
}) {
|
|
41
42
|
this.type = "Prerender";
|
|
42
43
|
this.expiration = expiration;
|
|
44
|
+
this.staleExpiration = staleExpiration;
|
|
43
45
|
this.sourcePath = sourcePath;
|
|
44
46
|
this.lambda = lambda;
|
|
45
47
|
if (this.lambda) {
|
|
@@ -74,8 +76,7 @@ class Prerender {
|
|
|
74
76
|
}
|
|
75
77
|
if (experimentalBypassFor !== void 0) {
|
|
76
78
|
if (!Array.isArray(experimentalBypassFor) || experimentalBypassFor.some(
|
|
77
|
-
(field) => typeof field !== "object" ||
|
|
78
|
-
field.type !== "host" && typeof field.key !== "string" || typeof field.type !== "string" || field.value !== void 0 && typeof field.value !== "string"
|
|
79
|
+
(field) => typeof field !== "object" || typeof field.type !== "string" || field.type === "host" && "key" in field || field.type !== "host" && typeof field.key !== "string" || field.value !== void 0 && typeof field.value !== "string" && (typeof field.value !== "object" || field.value === null || Array.isArray(field.value))
|
|
79
80
|
)) {
|
|
80
81
|
throw new Error(
|
|
81
82
|
"The `experimentalBypassFor` argument for `Prerender` must be Array of objects with fields `type`, `key` and optionally `value`."
|
|
@@ -8,6 +8,10 @@ export declare const functionsSchema: {
|
|
|
8
8
|
type: string;
|
|
9
9
|
additionalProperties: boolean;
|
|
10
10
|
properties: {
|
|
11
|
+
architecture: {
|
|
12
|
+
type: string;
|
|
13
|
+
enum: string[];
|
|
14
|
+
};
|
|
11
15
|
runtime: {
|
|
12
16
|
type: string;
|
|
13
17
|
maxLength: number;
|
|
@@ -29,6 +33,43 @@ export declare const functionsSchema: {
|
|
|
29
33
|
type: string;
|
|
30
34
|
maxLength: number;
|
|
31
35
|
};
|
|
36
|
+
experimentalTriggers: {
|
|
37
|
+
type: string;
|
|
38
|
+
items: {
|
|
39
|
+
type: string;
|
|
40
|
+
properties: {
|
|
41
|
+
type: {
|
|
42
|
+
type: string;
|
|
43
|
+
const: string;
|
|
44
|
+
};
|
|
45
|
+
topic: {
|
|
46
|
+
type: string;
|
|
47
|
+
minLength: number;
|
|
48
|
+
};
|
|
49
|
+
consumer: {
|
|
50
|
+
type: string;
|
|
51
|
+
minLength: number;
|
|
52
|
+
};
|
|
53
|
+
maxDeliveries: {
|
|
54
|
+
type: string;
|
|
55
|
+
minimum: number;
|
|
56
|
+
};
|
|
57
|
+
retryAfterSeconds: {
|
|
58
|
+
type: string;
|
|
59
|
+
exclusiveMinimum: number;
|
|
60
|
+
};
|
|
61
|
+
initialDelaySeconds: {
|
|
62
|
+
type: string;
|
|
63
|
+
minimum: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: string[];
|
|
67
|
+
additionalProperties: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
supportsCancellation: {
|
|
71
|
+
type: string;
|
|
72
|
+
};
|
|
32
73
|
};
|
|
33
74
|
};
|
|
34
75
|
};
|
|
@@ -22,6 +22,37 @@ __export(schemas_exports, {
|
|
|
22
22
|
functionsSchema: () => functionsSchema
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(schemas_exports);
|
|
25
|
+
const triggerEventSchema = {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {
|
|
28
|
+
type: {
|
|
29
|
+
type: "string",
|
|
30
|
+
const: "queue/v1beta"
|
|
31
|
+
},
|
|
32
|
+
topic: {
|
|
33
|
+
type: "string",
|
|
34
|
+
minLength: 1
|
|
35
|
+
},
|
|
36
|
+
consumer: {
|
|
37
|
+
type: "string",
|
|
38
|
+
minLength: 1
|
|
39
|
+
},
|
|
40
|
+
maxDeliveries: {
|
|
41
|
+
type: "number",
|
|
42
|
+
minimum: 1
|
|
43
|
+
},
|
|
44
|
+
retryAfterSeconds: {
|
|
45
|
+
type: "number",
|
|
46
|
+
exclusiveMinimum: 0
|
|
47
|
+
},
|
|
48
|
+
initialDelaySeconds: {
|
|
49
|
+
type: "number",
|
|
50
|
+
minimum: 0
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
required: ["type", "topic", "consumer"],
|
|
54
|
+
additionalProperties: false
|
|
55
|
+
};
|
|
25
56
|
const functionsSchema = {
|
|
26
57
|
type: "object",
|
|
27
58
|
minProperties: 1,
|
|
@@ -32,13 +63,17 @@ const functionsSchema = {
|
|
|
32
63
|
type: "object",
|
|
33
64
|
additionalProperties: false,
|
|
34
65
|
properties: {
|
|
66
|
+
architecture: {
|
|
67
|
+
type: "string",
|
|
68
|
+
enum: ["x86_64", "arm64"]
|
|
69
|
+
},
|
|
35
70
|
runtime: {
|
|
36
71
|
type: "string",
|
|
37
72
|
maxLength: 256
|
|
38
73
|
},
|
|
39
74
|
memory: {
|
|
40
75
|
minimum: 128,
|
|
41
|
-
maximum:
|
|
76
|
+
maximum: 10240
|
|
42
77
|
},
|
|
43
78
|
maxDuration: {
|
|
44
79
|
type: "number",
|
|
@@ -52,6 +87,13 @@ const functionsSchema = {
|
|
|
52
87
|
excludeFiles: {
|
|
53
88
|
type: "string",
|
|
54
89
|
maxLength: 256
|
|
90
|
+
},
|
|
91
|
+
experimentalTriggers: {
|
|
92
|
+
type: "array",
|
|
93
|
+
items: triggerEventSchema
|
|
94
|
+
},
|
|
95
|
+
supportsCancellation: {
|
|
96
|
+
type: "boolean"
|
|
55
97
|
}
|
|
56
98
|
}
|
|
57
99
|
}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import type FileRef from './file-ref';
|
|
3
3
|
import type FileFsRef from './file-fs-ref';
|
|
4
4
|
import type FileBlob from './file-blob';
|
|
5
|
-
import type { Lambda } from './lambda';
|
|
5
|
+
import type { Lambda, LambdaArchitecture } from './lambda';
|
|
6
6
|
import type { Prerender } from './prerender';
|
|
7
7
|
import type { EdgeFunction } from './edge-function';
|
|
8
8
|
import type { Span } from './trace';
|
|
9
|
+
import type { HasField } from '@vercel/routing-utils';
|
|
9
10
|
export interface Env {
|
|
10
11
|
[name: string]: string | undefined;
|
|
11
12
|
}
|
|
@@ -44,14 +45,7 @@ export interface Config {
|
|
|
44
45
|
middleware?: boolean;
|
|
45
46
|
[key: string]: unknown;
|
|
46
47
|
}
|
|
47
|
-
export type HasField
|
|
48
|
-
type: 'host';
|
|
49
|
-
value: string;
|
|
50
|
-
} | {
|
|
51
|
-
type: 'header' | 'cookie' | 'query';
|
|
52
|
-
key: string;
|
|
53
|
-
value?: string;
|
|
54
|
-
}>;
|
|
48
|
+
export type { HasField };
|
|
55
49
|
export interface Meta {
|
|
56
50
|
isDev?: boolean;
|
|
57
51
|
devCacheDir?: string;
|
|
@@ -165,6 +159,10 @@ export interface ShouldServeOptions {
|
|
|
165
159
|
* in `vercel.json`.
|
|
166
160
|
*/
|
|
167
161
|
config: Config;
|
|
162
|
+
/**
|
|
163
|
+
* Whether another builder has already matched the given request.
|
|
164
|
+
*/
|
|
165
|
+
hasMatched?: boolean;
|
|
168
166
|
}
|
|
169
167
|
/**
|
|
170
168
|
* `startDevServer()` is given the same parameters as `build()`.
|
|
@@ -287,6 +285,7 @@ export interface PackageJson {
|
|
|
287
285
|
readonly private?: boolean;
|
|
288
286
|
readonly publishConfig?: PackageJson.PublishConfig;
|
|
289
287
|
readonly packageManager?: string;
|
|
288
|
+
readonly type?: string;
|
|
290
289
|
}
|
|
291
290
|
export interface ConstructorVersion {
|
|
292
291
|
/** major version number: 18 */
|
|
@@ -321,11 +320,14 @@ export interface Builder {
|
|
|
321
320
|
}
|
|
322
321
|
export interface BuilderFunctions {
|
|
323
322
|
[key: string]: {
|
|
323
|
+
architecture?: LambdaArchitecture;
|
|
324
324
|
memory?: number;
|
|
325
325
|
maxDuration?: number;
|
|
326
326
|
runtime?: string;
|
|
327
327
|
includeFiles?: string;
|
|
328
328
|
excludeFiles?: string;
|
|
329
|
+
experimentalTriggers?: TriggerEvent[];
|
|
330
|
+
supportsCancellation?: boolean;
|
|
329
331
|
};
|
|
330
332
|
}
|
|
331
333
|
export interface ProjectSettings {
|
|
@@ -500,4 +502,33 @@ export interface Chain {
|
|
|
500
502
|
*/
|
|
501
503
|
headers: Record<string, string>;
|
|
502
504
|
}
|
|
503
|
-
|
|
505
|
+
/**
|
|
506
|
+
* Queue trigger event for Vercel's queue system.
|
|
507
|
+
* Handles "queue/v1beta" events with queue-specific configuration.
|
|
508
|
+
*/
|
|
509
|
+
export interface TriggerEvent {
|
|
510
|
+
/** Event type - must be "queue/v1beta" (REQUIRED) */
|
|
511
|
+
type: 'queue/v1beta';
|
|
512
|
+
/** Name of the queue topic to consume from (REQUIRED) */
|
|
513
|
+
topic: string;
|
|
514
|
+
/** Name of the consumer group for this trigger (REQUIRED) */
|
|
515
|
+
consumer: string;
|
|
516
|
+
/**
|
|
517
|
+
* Maximum number of delivery attempts for message processing (OPTIONAL)
|
|
518
|
+
* This represents the total number of times a message can be delivered,
|
|
519
|
+
* not the number of retries. Must be at least 1 if specified.
|
|
520
|
+
* Behavior when not specified depends on the server's default configuration.
|
|
521
|
+
*/
|
|
522
|
+
maxDeliveries?: number;
|
|
523
|
+
/**
|
|
524
|
+
* Delay in seconds before retrying failed executions (OPTIONAL)
|
|
525
|
+
* Behavior when not specified depends on the server's default configuration.
|
|
526
|
+
*/
|
|
527
|
+
retryAfterSeconds?: number;
|
|
528
|
+
/**
|
|
529
|
+
* Initial delay in seconds before first execution attempt (OPTIONAL)
|
|
530
|
+
* Must be 0 or greater. Use 0 for no initial delay.
|
|
531
|
+
* Behavior when not specified depends on the server's default configuration.
|
|
532
|
+
*/
|
|
533
|
+
initialDelaySeconds?: number;
|
|
534
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/build-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.js",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@types/semver": "6.0.0",
|
|
28
28
|
"@types/yazl": "2.4.2",
|
|
29
29
|
"@vercel/error-utils": "2.0.3",
|
|
30
|
+
"@vercel/routing-utils": "5.1.1",
|
|
30
31
|
"aggregate-error": "3.0.1",
|
|
31
32
|
"async-retry": "1.2.3",
|
|
32
33
|
"async-sema": "2.1.4",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand",
|
|
55
56
|
"vitest-run": "vitest -c ../../vitest.config.mts",
|
|
56
57
|
"vitest-unit": "glob --absolute 'test/unit.*test.ts'",
|
|
57
|
-
"vitest-e2e": "glob --absolute 'test/integration
|
|
58
|
+
"vitest-e2e": "glob --absolute 'test/integration*.test.ts'",
|
|
58
59
|
"type-check": "tsc --noEmit"
|
|
59
60
|
}
|
|
60
61
|
}
|