vercel 50.19.1 → 50.20.0
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/chunks/{chunk-2MJSFGZS.js → chunk-27NYBHVQ.js} +155 -9
- package/dist/chunks/{chunk-QD2PKTAS.js → chunk-2HEZ6WYK.js} +2 -2
- package/dist/chunks/{chunk-R6RYCTYI.js → chunk-53BB6MSK.js} +1 -1
- package/dist/chunks/{emit-flags-definitions-USGHZMIG.js → chunk-AWCPEMR2.js} +14 -8
- package/dist/chunks/chunk-LLXAOR5J.js +347 -0
- package/dist/chunks/{chunk-REMAC5DL.js → chunk-SMFRBY52.js} +2 -2
- package/dist/chunks/{chunk-WCF4U224.js → chunk-SQOGVZO2.js} +1 -161
- package/dist/chunks/emit-flags-datafiles-LZ4DD37E.js +15 -0
- package/dist/chunks/{query-KVYNNPJM.js → query-MMUKRX4T.js} +2 -2
- package/dist/chunks/{schema-6D2ICSJE.js → schema-3XF2GWU3.js} +2 -2
- package/dist/commands/build/index.js +2 -2
- package/dist/commands/deploy/index.js +4 -4
- package/dist/commands/env/index.js +5 -233
- package/dist/commands/link/index.js +2 -2
- package/dist/commands-bulk.js +393 -59
- package/dist/index.js +3 -3
- package/dist/version.mjs +1 -1
- package/package.json +16 -16
- package/dist/chunks/chunk-YDHESKLS.js +0 -117
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-L3DHDLSP.js";
|
|
10
10
|
import {
|
|
11
11
|
metricsCommand
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2HEZ6WYK.js";
|
|
13
13
|
import {
|
|
14
14
|
listCommand
|
|
15
15
|
} from "./chunk-ZWVBLSNY.js";
|
|
@@ -1671,6 +1671,14 @@ var sdkKeysSubcommand = {
|
|
|
1671
1671
|
options: [],
|
|
1672
1672
|
examples: []
|
|
1673
1673
|
};
|
|
1674
|
+
var prepareSubcommand = {
|
|
1675
|
+
name: "prepare",
|
|
1676
|
+
aliases: [],
|
|
1677
|
+
description: "Prepare flag definition fallbacks for the build",
|
|
1678
|
+
arguments: [],
|
|
1679
|
+
options: [],
|
|
1680
|
+
examples: []
|
|
1681
|
+
};
|
|
1674
1682
|
var flagsCommand = {
|
|
1675
1683
|
name: "flags",
|
|
1676
1684
|
aliases: [],
|
|
@@ -1687,7 +1695,8 @@ var flagsCommand = {
|
|
|
1687
1695
|
archiveSubcommand,
|
|
1688
1696
|
disableSubcommand,
|
|
1689
1697
|
enableSubcommand,
|
|
1690
|
-
sdkKeysSubcommand
|
|
1698
|
+
sdkKeysSubcommand,
|
|
1699
|
+
prepareSubcommand
|
|
1691
1700
|
],
|
|
1692
1701
|
options: [],
|
|
1693
1702
|
examples: []
|
|
@@ -3791,6 +3800,31 @@ var whoamiCommand = {
|
|
|
3791
3800
|
};
|
|
3792
3801
|
|
|
3793
3802
|
// src/commands/blob/command.ts
|
|
3803
|
+
var ifMatchOption = {
|
|
3804
|
+
name: "if-match",
|
|
3805
|
+
shorthand: null,
|
|
3806
|
+
type: String,
|
|
3807
|
+
deprecated: false,
|
|
3808
|
+
description: "Only perform the operation if the blob's ETag matches this value",
|
|
3809
|
+
argument: "STRING"
|
|
3810
|
+
};
|
|
3811
|
+
var ifNoneMatchOption = {
|
|
3812
|
+
name: "if-none-match",
|
|
3813
|
+
shorthand: null,
|
|
3814
|
+
type: String,
|
|
3815
|
+
deprecated: false,
|
|
3816
|
+
description: "Only return content if the blob's ETag does not match this value (returns 304 if unchanged)",
|
|
3817
|
+
argument: "STRING"
|
|
3818
|
+
};
|
|
3819
|
+
var accessOption = {
|
|
3820
|
+
name: "access",
|
|
3821
|
+
shorthand: "a",
|
|
3822
|
+
type: String,
|
|
3823
|
+
deprecated: false,
|
|
3824
|
+
description: "Access level for the blob: public or private (default: public)",
|
|
3825
|
+
argument: "String",
|
|
3826
|
+
choices: ["public", "private"]
|
|
3827
|
+
};
|
|
3794
3828
|
var listSubcommand12 = {
|
|
3795
3829
|
name: "list",
|
|
3796
3830
|
aliases: ["ls"],
|
|
@@ -3844,6 +3878,7 @@ var putSubcommand = {
|
|
|
3844
3878
|
}
|
|
3845
3879
|
],
|
|
3846
3880
|
options: [
|
|
3881
|
+
accessOption,
|
|
3847
3882
|
{
|
|
3848
3883
|
name: "add-random-suffix",
|
|
3849
3884
|
shorthand: "r",
|
|
@@ -3885,13 +3920,22 @@ var putSubcommand = {
|
|
|
3885
3920
|
argument: "Number"
|
|
3886
3921
|
},
|
|
3887
3922
|
{
|
|
3888
|
-
name: "
|
|
3889
|
-
shorthand:
|
|
3923
|
+
name: "allow-overwrite",
|
|
3924
|
+
shorthand: null,
|
|
3890
3925
|
type: Boolean,
|
|
3891
3926
|
deprecated: false,
|
|
3892
3927
|
description: "Overwrite the file if it already exists (default: false)",
|
|
3893
3928
|
argument: "Boolean"
|
|
3894
|
-
}
|
|
3929
|
+
},
|
|
3930
|
+
{
|
|
3931
|
+
name: "force",
|
|
3932
|
+
shorthand: "f",
|
|
3933
|
+
type: Boolean,
|
|
3934
|
+
deprecated: true,
|
|
3935
|
+
description: "Overwrite the file if it already exists (deprecated, use --allow-overwrite)",
|
|
3936
|
+
argument: "Boolean"
|
|
3937
|
+
},
|
|
3938
|
+
ifMatchOption
|
|
3895
3939
|
],
|
|
3896
3940
|
examples: []
|
|
3897
3941
|
};
|
|
@@ -3905,7 +3949,7 @@ var delSubcommand = {
|
|
|
3905
3949
|
required: true
|
|
3906
3950
|
}
|
|
3907
3951
|
],
|
|
3908
|
-
options: [],
|
|
3952
|
+
options: [ifMatchOption],
|
|
3909
3953
|
examples: []
|
|
3910
3954
|
};
|
|
3911
3955
|
var copySubcommand = {
|
|
@@ -3923,6 +3967,7 @@ var copySubcommand = {
|
|
|
3923
3967
|
}
|
|
3924
3968
|
],
|
|
3925
3969
|
options: [
|
|
3970
|
+
accessOption,
|
|
3926
3971
|
{
|
|
3927
3972
|
name: "add-random-suffix",
|
|
3928
3973
|
shorthand: "r",
|
|
@@ -3946,8 +3991,33 @@ var copySubcommand = {
|
|
|
3946
3991
|
deprecated: false,
|
|
3947
3992
|
description: "Max-age of the cache-control header directive (default: 2592000 = 30 days)",
|
|
3948
3993
|
argument: "Number"
|
|
3994
|
+
},
|
|
3995
|
+
ifMatchOption
|
|
3996
|
+
],
|
|
3997
|
+
examples: []
|
|
3998
|
+
};
|
|
3999
|
+
var getSubcommand = {
|
|
4000
|
+
name: "get",
|
|
4001
|
+
aliases: [],
|
|
4002
|
+
description: "Download a blob by URL or pathname",
|
|
4003
|
+
arguments: [
|
|
4004
|
+
{
|
|
4005
|
+
name: "urlOrPathname",
|
|
4006
|
+
required: true
|
|
3949
4007
|
}
|
|
3950
4008
|
],
|
|
4009
|
+
options: [
|
|
4010
|
+
accessOption,
|
|
4011
|
+
{
|
|
4012
|
+
name: "output",
|
|
4013
|
+
shorthand: "o",
|
|
4014
|
+
type: String,
|
|
4015
|
+
deprecated: false,
|
|
4016
|
+
description: "Save blob content to a file instead of stdout",
|
|
4017
|
+
argument: "PATH"
|
|
4018
|
+
},
|
|
4019
|
+
ifNoneMatchOption
|
|
4020
|
+
],
|
|
3951
4021
|
examples: []
|
|
3952
4022
|
};
|
|
3953
4023
|
var addStoreSubcommand = {
|
|
@@ -3961,6 +4031,7 @@ var addStoreSubcommand = {
|
|
|
3961
4031
|
}
|
|
3962
4032
|
],
|
|
3963
4033
|
options: [
|
|
4034
|
+
accessOption,
|
|
3964
4035
|
{
|
|
3965
4036
|
name: "region",
|
|
3966
4037
|
shorthand: "r",
|
|
@@ -3978,6 +4049,10 @@ var addStoreSubcommand = {
|
|
|
3978
4049
|
{
|
|
3979
4050
|
name: "Create a blob store in a specific region",
|
|
3980
4051
|
value: "vercel blob store add my-store --region cdg1"
|
|
4052
|
+
},
|
|
4053
|
+
{
|
|
4054
|
+
name: "Create a private blob store",
|
|
4055
|
+
value: "vercel blob store add my-private-store --access private"
|
|
3981
4056
|
}
|
|
3982
4057
|
]
|
|
3983
4058
|
};
|
|
@@ -4007,6 +4082,68 @@ var getStoreSubcommand = {
|
|
|
4007
4082
|
options: [],
|
|
4008
4083
|
examples: []
|
|
4009
4084
|
};
|
|
4085
|
+
var createStoreSubcommand = {
|
|
4086
|
+
name: "create-store",
|
|
4087
|
+
aliases: [],
|
|
4088
|
+
description: "Create a new Blob store",
|
|
4089
|
+
arguments: [
|
|
4090
|
+
{
|
|
4091
|
+
name: "name",
|
|
4092
|
+
required: false
|
|
4093
|
+
}
|
|
4094
|
+
],
|
|
4095
|
+
options: [
|
|
4096
|
+
accessOption,
|
|
4097
|
+
{
|
|
4098
|
+
name: "region",
|
|
4099
|
+
shorthand: "r",
|
|
4100
|
+
type: String,
|
|
4101
|
+
deprecated: false,
|
|
4102
|
+
description: 'Region to create the Blob store in (default: "iad1"). See https://vercel.com/docs/edge-network/regions#region-list for all available regions',
|
|
4103
|
+
argument: "STRING"
|
|
4104
|
+
}
|
|
4105
|
+
],
|
|
4106
|
+
examples: [
|
|
4107
|
+
{
|
|
4108
|
+
name: 'Create a blob store (uses default region "iad1")',
|
|
4109
|
+
value: "vercel blob create-store my-store"
|
|
4110
|
+
},
|
|
4111
|
+
{
|
|
4112
|
+
name: "Create a blob store in a specific region",
|
|
4113
|
+
value: "vercel blob create-store my-store --region cdg1"
|
|
4114
|
+
},
|
|
4115
|
+
{
|
|
4116
|
+
name: "Create a private blob store",
|
|
4117
|
+
value: "vercel blob create-store my-private-store --access private"
|
|
4118
|
+
}
|
|
4119
|
+
]
|
|
4120
|
+
};
|
|
4121
|
+
var deleteStoreSubcommand = {
|
|
4122
|
+
name: "delete-store",
|
|
4123
|
+
aliases: [],
|
|
4124
|
+
description: "Delete a Blob store",
|
|
4125
|
+
arguments: [
|
|
4126
|
+
{
|
|
4127
|
+
name: "storeId",
|
|
4128
|
+
required: false
|
|
4129
|
+
}
|
|
4130
|
+
],
|
|
4131
|
+
options: [],
|
|
4132
|
+
examples: []
|
|
4133
|
+
};
|
|
4134
|
+
var getStoreInfoSubcommand = {
|
|
4135
|
+
name: "get-store",
|
|
4136
|
+
aliases: [],
|
|
4137
|
+
description: "Get a Blob store",
|
|
4138
|
+
arguments: [
|
|
4139
|
+
{
|
|
4140
|
+
name: "storeId",
|
|
4141
|
+
required: false
|
|
4142
|
+
}
|
|
4143
|
+
],
|
|
4144
|
+
options: [],
|
|
4145
|
+
examples: []
|
|
4146
|
+
};
|
|
4010
4147
|
var storeSubcommand = {
|
|
4011
4148
|
name: "store",
|
|
4012
4149
|
aliases: [],
|
|
@@ -4024,8 +4161,12 @@ var blobCommand = {
|
|
|
4024
4161
|
subcommands: [
|
|
4025
4162
|
listSubcommand12,
|
|
4026
4163
|
putSubcommand,
|
|
4164
|
+
getSubcommand,
|
|
4027
4165
|
delSubcommand,
|
|
4028
4166
|
copySubcommand,
|
|
4167
|
+
createStoreSubcommand,
|
|
4168
|
+
deleteStoreSubcommand,
|
|
4169
|
+
getStoreInfoSubcommand,
|
|
4029
4170
|
storeSubcommand
|
|
4030
4171
|
],
|
|
4031
4172
|
options: [
|
|
@@ -4056,7 +4197,7 @@ var listSubcommand13 = {
|
|
|
4056
4197
|
}
|
|
4057
4198
|
]
|
|
4058
4199
|
};
|
|
4059
|
-
var
|
|
4200
|
+
var getSubcommand2 = {
|
|
4060
4201
|
name: "get",
|
|
4061
4202
|
aliases: ["inspect"],
|
|
4062
4203
|
description: "Displays information related to a webhook",
|
|
@@ -4129,7 +4270,7 @@ var webhooksCommand = {
|
|
|
4129
4270
|
arguments: [],
|
|
4130
4271
|
subcommands: [
|
|
4131
4272
|
listSubcommand13,
|
|
4132
|
-
|
|
4273
|
+
getSubcommand2,
|
|
4133
4274
|
createSubcommand,
|
|
4134
4275
|
removeSubcommand10
|
|
4135
4276
|
],
|
|
@@ -4259,6 +4400,7 @@ export {
|
|
|
4259
4400
|
sdkKeysAddSubcommand,
|
|
4260
4401
|
sdkKeysRemoveSubcommand,
|
|
4261
4402
|
sdkKeysSubcommand,
|
|
4403
|
+
prepareSubcommand,
|
|
4262
4404
|
flagsCommand,
|
|
4263
4405
|
connectSubcommand,
|
|
4264
4406
|
disconnectSubcommand,
|
|
@@ -4337,13 +4479,17 @@ export {
|
|
|
4337
4479
|
putSubcommand,
|
|
4338
4480
|
delSubcommand,
|
|
4339
4481
|
copySubcommand,
|
|
4482
|
+
getSubcommand,
|
|
4340
4483
|
addStoreSubcommand,
|
|
4341
4484
|
removeStoreSubcommand,
|
|
4342
4485
|
getStoreSubcommand,
|
|
4486
|
+
createStoreSubcommand,
|
|
4487
|
+
deleteStoreSubcommand,
|
|
4488
|
+
getStoreInfoSubcommand,
|
|
4343
4489
|
storeSubcommand,
|
|
4344
4490
|
blobCommand,
|
|
4345
4491
|
listSubcommand13,
|
|
4346
|
-
|
|
4492
|
+
getSubcommand2,
|
|
4347
4493
|
createSubcommand,
|
|
4348
4494
|
removeSubcommand10,
|
|
4349
4495
|
webhooksCommand,
|
|
@@ -173,8 +173,8 @@ var metricsCommand = {
|
|
|
173
173
|
value: `${packageName} metrics -e incomingRequest --group-by httpStatus --since 6h`
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
|
-
name: "Function
|
|
177
|
-
value: `${packageName} metrics -e functionExecution -m
|
|
176
|
+
name: "Function duration by route",
|
|
177
|
+
value: `${packageName} metrics -e functionExecution -m functionDurationMs -a avg --group-by route --since 1h`
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
name: "AI Gateway costs by provider",
|
|
@@ -16,19 +16,23 @@ import {
|
|
|
16
16
|
__toESM
|
|
17
17
|
} from "./chunk-A2M6YJ6J.js";
|
|
18
18
|
|
|
19
|
-
// src/commands/build/emit-flags-
|
|
19
|
+
// src/commands/build/emit-flags-datafiles.ts
|
|
20
20
|
var import_node_fetch = __toESM(require_lib(), 1);
|
|
21
|
+
import { createHash } from "crypto";
|
|
21
22
|
import { NowBuildError } from "@vercel/build-utils";
|
|
22
23
|
import { mkdir, writeFile } from "fs/promises";
|
|
23
24
|
import { join } from "path";
|
|
24
25
|
init_pkg();
|
|
25
26
|
var FLAGS_HOST = "https://flags.vercel.com";
|
|
26
|
-
var FLAGS_DEFINITIONS_VERSION = "1.0.
|
|
27
|
+
var FLAGS_DEFINITIONS_VERSION = "1.0.1";
|
|
27
28
|
function obfuscate(sdkKey, prefixLength = 18) {
|
|
28
29
|
if (prefixLength >= sdkKey.length)
|
|
29
30
|
return sdkKey;
|
|
30
31
|
return sdkKey.slice(0, prefixLength) + "*".repeat(sdkKey.length - prefixLength);
|
|
31
32
|
}
|
|
33
|
+
function hashSdkKey(sdkKey) {
|
|
34
|
+
return createHash("sha256").update(sdkKey).digest("hex");
|
|
35
|
+
}
|
|
32
36
|
function generateDefinitionsModule(sdkKeys, values) {
|
|
33
37
|
const stringified = sdkKeys.map((_, i) => JSON.stringify(values[i]));
|
|
34
38
|
const uniqueStrings = [];
|
|
@@ -40,6 +44,7 @@ function generateDefinitionsModule(sdkKeys, values) {
|
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
const keyToIndex = sdkKeys.map((_, i) => stringToIndex.get(stringified[i]));
|
|
47
|
+
const hashedKeys = sdkKeys.map(hashSdkKey);
|
|
43
48
|
const lines = [
|
|
44
49
|
"const memo = (fn) => { let cached; return () => (cached ??= fn()); };",
|
|
45
50
|
""
|
|
@@ -52,12 +57,12 @@ function generateDefinitionsModule(sdkKeys, values) {
|
|
|
52
57
|
lines.push("");
|
|
53
58
|
lines.push("const map = {");
|
|
54
59
|
for (let i = 0; i < sdkKeys.length; i++) {
|
|
55
|
-
lines.push(` ${JSON.stringify(
|
|
60
|
+
lines.push(` ${JSON.stringify(hashedKeys[i])}: _d${keyToIndex[i]},`);
|
|
56
61
|
}
|
|
57
62
|
lines.push("};");
|
|
58
63
|
lines.push("");
|
|
59
|
-
lines.push("export function get(
|
|
60
|
-
lines.push(" return map[
|
|
64
|
+
lines.push("export function get(hashedSdkKey) {");
|
|
65
|
+
lines.push(" return map[hashedSdkKey]?.() ?? null;");
|
|
61
66
|
lines.push("}");
|
|
62
67
|
lines.push("");
|
|
63
68
|
lines.push(
|
|
@@ -65,7 +70,7 @@ function generateDefinitionsModule(sdkKeys, values) {
|
|
|
65
70
|
);
|
|
66
71
|
return lines.join("\n");
|
|
67
72
|
}
|
|
68
|
-
async function
|
|
73
|
+
async function emitFlagsDatafiles(cwd, env) {
|
|
69
74
|
output_manager_default.debug("vercel-flags: checking env vars for SDK Keys");
|
|
70
75
|
const sdkKeys = Array.from(
|
|
71
76
|
Object.values(env).reduce((acc, value) => {
|
|
@@ -124,7 +129,7 @@ async function emitFlagsDefinitions(cwd, env) {
|
|
|
124
129
|
const dtsPath = join(storageDir, "index.d.ts");
|
|
125
130
|
const packageJsonPath = join(storageDir, "package.json");
|
|
126
131
|
const dts = [
|
|
127
|
-
"export function get(
|
|
132
|
+
"export function get(hashedSdkKey: string): Record<string, unknown> | null;",
|
|
128
133
|
"export const version: string;",
|
|
129
134
|
""
|
|
130
135
|
].join("\n");
|
|
@@ -155,6 +160,7 @@ async function emitFlagsDefinitions(cwd, env) {
|
|
|
155
160
|
` \u2192 included definitions for keys "${sdkKeys.map((key) => obfuscate(key)).join(", ")}"`
|
|
156
161
|
);
|
|
157
162
|
}
|
|
163
|
+
|
|
158
164
|
export {
|
|
159
|
-
|
|
165
|
+
emitFlagsDatafiles
|
|
160
166
|
};
|