@vercel/build-utils 10.6.3 → 10.6.4
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/CHANGELOG.md +6 -0
- package/dist/index.js +47 -145
- package/dist/lambda.d.ts +10 -12
- package/dist/lambda.js +27 -82
- package/dist/schemas.d.ts +13 -58
- package/dist/schemas.js +20 -63
- package/dist/types.d.ts +26 -58
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
@@ -22372,9 +22372,6 @@ async function download(files, basePath, meta) {
|
|
22372
22372
|
}
|
22373
22373
|
|
22374
22374
|
// src/lambda.ts
|
22375
|
-
function isCloudEventQueueTrigger(trigger) {
|
22376
|
-
return trigger.type === "com.vercel.queue.v1";
|
22377
|
-
}
|
22378
22375
|
function getDefaultLambdaArchitecture(architecture) {
|
22379
22376
|
if (architecture) {
|
22380
22377
|
return architecture;
|
@@ -22487,103 +22484,51 @@ var Lambda = class {
|
|
22487
22484
|
`${prefix} is not an object`
|
22488
22485
|
);
|
22489
22486
|
(0, import_assert4.default)(
|
22490
|
-
trigger.
|
22491
|
-
`${prefix}.
|
22487
|
+
trigger.type === "queue/v1beta",
|
22488
|
+
`${prefix}.type must be "queue/v1beta"`
|
22492
22489
|
);
|
22493
22490
|
(0, import_assert4.default)(
|
22494
|
-
trigger.
|
22495
|
-
`${prefix}.
|
22491
|
+
typeof trigger.topic === "string",
|
22492
|
+
`${prefix}.topic is required and must be a string`
|
22496
22493
|
);
|
22494
|
+
(0, import_assert4.default)(trigger.topic.length > 0, `${prefix}.topic cannot be empty`);
|
22497
22495
|
(0, import_assert4.default)(
|
22498
|
-
typeof trigger.
|
22499
|
-
`${prefix}.
|
22496
|
+
typeof trigger.consumer === "string",
|
22497
|
+
`${prefix}.consumer is required and must be a string`
|
22500
22498
|
);
|
22501
|
-
(0, import_assert4.default)(
|
22502
|
-
|
22503
|
-
|
22504
|
-
|
22505
|
-
|
22506
|
-
);
|
22507
|
-
const queue = trigger.queue;
|
22508
|
-
const queuePrefix = `${prefix}.queue`;
|
22499
|
+
(0, import_assert4.default)(
|
22500
|
+
trigger.consumer.length > 0,
|
22501
|
+
`${prefix}.consumer cannot be empty`
|
22502
|
+
);
|
22503
|
+
if (trigger.maxAttempts !== void 0) {
|
22509
22504
|
(0, import_assert4.default)(
|
22510
|
-
typeof
|
22511
|
-
`${
|
22505
|
+
typeof trigger.maxAttempts === "number",
|
22506
|
+
`${prefix}.maxAttempts must be a number`
|
22512
22507
|
);
|
22513
22508
|
(0, import_assert4.default)(
|
22514
|
-
|
22515
|
-
`${
|
22509
|
+
Number.isInteger(trigger.maxAttempts) && trigger.maxAttempts >= 0,
|
22510
|
+
`${prefix}.maxAttempts must be a non-negative integer`
|
22516
22511
|
);
|
22512
|
+
}
|
22513
|
+
if (trigger.retryAfterSeconds !== void 0) {
|
22517
22514
|
(0, import_assert4.default)(
|
22518
|
-
typeof
|
22519
|
-
`${
|
22515
|
+
typeof trigger.retryAfterSeconds === "number",
|
22516
|
+
`${prefix}.retryAfterSeconds must be a number`
|
22520
22517
|
);
|
22521
22518
|
(0, import_assert4.default)(
|
22522
|
-
|
22523
|
-
`${
|
22519
|
+
trigger.retryAfterSeconds > 0,
|
22520
|
+
`${prefix}.retryAfterSeconds must be a positive number`
|
22524
22521
|
);
|
22525
22522
|
}
|
22526
|
-
|
22527
|
-
const bindingPrefix = `${prefix}.httpBinding`;
|
22528
|
-
(0, import_assert4.default)(
|
22529
|
-
typeof binding === "object" && binding !== null,
|
22530
|
-
`${bindingPrefix} is required and must be an object`
|
22531
|
-
);
|
22532
|
-
(0, import_assert4.default)(
|
22533
|
-
binding.mode === "structured",
|
22534
|
-
`${bindingPrefix}.mode must be "structured"`
|
22535
|
-
);
|
22536
|
-
(0, import_assert4.default)(
|
22537
|
-
binding.method === "POST",
|
22538
|
-
`${bindingPrefix}.method must be "POST"`
|
22539
|
-
);
|
22540
|
-
if (binding.pathname !== void 0) {
|
22523
|
+
if (trigger.initialDelaySeconds !== void 0) {
|
22541
22524
|
(0, import_assert4.default)(
|
22542
|
-
typeof
|
22543
|
-
`${
|
22525
|
+
typeof trigger.initialDelaySeconds === "number",
|
22526
|
+
`${prefix}.initialDelaySeconds must be a number`
|
22544
22527
|
);
|
22545
22528
|
(0, import_assert4.default)(
|
22546
|
-
|
22547
|
-
`${
|
22529
|
+
trigger.initialDelaySeconds >= 0,
|
22530
|
+
`${prefix}.initialDelaySeconds must be a non-negative number`
|
22548
22531
|
);
|
22549
|
-
(0, import_assert4.default)(
|
22550
|
-
binding.pathname.startsWith("/"),
|
22551
|
-
`${bindingPrefix}.pathname must start with '/'`
|
22552
|
-
);
|
22553
|
-
}
|
22554
|
-
if (isCloudEventQueueTrigger(trigger)) {
|
22555
|
-
const queue = trigger.queue;
|
22556
|
-
const queuePrefix = `${prefix}.queue`;
|
22557
|
-
if (queue.maxAttempts !== void 0) {
|
22558
|
-
(0, import_assert4.default)(
|
22559
|
-
typeof queue.maxAttempts === "number",
|
22560
|
-
`${queuePrefix}.maxAttempts must be a number`
|
22561
|
-
);
|
22562
|
-
(0, import_assert4.default)(
|
22563
|
-
Number.isInteger(queue.maxAttempts) && queue.maxAttempts >= 0,
|
22564
|
-
`${queuePrefix}.maxAttempts must be a non-negative integer`
|
22565
|
-
);
|
22566
|
-
}
|
22567
|
-
if (queue.retryAfterSeconds !== void 0) {
|
22568
|
-
(0, import_assert4.default)(
|
22569
|
-
typeof queue.retryAfterSeconds === "number",
|
22570
|
-
`${queuePrefix}.retryAfterSeconds must be a number`
|
22571
|
-
);
|
22572
|
-
(0, import_assert4.default)(
|
22573
|
-
queue.retryAfterSeconds > 0,
|
22574
|
-
`${queuePrefix}.retryAfterSeconds must be a positive number`
|
22575
|
-
);
|
22576
|
-
}
|
22577
|
-
if (queue.initialDelaySeconds !== void 0) {
|
22578
|
-
(0, import_assert4.default)(
|
22579
|
-
typeof queue.initialDelaySeconds === "number",
|
22580
|
-
`${queuePrefix}.initialDelaySeconds must be a number`
|
22581
|
-
);
|
22582
|
-
(0, import_assert4.default)(
|
22583
|
-
queue.initialDelaySeconds >= 0,
|
22584
|
-
`${queuePrefix}.initialDelaySeconds must be a non-negative number`
|
22585
|
-
);
|
22586
|
-
}
|
22587
22532
|
}
|
22588
22533
|
}
|
22589
22534
|
}
|
@@ -24391,79 +24336,36 @@ function hasProp(obj, key) {
|
|
24391
24336
|
}
|
24392
24337
|
|
24393
24338
|
// src/schemas.ts
|
24394
|
-
var
|
24339
|
+
var triggerEventSchema = {
|
24395
24340
|
type: "object",
|
24396
24341
|
properties: {
|
24397
|
-
|
24398
|
-
type: "
|
24399
|
-
const:
|
24342
|
+
type: {
|
24343
|
+
type: "string",
|
24344
|
+
const: "queue/v1beta"
|
24400
24345
|
},
|
24401
|
-
|
24346
|
+
topic: {
|
24402
24347
|
type: "string",
|
24403
|
-
|
24348
|
+
minLength: 1
|
24404
24349
|
},
|
24405
|
-
|
24350
|
+
consumer: {
|
24406
24351
|
type: "string",
|
24407
24352
|
minLength: 1
|
24408
24353
|
},
|
24409
|
-
|
24410
|
-
type: "
|
24411
|
-
|
24412
|
-
mode: {
|
24413
|
-
type: "string",
|
24414
|
-
const: "structured"
|
24415
|
-
},
|
24416
|
-
method: {
|
24417
|
-
type: "string",
|
24418
|
-
const: "POST"
|
24419
|
-
},
|
24420
|
-
pathname: {
|
24421
|
-
type: "string",
|
24422
|
-
minLength: 1,
|
24423
|
-
pattern: "^/"
|
24424
|
-
}
|
24425
|
-
},
|
24426
|
-
required: ["mode", "method"],
|
24427
|
-
additionalProperties: false
|
24354
|
+
maxAttempts: {
|
24355
|
+
type: "number",
|
24356
|
+
minimum: 0
|
24428
24357
|
},
|
24429
|
-
|
24430
|
-
type: "
|
24431
|
-
|
24432
|
-
|
24433
|
-
|
24434
|
-
|
24435
|
-
|
24436
|
-
consumer: {
|
24437
|
-
type: "string",
|
24438
|
-
minLength: 1
|
24439
|
-
},
|
24440
|
-
maxAttempts: {
|
24441
|
-
type: "number",
|
24442
|
-
minimum: 0
|
24443
|
-
},
|
24444
|
-
retryAfterSeconds: {
|
24445
|
-
type: "number",
|
24446
|
-
exclusiveMinimum: 0
|
24447
|
-
},
|
24448
|
-
initialDelaySeconds: {
|
24449
|
-
type: "number",
|
24450
|
-
minimum: 0
|
24451
|
-
}
|
24452
|
-
},
|
24453
|
-
required: ["topic", "consumer"],
|
24454
|
-
additionalProperties: false
|
24455
|
-
}
|
24456
|
-
},
|
24457
|
-
required: ["triggerVersion", "specversion", "type", "httpBinding"],
|
24458
|
-
additionalProperties: false,
|
24459
|
-
if: {
|
24460
|
-
properties: {
|
24461
|
-
type: { const: "com.vercel.queue.v1" }
|
24358
|
+
retryAfterSeconds: {
|
24359
|
+
type: "number",
|
24360
|
+
exclusiveMinimum: 0
|
24361
|
+
},
|
24362
|
+
initialDelaySeconds: {
|
24363
|
+
type: "number",
|
24364
|
+
minimum: 0
|
24462
24365
|
}
|
24463
24366
|
},
|
24464
|
-
|
24465
|
-
|
24466
|
-
}
|
24367
|
+
required: ["type", "topic", "consumer"],
|
24368
|
+
additionalProperties: false
|
24467
24369
|
};
|
24468
24370
|
var functionsSchema = {
|
24469
24371
|
type: "object",
|
@@ -24502,7 +24404,7 @@ var functionsSchema = {
|
|
24502
24404
|
},
|
24503
24405
|
experimentalTriggers: {
|
24504
24406
|
type: "array",
|
24505
|
-
items:
|
24407
|
+
items: triggerEventSchema
|
24506
24408
|
}
|
24507
24409
|
}
|
24508
24410
|
}
|
package/dist/lambda.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import type { Config, Env, Files, FunctionFramework,
|
3
|
-
export type {
|
2
|
+
import type { Config, Env, Files, FunctionFramework, TriggerEvent } from './types';
|
3
|
+
export type { TriggerEvent };
|
4
4
|
export type LambdaOptions = LambdaOptionsWithFiles | LambdaOptionsWithZipBuffer;
|
5
5
|
export type LambdaArchitecture = 'x86_64' | 'arm64';
|
6
6
|
export interface LambdaOptionsBase {
|
@@ -22,10 +22,9 @@ export interface LambdaOptionsBase {
|
|
22
22
|
operationType?: string;
|
23
23
|
framework?: FunctionFramework;
|
24
24
|
/**
|
25
|
-
* Experimental
|
26
|
-
* Defines what types of
|
27
|
-
* Currently supports
|
28
|
-
* Only supports CloudEvents specification version 1.0.
|
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.
|
29
28
|
*
|
30
29
|
* The delivery configuration provides HINTS to the system about preferred
|
31
30
|
* execution behavior (concurrency, retries) but these are NOT guarantees.
|
@@ -36,7 +35,7 @@ export interface LambdaOptionsBase {
|
|
36
35
|
*
|
37
36
|
* @experimental This feature is experimental and may change.
|
38
37
|
*/
|
39
|
-
experimentalTriggers?:
|
38
|
+
experimentalTriggers?: TriggerEvent[];
|
40
39
|
}
|
41
40
|
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
|
42
41
|
files: Files;
|
@@ -82,10 +81,9 @@ export declare class Lambda {
|
|
82
81
|
framework?: FunctionFramework;
|
83
82
|
experimentalAllowBundling?: boolean;
|
84
83
|
/**
|
85
|
-
* Experimental
|
86
|
-
* Defines what types of
|
87
|
-
* Currently supports
|
88
|
-
* Only supports CloudEvents specification version 1.0.
|
84
|
+
* Experimental trigger event definitions that this Lambda can receive.
|
85
|
+
* Defines what types of trigger events this Lambda can handle as an HTTP endpoint.
|
86
|
+
* Currently supports queue triggers for Vercel's queue system.
|
89
87
|
*
|
90
88
|
* The delivery configuration provides HINTS to the system about preferred
|
91
89
|
* execution behavior (concurrency, retries) but these are NOT guarantees.
|
@@ -96,7 +94,7 @@ export declare class Lambda {
|
|
96
94
|
*
|
97
95
|
* @experimental This feature is experimental and may change.
|
98
96
|
*/
|
99
|
-
experimentalTriggers?:
|
97
|
+
experimentalTriggers?: TriggerEvent[];
|
100
98
|
constructor(opts: LambdaOptions);
|
101
99
|
createZip(): Promise<Buffer>;
|
102
100
|
/**
|
package/dist/lambda.js
CHANGED
@@ -41,9 +41,6 @@ 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 isCloudEventQueueTrigger(trigger) {
|
45
|
-
return trigger.type === "com.vercel.queue.v1";
|
46
|
-
}
|
47
44
|
function getDefaultLambdaArchitecture(architecture) {
|
48
45
|
if (architecture) {
|
49
46
|
return architecture;
|
@@ -156,103 +153,51 @@ class Lambda {
|
|
156
153
|
`${prefix} is not an object`
|
157
154
|
);
|
158
155
|
(0, import_assert.default)(
|
159
|
-
trigger.
|
160
|
-
`${prefix}.
|
156
|
+
trigger.type === "queue/v1beta",
|
157
|
+
`${prefix}.type must be "queue/v1beta"`
|
161
158
|
);
|
162
159
|
(0, import_assert.default)(
|
163
|
-
trigger.
|
164
|
-
`${prefix}.
|
160
|
+
typeof trigger.topic === "string",
|
161
|
+
`${prefix}.topic is required and must be a string`
|
165
162
|
);
|
163
|
+
(0, import_assert.default)(trigger.topic.length > 0, `${prefix}.topic cannot be empty`);
|
166
164
|
(0, import_assert.default)(
|
167
|
-
typeof trigger.
|
168
|
-
`${prefix}.
|
165
|
+
typeof trigger.consumer === "string",
|
166
|
+
`${prefix}.consumer is required and must be a string`
|
169
167
|
);
|
170
|
-
(0, import_assert.default)(
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
);
|
176
|
-
const queue = trigger.queue;
|
177
|
-
const queuePrefix = `${prefix}.queue`;
|
168
|
+
(0, import_assert.default)(
|
169
|
+
trigger.consumer.length > 0,
|
170
|
+
`${prefix}.consumer cannot be empty`
|
171
|
+
);
|
172
|
+
if (trigger.maxAttempts !== void 0) {
|
178
173
|
(0, import_assert.default)(
|
179
|
-
typeof
|
180
|
-
`${
|
174
|
+
typeof trigger.maxAttempts === "number",
|
175
|
+
`${prefix}.maxAttempts must be a number`
|
181
176
|
);
|
182
177
|
(0, import_assert.default)(
|
183
|
-
|
184
|
-
`${
|
178
|
+
Number.isInteger(trigger.maxAttempts) && trigger.maxAttempts >= 0,
|
179
|
+
`${prefix}.maxAttempts must be a non-negative integer`
|
185
180
|
);
|
181
|
+
}
|
182
|
+
if (trigger.retryAfterSeconds !== void 0) {
|
186
183
|
(0, import_assert.default)(
|
187
|
-
typeof
|
188
|
-
`${
|
184
|
+
typeof trigger.retryAfterSeconds === "number",
|
185
|
+
`${prefix}.retryAfterSeconds must be a number`
|
189
186
|
);
|
190
187
|
(0, import_assert.default)(
|
191
|
-
|
192
|
-
`${
|
188
|
+
trigger.retryAfterSeconds > 0,
|
189
|
+
`${prefix}.retryAfterSeconds must be a positive number`
|
193
190
|
);
|
194
191
|
}
|
195
|
-
|
196
|
-
const bindingPrefix = `${prefix}.httpBinding`;
|
197
|
-
(0, import_assert.default)(
|
198
|
-
typeof binding === "object" && binding !== null,
|
199
|
-
`${bindingPrefix} is required and must be an object`
|
200
|
-
);
|
201
|
-
(0, import_assert.default)(
|
202
|
-
binding.mode === "structured",
|
203
|
-
`${bindingPrefix}.mode must be "structured"`
|
204
|
-
);
|
205
|
-
(0, import_assert.default)(
|
206
|
-
binding.method === "POST",
|
207
|
-
`${bindingPrefix}.method must be "POST"`
|
208
|
-
);
|
209
|
-
if (binding.pathname !== void 0) {
|
192
|
+
if (trigger.initialDelaySeconds !== void 0) {
|
210
193
|
(0, import_assert.default)(
|
211
|
-
typeof
|
212
|
-
`${
|
194
|
+
typeof trigger.initialDelaySeconds === "number",
|
195
|
+
`${prefix}.initialDelaySeconds must be a number`
|
213
196
|
);
|
214
197
|
(0, import_assert.default)(
|
215
|
-
|
216
|
-
`${
|
198
|
+
trigger.initialDelaySeconds >= 0,
|
199
|
+
`${prefix}.initialDelaySeconds must be a non-negative number`
|
217
200
|
);
|
218
|
-
(0, import_assert.default)(
|
219
|
-
binding.pathname.startsWith("/"),
|
220
|
-
`${bindingPrefix}.pathname must start with '/'`
|
221
|
-
);
|
222
|
-
}
|
223
|
-
if (isCloudEventQueueTrigger(trigger)) {
|
224
|
-
const queue = trigger.queue;
|
225
|
-
const queuePrefix = `${prefix}.queue`;
|
226
|
-
if (queue.maxAttempts !== void 0) {
|
227
|
-
(0, import_assert.default)(
|
228
|
-
typeof queue.maxAttempts === "number",
|
229
|
-
`${queuePrefix}.maxAttempts must be a number`
|
230
|
-
);
|
231
|
-
(0, import_assert.default)(
|
232
|
-
Number.isInteger(queue.maxAttempts) && queue.maxAttempts >= 0,
|
233
|
-
`${queuePrefix}.maxAttempts must be a non-negative integer`
|
234
|
-
);
|
235
|
-
}
|
236
|
-
if (queue.retryAfterSeconds !== void 0) {
|
237
|
-
(0, import_assert.default)(
|
238
|
-
typeof queue.retryAfterSeconds === "number",
|
239
|
-
`${queuePrefix}.retryAfterSeconds must be a number`
|
240
|
-
);
|
241
|
-
(0, import_assert.default)(
|
242
|
-
queue.retryAfterSeconds > 0,
|
243
|
-
`${queuePrefix}.retryAfterSeconds must be a positive number`
|
244
|
-
);
|
245
|
-
}
|
246
|
-
if (queue.initialDelaySeconds !== void 0) {
|
247
|
-
(0, import_assert.default)(
|
248
|
-
typeof queue.initialDelaySeconds === "number",
|
249
|
-
`${queuePrefix}.initialDelaySeconds must be a number`
|
250
|
-
);
|
251
|
-
(0, import_assert.default)(
|
252
|
-
queue.initialDelaySeconds >= 0,
|
253
|
-
`${queuePrefix}.initialDelaySeconds must be a non-negative number`
|
254
|
-
);
|
255
|
-
}
|
256
201
|
}
|
257
202
|
}
|
258
203
|
}
|
package/dist/schemas.d.ts
CHANGED
@@ -38,78 +38,33 @@ export declare const functionsSchema: {
|
|
38
38
|
items: {
|
39
39
|
type: string;
|
40
40
|
properties: {
|
41
|
-
|
41
|
+
type: {
|
42
42
|
type: string;
|
43
|
-
const:
|
43
|
+
const: string;
|
44
44
|
};
|
45
|
-
|
45
|
+
topic: {
|
46
46
|
type: string;
|
47
|
-
|
47
|
+
minLength: number;
|
48
48
|
};
|
49
|
-
|
49
|
+
consumer: {
|
50
50
|
type: string;
|
51
51
|
minLength: number;
|
52
52
|
};
|
53
|
-
|
53
|
+
maxAttempts: {
|
54
54
|
type: string;
|
55
|
-
|
56
|
-
mode: {
|
57
|
-
type: string;
|
58
|
-
const: string;
|
59
|
-
};
|
60
|
-
method: {
|
61
|
-
type: string;
|
62
|
-
const: string;
|
63
|
-
};
|
64
|
-
pathname: {
|
65
|
-
type: string;
|
66
|
-
minLength: number;
|
67
|
-
pattern: string;
|
68
|
-
};
|
69
|
-
};
|
70
|
-
required: string[];
|
71
|
-
additionalProperties: boolean;
|
55
|
+
minimum: number;
|
72
56
|
};
|
73
|
-
|
57
|
+
retryAfterSeconds: {
|
74
58
|
type: string;
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
consumer: {
|
81
|
-
type: string;
|
82
|
-
minLength: number;
|
83
|
-
};
|
84
|
-
maxAttempts: {
|
85
|
-
type: string;
|
86
|
-
minimum: number;
|
87
|
-
};
|
88
|
-
retryAfterSeconds: {
|
89
|
-
type: string;
|
90
|
-
exclusiveMinimum: number;
|
91
|
-
};
|
92
|
-
initialDelaySeconds: {
|
93
|
-
type: string;
|
94
|
-
minimum: number;
|
95
|
-
};
|
96
|
-
};
|
97
|
-
required: string[];
|
98
|
-
additionalProperties: boolean;
|
59
|
+
exclusiveMinimum: number;
|
60
|
+
};
|
61
|
+
initialDelaySeconds: {
|
62
|
+
type: string;
|
63
|
+
minimum: number;
|
99
64
|
};
|
100
65
|
};
|
101
66
|
required: string[];
|
102
67
|
additionalProperties: boolean;
|
103
|
-
if: {
|
104
|
-
properties: {
|
105
|
-
type: {
|
106
|
-
const: string;
|
107
|
-
};
|
108
|
-
};
|
109
|
-
};
|
110
|
-
then: {
|
111
|
-
required: string[];
|
112
|
-
};
|
113
68
|
};
|
114
69
|
};
|
115
70
|
};
|
package/dist/schemas.js
CHANGED
@@ -22,79 +22,36 @@ __export(schemas_exports, {
|
|
22
22
|
functionsSchema: () => functionsSchema
|
23
23
|
});
|
24
24
|
module.exports = __toCommonJS(schemas_exports);
|
25
|
-
const
|
25
|
+
const triggerEventSchema = {
|
26
26
|
type: "object",
|
27
27
|
properties: {
|
28
|
-
|
29
|
-
type: "
|
30
|
-
const:
|
28
|
+
type: {
|
29
|
+
type: "string",
|
30
|
+
const: "queue/v1beta"
|
31
31
|
},
|
32
|
-
|
32
|
+
topic: {
|
33
33
|
type: "string",
|
34
|
-
|
34
|
+
minLength: 1
|
35
35
|
},
|
36
|
-
|
36
|
+
consumer: {
|
37
37
|
type: "string",
|
38
38
|
minLength: 1
|
39
39
|
},
|
40
|
-
|
41
|
-
type: "
|
42
|
-
|
43
|
-
mode: {
|
44
|
-
type: "string",
|
45
|
-
const: "structured"
|
46
|
-
},
|
47
|
-
method: {
|
48
|
-
type: "string",
|
49
|
-
const: "POST"
|
50
|
-
},
|
51
|
-
pathname: {
|
52
|
-
type: "string",
|
53
|
-
minLength: 1,
|
54
|
-
pattern: "^/"
|
55
|
-
}
|
56
|
-
},
|
57
|
-
required: ["mode", "method"],
|
58
|
-
additionalProperties: false
|
40
|
+
maxAttempts: {
|
41
|
+
type: "number",
|
42
|
+
minimum: 0
|
59
43
|
},
|
60
|
-
|
61
|
-
type: "
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
consumer: {
|
68
|
-
type: "string",
|
69
|
-
minLength: 1
|
70
|
-
},
|
71
|
-
maxAttempts: {
|
72
|
-
type: "number",
|
73
|
-
minimum: 0
|
74
|
-
},
|
75
|
-
retryAfterSeconds: {
|
76
|
-
type: "number",
|
77
|
-
exclusiveMinimum: 0
|
78
|
-
},
|
79
|
-
initialDelaySeconds: {
|
80
|
-
type: "number",
|
81
|
-
minimum: 0
|
82
|
-
}
|
83
|
-
},
|
84
|
-
required: ["topic", "consumer"],
|
85
|
-
additionalProperties: false
|
86
|
-
}
|
87
|
-
},
|
88
|
-
required: ["triggerVersion", "specversion", "type", "httpBinding"],
|
89
|
-
additionalProperties: false,
|
90
|
-
if: {
|
91
|
-
properties: {
|
92
|
-
type: { const: "com.vercel.queue.v1" }
|
44
|
+
retryAfterSeconds: {
|
45
|
+
type: "number",
|
46
|
+
exclusiveMinimum: 0
|
47
|
+
},
|
48
|
+
initialDelaySeconds: {
|
49
|
+
type: "number",
|
50
|
+
minimum: 0
|
93
51
|
}
|
94
52
|
},
|
95
|
-
|
96
|
-
|
97
|
-
}
|
53
|
+
required: ["type", "topic", "consumer"],
|
54
|
+
additionalProperties: false
|
98
55
|
};
|
99
56
|
const functionsSchema = {
|
100
57
|
type: "object",
|
@@ -133,7 +90,7 @@ const functionsSchema = {
|
|
133
90
|
},
|
134
91
|
experimentalTriggers: {
|
135
92
|
type: "array",
|
136
|
-
items:
|
93
|
+
items: triggerEventSchema
|
137
94
|
}
|
138
95
|
}
|
139
96
|
}
|
package/dist/types.d.ts
CHANGED
@@ -322,7 +322,7 @@ export interface BuilderFunctions {
|
|
322
322
|
runtime?: string;
|
323
323
|
includeFiles?: string;
|
324
324
|
excludeFiles?: string;
|
325
|
-
experimentalTriggers?:
|
325
|
+
experimentalTriggers?: TriggerEvent[];
|
326
326
|
};
|
327
327
|
}
|
328
328
|
export interface ProjectSettings {
|
@@ -498,62 +498,30 @@ export interface Chain {
|
|
498
498
|
headers: Record<string, string>;
|
499
499
|
}
|
500
500
|
/**
|
501
|
-
*
|
502
|
-
*
|
503
|
-
*
|
504
|
-
* @see https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md
|
505
|
-
* @see https://github.com/cloudevents/spec/blob/main/cloudevents/bindings/http-protocol-binding.md
|
506
|
-
* @see https://github.com/cloudevents/spec/blob/main/subscriptions/spec.md
|
501
|
+
* Queue trigger event for Vercel's queue system.
|
502
|
+
* Handles "queue/v1beta" events with queue-specific configuration.
|
507
503
|
*/
|
508
|
-
export interface
|
509
|
-
/**
|
510
|
-
|
511
|
-
/**
|
512
|
-
|
513
|
-
/**
|
514
|
-
|
515
|
-
/**
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
/**
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
* Queue configuration for this trigger (REQUIRED)
|
532
|
-
*/
|
533
|
-
queue: {
|
534
|
-
/** Name of the queue topic to consume from (REQUIRED) */
|
535
|
-
topic: string;
|
536
|
-
/** Name of the consumer group for this trigger (REQUIRED) */
|
537
|
-
consumer: string;
|
538
|
-
/**
|
539
|
-
* Maximum number of retry attempts for failed executions (OPTIONAL)
|
540
|
-
* Behavior when not specified depends on the server's default configuration.
|
541
|
-
*/
|
542
|
-
maxAttempts?: number;
|
543
|
-
/**
|
544
|
-
* Delay in seconds before retrying failed executions (OPTIONAL)
|
545
|
-
* Behavior when not specified depends on the server's default configuration.
|
546
|
-
*/
|
547
|
-
retryAfterSeconds?: number;
|
548
|
-
/**
|
549
|
-
* Initial delay in seconds before first execution attempt (OPTIONAL)
|
550
|
-
* Must be 0 or greater. Use 0 for no initial delay.
|
551
|
-
* Behavior when not specified depends on the server's default configuration.
|
552
|
-
*/
|
553
|
-
initialDelaySeconds?: number;
|
554
|
-
};
|
504
|
+
export interface TriggerEvent {
|
505
|
+
/** Event type - must be "queue/v1beta" (REQUIRED) */
|
506
|
+
type: 'queue/v1beta';
|
507
|
+
/** Name of the queue topic to consume from (REQUIRED) */
|
508
|
+
topic: string;
|
509
|
+
/** Name of the consumer group for this trigger (REQUIRED) */
|
510
|
+
consumer: string;
|
511
|
+
/**
|
512
|
+
* Maximum number of retry attempts for failed executions (OPTIONAL)
|
513
|
+
* Behavior when not specified depends on the server's default configuration.
|
514
|
+
*/
|
515
|
+
maxAttempts?: number;
|
516
|
+
/**
|
517
|
+
* Delay in seconds before retrying failed executions (OPTIONAL)
|
518
|
+
* Behavior when not specified depends on the server's default configuration.
|
519
|
+
*/
|
520
|
+
retryAfterSeconds?: number;
|
521
|
+
/**
|
522
|
+
* Initial delay in seconds before first execution attempt (OPTIONAL)
|
523
|
+
* Must be 0 or greater. Use 0 for no initial delay.
|
524
|
+
* Behavior when not specified depends on the server's default configuration.
|
525
|
+
*/
|
526
|
+
initialDelaySeconds?: number;
|
555
527
|
}
|
556
|
-
/**
|
557
|
-
* Union type of all supported CloudEvent trigger types.
|
558
|
-
*/
|
559
|
-
export type CloudEventTrigger = CloudEventTriggerBase | CloudEventQueueTrigger;
|