wrangler 4.3.0 → 4.4.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/wrangler-dist/cli.js
CHANGED
@@ -81177,7 +81177,7 @@ var import_undici3 = __toESM(require_undici());
|
|
81177
81177
|
|
81178
81178
|
// package.json
|
81179
81179
|
var name = "wrangler";
|
81180
|
-
var version = "4.
|
81180
|
+
var version = "4.4.0";
|
81181
81181
|
|
81182
81182
|
// src/environment-variables/misc-variables.ts
|
81183
81183
|
init_import_meta_url();
|
@@ -90160,7 +90160,8 @@ var DefaultScopes = {
|
|
90160
90160
|
"ssl_certs:write": "See and manage mTLS certificates for your account",
|
90161
90161
|
"ai:write": "See and change Workers AI catalog and assets",
|
90162
90162
|
"queues:write": "See and change Cloudflare Queues settings and data",
|
90163
|
-
"pipelines:write": "See and change Cloudflare Pipelines configurations and data"
|
90163
|
+
"pipelines:write": "See and change Cloudflare Pipelines configurations and data",
|
90164
|
+
"secrets_store:write": "See and change secrets + stores within the Secrets Store"
|
90164
90165
|
};
|
90165
90166
|
var OptionalScopes = {
|
90166
90167
|
"cloudchamber:write": "Manage Cloudchamber"
|
@@ -93050,7 +93051,6 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
|
|
93050
93051
|
liveReload: config.liveReload,
|
93051
93052
|
upstream,
|
93052
93053
|
unsafeProxySharedSecret: proxyToUserWorkerAuthenticationSecret,
|
93053
|
-
unsafeEnableAssetsRpc: getFlag("ASSETS_RPC"),
|
93054
93054
|
log: log2,
|
93055
93055
|
verbose: logger.loggerLevel === "debug",
|
93056
93056
|
handleRuntimeStdio,
|
@@ -114338,8 +114338,7 @@ function createHandler(def) {
|
|
114338
114338
|
await def.validateArgs?.(args);
|
114339
114339
|
const experimentalFlags = def.behaviour?.overrideExperimentalFlags ? def.behaviour?.overrideExperimentalFlags(args) : {
|
114340
114340
|
MULTIWORKER: false,
|
114341
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
114342
|
-
ASSETS_RPC: false
|
114341
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
114343
114342
|
};
|
114344
114343
|
await run(
|
114345
114344
|
experimentalFlags,
|
@@ -116984,8 +116983,7 @@ var deployCommand = createCommand({
|
|
116984
116983
|
useConfigRedirectIfAvailable: true,
|
116985
116984
|
overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
|
116986
116985
|
MULTIWORKER: false,
|
116987
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
116988
|
-
ASSETS_RPC: false
|
116986
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
116989
116987
|
}), "overrideExperimentalFlags")
|
116990
116988
|
},
|
116991
116989
|
validateArgs(args) {
|
@@ -123360,8 +123358,7 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
123360
123358
|
const devServer = await run(
|
123361
123359
|
{
|
123362
123360
|
MULTIWORKER: Array.isArray(args.config),
|
123363
|
-
RESOURCES_PROVISION: false
|
123364
|
-
ASSETS_RPC: false
|
123361
|
+
RESOURCES_PROVISION: false
|
123365
123362
|
},
|
123366
123363
|
() => startDev({
|
123367
123364
|
script: scriptEntrypoint,
|
@@ -123430,8 +123427,7 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
123430
123427
|
config: Array.isArray(args.config) ? args.config : void 0,
|
123431
123428
|
site: void 0,
|
123432
123429
|
siteInclude: void 0,
|
123433
|
-
siteExclude: void 0
|
123434
|
-
experimentalAssetsRpc: false
|
123430
|
+
siteExclude: void 0
|
123435
123431
|
})
|
123436
123432
|
);
|
123437
123433
|
sendMetricsEvent("run pages dev");
|
@@ -132963,6 +132959,662 @@ var r2BucketSippyGetCommand = createCommand({
|
|
132963
132959
|
}
|
132964
132960
|
});
|
132965
132961
|
|
132962
|
+
// src/secrets-store/index.ts
|
132963
|
+
init_import_meta_url();
|
132964
|
+
var secretsStoreNamespace = createNamespace({
|
132965
|
+
metadata: {
|
132966
|
+
description: `\u{1F510} Manage the Secrets Store`,
|
132967
|
+
status: "alpha",
|
132968
|
+
owner: "Product: SSL"
|
132969
|
+
}
|
132970
|
+
});
|
132971
|
+
var secretsStoreStoreNamespace = createNamespace({
|
132972
|
+
metadata: {
|
132973
|
+
description: "\u{1F510} Manage Stores within the Secrets Store",
|
132974
|
+
status: "alpha",
|
132975
|
+
owner: "Product: SSL"
|
132976
|
+
}
|
132977
|
+
});
|
132978
|
+
var secretsStoreSecretNamespace = createNamespace({
|
132979
|
+
metadata: {
|
132980
|
+
description: "\u{1F510} Manage Secrets within the Secrets Store",
|
132981
|
+
status: "alpha",
|
132982
|
+
owner: "Product: SSL"
|
132983
|
+
}
|
132984
|
+
});
|
132985
|
+
|
132986
|
+
// src/secrets-store/commands.ts
|
132987
|
+
init_import_meta_url();
|
132988
|
+
|
132989
|
+
// src/secrets-store/client.ts
|
132990
|
+
init_import_meta_url();
|
132991
|
+
async function createStore(accountId, body) {
|
132992
|
+
return await fetchResult(`/accounts/${accountId}/secrets_store/stores`, {
|
132993
|
+
method: "POST",
|
132994
|
+
body: JSON.stringify(body)
|
132995
|
+
});
|
132996
|
+
}
|
132997
|
+
__name(createStore, "createStore");
|
132998
|
+
async function deleteStore(accountId, storeId) {
|
132999
|
+
return await fetchResult(
|
133000
|
+
`/accounts/${accountId}/secrets_store/stores/${storeId}`,
|
133001
|
+
{
|
133002
|
+
method: "DELETE"
|
133003
|
+
}
|
133004
|
+
);
|
133005
|
+
}
|
133006
|
+
__name(deleteStore, "deleteStore");
|
133007
|
+
async function listStores(accountId, urlParams) {
|
133008
|
+
return await fetchResult(
|
133009
|
+
`/accounts/${accountId}/secrets_store/stores`,
|
133010
|
+
{
|
133011
|
+
method: "GET"
|
133012
|
+
},
|
133013
|
+
urlParams
|
133014
|
+
);
|
133015
|
+
}
|
133016
|
+
__name(listStores, "listStores");
|
133017
|
+
async function listSecrets(accountId, storeId, urlParams) {
|
133018
|
+
return await fetchResult(
|
133019
|
+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets`,
|
133020
|
+
{
|
133021
|
+
method: "GET"
|
133022
|
+
},
|
133023
|
+
urlParams
|
133024
|
+
);
|
133025
|
+
}
|
133026
|
+
__name(listSecrets, "listSecrets");
|
133027
|
+
async function getSecret(accountId, storeId, secretId) {
|
133028
|
+
return await fetchResult(
|
133029
|
+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
|
133030
|
+
{
|
133031
|
+
method: "GET"
|
133032
|
+
}
|
133033
|
+
);
|
133034
|
+
}
|
133035
|
+
__name(getSecret, "getSecret");
|
133036
|
+
async function createSecret(accountId, storeId, body) {
|
133037
|
+
return await fetchResult(
|
133038
|
+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets`,
|
133039
|
+
{
|
133040
|
+
method: "POST",
|
133041
|
+
body: JSON.stringify([body])
|
133042
|
+
}
|
133043
|
+
);
|
133044
|
+
}
|
133045
|
+
__name(createSecret, "createSecret");
|
133046
|
+
async function updateSecret(accountId, storeId, secretId, body) {
|
133047
|
+
return await fetchResult(
|
133048
|
+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
|
133049
|
+
{
|
133050
|
+
method: "PATCH",
|
133051
|
+
body: JSON.stringify(body)
|
133052
|
+
}
|
133053
|
+
);
|
133054
|
+
}
|
133055
|
+
__name(updateSecret, "updateSecret");
|
133056
|
+
async function deleteSecret(accountId, storeId, secretId) {
|
133057
|
+
return await fetchResult(
|
133058
|
+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}`,
|
133059
|
+
{
|
133060
|
+
method: "DELETE"
|
133061
|
+
}
|
133062
|
+
);
|
133063
|
+
}
|
133064
|
+
__name(deleteSecret, "deleteSecret");
|
133065
|
+
async function duplicateSecret(accountId, storeId, secretId, body) {
|
133066
|
+
return await fetchResult(
|
133067
|
+
`/accounts/${accountId}/secrets_store/stores/${storeId}/secrets/${secretId}/duplicate`,
|
133068
|
+
{
|
133069
|
+
method: "POST",
|
133070
|
+
body: JSON.stringify(body)
|
133071
|
+
}
|
133072
|
+
);
|
133073
|
+
}
|
133074
|
+
__name(duplicateSecret, "duplicateSecret");
|
133075
|
+
|
133076
|
+
// src/secrets-store/commands.ts
|
133077
|
+
var secretsStoreStoreCreateCommand = createCommand({
|
133078
|
+
metadata: {
|
133079
|
+
description: "Create a store within an account",
|
133080
|
+
status: "alpha",
|
133081
|
+
owner: "Product: SSL"
|
133082
|
+
},
|
133083
|
+
positionalArgs: ["name"],
|
133084
|
+
args: {
|
133085
|
+
name: {
|
133086
|
+
type: "string",
|
133087
|
+
description: "Name of the store",
|
133088
|
+
demandOption: true,
|
133089
|
+
requiresArg: true
|
133090
|
+
},
|
133091
|
+
remote: {
|
133092
|
+
type: "boolean",
|
133093
|
+
description: "Execute command against remote Secrets Store",
|
133094
|
+
default: false
|
133095
|
+
}
|
133096
|
+
},
|
133097
|
+
async handler(args, { config }) {
|
133098
|
+
let store;
|
133099
|
+
logger.log(`\u{1F510} Creating store... (Name: ${args.name})`);
|
133100
|
+
if (args.remote) {
|
133101
|
+
const accountId = config.account_id || await getAccountId();
|
133102
|
+
store = await createStore(accountId, { name: args.name });
|
133103
|
+
} else {
|
133104
|
+
logger.log(`Local mode enabled, this command is a no-op.`);
|
133105
|
+
return;
|
133106
|
+
}
|
133107
|
+
logger.log(`\u2705 Created store! (Name: ${args.name}, ID: ${store.id})`);
|
133108
|
+
}
|
133109
|
+
});
|
133110
|
+
var secretsStoreStoreDeleteCommand = createCommand({
|
133111
|
+
metadata: {
|
133112
|
+
description: "Delete a store within an account",
|
133113
|
+
status: "alpha",
|
133114
|
+
owner: "Product: SSL"
|
133115
|
+
},
|
133116
|
+
positionalArgs: ["store-id"],
|
133117
|
+
args: {
|
133118
|
+
"store-id": {
|
133119
|
+
type: "string",
|
133120
|
+
description: "ID of the store",
|
133121
|
+
demandOption: true,
|
133122
|
+
requiresArg: true
|
133123
|
+
},
|
133124
|
+
remote: {
|
133125
|
+
type: "boolean",
|
133126
|
+
description: "Execute command against remote Secrets Store",
|
133127
|
+
default: false
|
133128
|
+
}
|
133129
|
+
},
|
133130
|
+
async handler(args, { config }) {
|
133131
|
+
logger.log(`\u{1F510} Deleting store... (Name: ${args.storeId})`);
|
133132
|
+
if (args.remote) {
|
133133
|
+
const accountId = config.account_id || await getAccountId();
|
133134
|
+
await deleteStore(accountId, args.storeId);
|
133135
|
+
} else {
|
133136
|
+
logger.log(`Local mode enabled, this command is a no-op.`);
|
133137
|
+
return;
|
133138
|
+
}
|
133139
|
+
logger.log(`\u2705 Deleted store! (ID: ${args.storeId})`);
|
133140
|
+
}
|
133141
|
+
});
|
133142
|
+
var secretsStoreStoreListCommand = createCommand({
|
133143
|
+
metadata: {
|
133144
|
+
description: "List stores within an account",
|
133145
|
+
status: "alpha",
|
133146
|
+
owner: "Product: SSL"
|
133147
|
+
},
|
133148
|
+
args: {
|
133149
|
+
page: {
|
133150
|
+
describe: 'Page number of stores listing results, can configure page size using "per-page"',
|
133151
|
+
type: "number",
|
133152
|
+
default: 1
|
133153
|
+
},
|
133154
|
+
"per-page": {
|
133155
|
+
describe: "Number of stores to show per page",
|
133156
|
+
type: "number",
|
133157
|
+
default: 10
|
133158
|
+
},
|
133159
|
+
remote: {
|
133160
|
+
type: "boolean",
|
133161
|
+
description: "Execute command against remote Secrets Store",
|
133162
|
+
default: false
|
133163
|
+
}
|
133164
|
+
},
|
133165
|
+
async handler(args, { config }) {
|
133166
|
+
const urlParams = new URLSearchParams();
|
133167
|
+
urlParams.set("per_page", args.perPage.toString());
|
133168
|
+
urlParams.set("page", args.page.toString());
|
133169
|
+
logger.log(`\u{1F510} Listing stores...`);
|
133170
|
+
let stores;
|
133171
|
+
if (args.remote) {
|
133172
|
+
const accountId = config.account_id || await getAccountId();
|
133173
|
+
stores = await listStores(accountId, urlParams);
|
133174
|
+
} else {
|
133175
|
+
throw new UserError(
|
133176
|
+
"No local dev version of this command available, need to include --remote in command",
|
133177
|
+
{ telemetryMessage: true }
|
133178
|
+
);
|
133179
|
+
}
|
133180
|
+
if (stores.length === 0) {
|
133181
|
+
throw new UserError("List request returned no stores.", {
|
133182
|
+
telemetryMessage: true
|
133183
|
+
});
|
133184
|
+
} else {
|
133185
|
+
const prettierStores = stores.sort((a5, b6) => a5.name.localeCompare(b6.name)).map((store) => ({
|
133186
|
+
Name: store.name,
|
133187
|
+
ID: store.id,
|
133188
|
+
AccountID: store.account_id,
|
133189
|
+
Created: new Date(store.created).toLocaleString(),
|
133190
|
+
Modified: new Date(store.modified).toLocaleString()
|
133191
|
+
}));
|
133192
|
+
logger.table(prettierStores);
|
133193
|
+
}
|
133194
|
+
}
|
133195
|
+
});
|
133196
|
+
var secretsStoreSecretListCommand = createCommand({
|
133197
|
+
metadata: {
|
133198
|
+
description: "List secrets within a store",
|
133199
|
+
status: "alpha",
|
133200
|
+
owner: "Product: SSL"
|
133201
|
+
},
|
133202
|
+
positionalArgs: ["store-id"],
|
133203
|
+
args: {
|
133204
|
+
"store-id": {
|
133205
|
+
describe: "ID of the store in which to list secrets",
|
133206
|
+
type: "string",
|
133207
|
+
demandOption: true,
|
133208
|
+
requiresArg: true
|
133209
|
+
},
|
133210
|
+
page: {
|
133211
|
+
describe: 'Page number of secrets listing results, can configure page size using "per-page"',
|
133212
|
+
type: "number",
|
133213
|
+
default: 1
|
133214
|
+
},
|
133215
|
+
"per-page": {
|
133216
|
+
describe: "Number of secrets to show per page",
|
133217
|
+
type: "number",
|
133218
|
+
default: 10
|
133219
|
+
},
|
133220
|
+
remote: {
|
133221
|
+
type: "boolean",
|
133222
|
+
description: "Execute command against remote Secrets Store",
|
133223
|
+
default: false
|
133224
|
+
}
|
133225
|
+
},
|
133226
|
+
async handler(args, { config }) {
|
133227
|
+
const urlParams = new URLSearchParams();
|
133228
|
+
urlParams.set("per_page", args.perPage.toString());
|
133229
|
+
urlParams.set("page", args.page.toString());
|
133230
|
+
logger.log(
|
133231
|
+
`\u{1F510} Listing secrets... (store-id: ${args.storeId}, page: ${args.page}, per-page: ${args.perPage})`
|
133232
|
+
);
|
133233
|
+
let secrets;
|
133234
|
+
if (args.remote) {
|
133235
|
+
const accountId = config.account_id || await getAccountId();
|
133236
|
+
secrets = await listSecrets(accountId, args.storeId, urlParams);
|
133237
|
+
} else {
|
133238
|
+
throw new UserError(
|
133239
|
+
"No local dev version of this command available, need to include --remote in command",
|
133240
|
+
{ telemetryMessage: true }
|
133241
|
+
);
|
133242
|
+
}
|
133243
|
+
if (secrets.length === 0) {
|
133244
|
+
throw new FatalError("List request returned no secrets.", 1, {
|
133245
|
+
telemetryMessage: true
|
133246
|
+
});
|
133247
|
+
} else {
|
133248
|
+
const prettierSecrets = secrets.map((secret2) => ({
|
133249
|
+
Name: secret2.name,
|
133250
|
+
ID: secret2.id,
|
133251
|
+
Comment: secret2.comment,
|
133252
|
+
Scopes: secret2.scopes.join(", "),
|
133253
|
+
Status: secret2.status === "active" ? "active " : "pending",
|
133254
|
+
Created: new Date(secret2.created).toLocaleString(),
|
133255
|
+
Modified: new Date(secret2.modified).toLocaleString()
|
133256
|
+
}));
|
133257
|
+
logger.table(prettierSecrets);
|
133258
|
+
}
|
133259
|
+
}
|
133260
|
+
});
|
133261
|
+
var secretsStoreSecretGetCommand = createCommand({
|
133262
|
+
metadata: {
|
133263
|
+
description: "Get a secret within a store",
|
133264
|
+
status: "alpha",
|
133265
|
+
owner: "Product: SSL"
|
133266
|
+
},
|
133267
|
+
positionalArgs: ["store-id"],
|
133268
|
+
args: {
|
133269
|
+
"store-id": {
|
133270
|
+
describe: "ID of the store in which the secret resides",
|
133271
|
+
type: "string",
|
133272
|
+
demandOption: true,
|
133273
|
+
requiresArg: true
|
133274
|
+
},
|
133275
|
+
"secret-id": {
|
133276
|
+
describe: "ID of the secret to retrieve",
|
133277
|
+
type: "string",
|
133278
|
+
demandOption: true,
|
133279
|
+
requiresArg: true
|
133280
|
+
},
|
133281
|
+
remote: {
|
133282
|
+
type: "boolean",
|
133283
|
+
description: "Execute command against remote Secrets Store",
|
133284
|
+
default: false
|
133285
|
+
}
|
133286
|
+
},
|
133287
|
+
async handler(args, { config }) {
|
133288
|
+
logger.log(`\u{1F510} Getting secret... (ID: ${args.secretId})`);
|
133289
|
+
let secret2;
|
133290
|
+
if (args.remote) {
|
133291
|
+
const accountId = config.account_id || await getAccountId();
|
133292
|
+
secret2 = await getSecret(accountId, args.storeId, args.secretId);
|
133293
|
+
} else {
|
133294
|
+
throw new UserError(
|
133295
|
+
"No local dev version of this command available, need to include --remote in command",
|
133296
|
+
{ telemetryMessage: true }
|
133297
|
+
);
|
133298
|
+
}
|
133299
|
+
const prettierSecret = [
|
133300
|
+
{
|
133301
|
+
Name: secret2.name,
|
133302
|
+
ID: secret2.id,
|
133303
|
+
StoreID: secret2.store_id,
|
133304
|
+
Comment: secret2.comment,
|
133305
|
+
Scopes: secret2.scopes.join(", "),
|
133306
|
+
Status: secret2.status === "active" ? "active " : "pending",
|
133307
|
+
Created: new Date(secret2.created).toLocaleString(),
|
133308
|
+
Modified: new Date(secret2.modified).toLocaleString()
|
133309
|
+
}
|
133310
|
+
];
|
133311
|
+
logger.table(prettierSecret);
|
133312
|
+
}
|
133313
|
+
});
|
133314
|
+
var secretsStoreSecretCreateCommand = createCommand({
|
133315
|
+
metadata: {
|
133316
|
+
description: "Create a secret within a store",
|
133317
|
+
status: "alpha",
|
133318
|
+
owner: "Product: SSL"
|
133319
|
+
},
|
133320
|
+
positionalArgs: ["store-id"],
|
133321
|
+
args: {
|
133322
|
+
"store-id": {
|
133323
|
+
describe: "ID of the store in which the secret resides",
|
133324
|
+
type: "string",
|
133325
|
+
requiresArg: true,
|
133326
|
+
demandOption: true
|
133327
|
+
},
|
133328
|
+
name: {
|
133329
|
+
describe: "Name of the secret",
|
133330
|
+
type: "string",
|
133331
|
+
requiresArg: true,
|
133332
|
+
demandOption: true
|
133333
|
+
},
|
133334
|
+
value: {
|
133335
|
+
describe: "Value of the secret (Note: Only for testing. Not secure as this will leave secret value in plain-text in terminal history, exclude this flag and use automatic prompt instead)",
|
133336
|
+
type: "string"
|
133337
|
+
},
|
133338
|
+
scopes: {
|
133339
|
+
describe: 'Scopes for the secret (comma-separated list of scopes eg:"workers")',
|
133340
|
+
type: "string",
|
133341
|
+
requiresArg: true,
|
133342
|
+
demandOption: true
|
133343
|
+
},
|
133344
|
+
comment: {
|
133345
|
+
describe: "Comment for the secret",
|
133346
|
+
type: "string"
|
133347
|
+
},
|
133348
|
+
remote: {
|
133349
|
+
type: "boolean",
|
133350
|
+
description: "Execute command against remote Secrets Store",
|
133351
|
+
default: false
|
133352
|
+
}
|
133353
|
+
},
|
133354
|
+
async handler(args, { config }) {
|
133355
|
+
let secretValue = "";
|
133356
|
+
if (!args.value) {
|
133357
|
+
const isInteractive3 = process.stdin.isTTY;
|
133358
|
+
secretValue = trimTrailingWhitespace(
|
133359
|
+
isInteractive3 ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
|
133360
|
+
);
|
133361
|
+
} else {
|
133362
|
+
secretValue = args.value;
|
133363
|
+
}
|
133364
|
+
if (!secretValue) {
|
133365
|
+
throw new UserError("Need to pass in a value when creating a secret.");
|
133366
|
+
}
|
133367
|
+
logger.log(
|
133368
|
+
`
|
133369
|
+
\u{1F510} Creating secret... (Name: ${args.name}, Value: REDACTED, Scopes: ${args.scopes}, Comment: ${args.comment})`
|
133370
|
+
);
|
133371
|
+
let secrets;
|
133372
|
+
if (args.remote) {
|
133373
|
+
const accountId = config.account_id || await getAccountId();
|
133374
|
+
secrets = await createSecret(accountId, args.storeId, {
|
133375
|
+
name: args.name,
|
133376
|
+
value: secretValue,
|
133377
|
+
scopes: args.scopes.split(","),
|
133378
|
+
comment: args.comment
|
133379
|
+
});
|
133380
|
+
} else {
|
133381
|
+
throw new UserError(
|
133382
|
+
"No local dev version of this command available, need to include --remote in command",
|
133383
|
+
{ telemetryMessage: true }
|
133384
|
+
);
|
133385
|
+
}
|
133386
|
+
if (secrets.length === 0) {
|
133387
|
+
throw new FatalError("Failed to create a secret.", 1, {
|
133388
|
+
telemetryMessage: true
|
133389
|
+
});
|
133390
|
+
}
|
133391
|
+
const secret2 = secrets[0];
|
133392
|
+
logger.log(`\u2705 Created secret! (ID: ${secret2.id})`);
|
133393
|
+
const prettierSecret = [
|
133394
|
+
{
|
133395
|
+
Name: secret2.name,
|
133396
|
+
ID: secret2.id,
|
133397
|
+
StoreID: secret2.store_id,
|
133398
|
+
Comment: secret2.comment,
|
133399
|
+
Scopes: secret2.scopes.join(", "),
|
133400
|
+
Status: secret2.status,
|
133401
|
+
Created: new Date(secret2.created).toLocaleString(),
|
133402
|
+
Modified: new Date(secret2.modified).toLocaleString()
|
133403
|
+
}
|
133404
|
+
];
|
133405
|
+
logger.table(prettierSecret);
|
133406
|
+
}
|
133407
|
+
});
|
133408
|
+
var secretsStoreSecretUpdateCommand = createCommand({
|
133409
|
+
metadata: {
|
133410
|
+
description: "Update a secret within a store",
|
133411
|
+
status: "alpha",
|
133412
|
+
owner: "Product: SSL"
|
133413
|
+
},
|
133414
|
+
positionalArgs: ["store-id"],
|
133415
|
+
args: {
|
133416
|
+
"store-id": {
|
133417
|
+
describe: "ID of the store in which the secret resides",
|
133418
|
+
type: "string",
|
133419
|
+
requiresArg: true,
|
133420
|
+
demandOption: true
|
133421
|
+
},
|
133422
|
+
"secret-id": {
|
133423
|
+
describe: "ID of the secret to update",
|
133424
|
+
type: "string",
|
133425
|
+
requiresArg: true,
|
133426
|
+
demandOption: true
|
133427
|
+
},
|
133428
|
+
value: {
|
133429
|
+
describe: "Updated value of the secret (Note: Only for testing. Not secure as this will leave secret value in plain-text in terminal history, exclude this flag and use automatic prompt instead)",
|
133430
|
+
type: "string"
|
133431
|
+
},
|
133432
|
+
scopes: {
|
133433
|
+
describe: 'Updated scopes for the secret (comma-separated list of scopes eg:"workers")',
|
133434
|
+
type: "string"
|
133435
|
+
},
|
133436
|
+
comment: {
|
133437
|
+
describe: "Updated comment for the secret",
|
133438
|
+
type: "string"
|
133439
|
+
},
|
133440
|
+
remote: {
|
133441
|
+
type: "boolean",
|
133442
|
+
description: "Execute command against remote Secrets Store",
|
133443
|
+
default: false
|
133444
|
+
}
|
133445
|
+
},
|
133446
|
+
async handler(args, { config }) {
|
133447
|
+
let secretValue = "";
|
133448
|
+
if (!args.value) {
|
133449
|
+
const confirmValueUpdate = await confirm(
|
133450
|
+
"Do you want to update the secret value?",
|
133451
|
+
{ defaultValue: false }
|
133452
|
+
);
|
133453
|
+
if (confirmValueUpdate) {
|
133454
|
+
const isInteractive3 = process.stdin.isTTY;
|
133455
|
+
secretValue = trimTrailingWhitespace(
|
133456
|
+
isInteractive3 ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
|
133457
|
+
);
|
133458
|
+
}
|
133459
|
+
} else {
|
133460
|
+
secretValue = args.value;
|
133461
|
+
}
|
133462
|
+
if (!secretValue && !args.scopes && !args.comment) {
|
133463
|
+
throw new UserError(
|
133464
|
+
"Need to pass in a new field using `--value`, `--scopes`, or `--comment` to update a secret."
|
133465
|
+
);
|
133466
|
+
}
|
133467
|
+
logger.log(`\u{1F510} Updating secret... (ID: ${args.secretId})`);
|
133468
|
+
let secret2;
|
133469
|
+
if (args.remote) {
|
133470
|
+
const accountId = config.account_id || await getAccountId();
|
133471
|
+
secret2 = await updateSecret(accountId, args.storeId, args.secretId, {
|
133472
|
+
...secretValue && { value: secretValue },
|
133473
|
+
...args.scopes && { scopes: args.scopes.split(",") },
|
133474
|
+
...args.comment && { comment: args.comment }
|
133475
|
+
});
|
133476
|
+
} else {
|
133477
|
+
throw new UserError(
|
133478
|
+
"No local dev version of this command available, need to include --remote in command",
|
133479
|
+
{ telemetryMessage: true }
|
133480
|
+
);
|
133481
|
+
}
|
133482
|
+
logger.log(`\u2705 Updated secret! (ID: ${secret2.id})`);
|
133483
|
+
const prettierSecret = [
|
133484
|
+
{
|
133485
|
+
Name: secret2.name,
|
133486
|
+
ID: secret2.id,
|
133487
|
+
StoreID: secret2.store_id,
|
133488
|
+
Comment: secret2.comment,
|
133489
|
+
Scopes: secret2.scopes.join(", "),
|
133490
|
+
Status: secret2.status,
|
133491
|
+
Created: new Date(secret2.created).toLocaleString(),
|
133492
|
+
Modified: new Date(secret2.modified).toLocaleString()
|
133493
|
+
}
|
133494
|
+
];
|
133495
|
+
logger.table(prettierSecret);
|
133496
|
+
}
|
133497
|
+
});
|
133498
|
+
var secretsStoreSecretDeleteCommand = createCommand({
|
133499
|
+
metadata: {
|
133500
|
+
description: "Delete a secret within a store",
|
133501
|
+
status: "alpha",
|
133502
|
+
owner: "Product: SSL"
|
133503
|
+
},
|
133504
|
+
positionalArgs: ["store-id"],
|
133505
|
+
args: {
|
133506
|
+
"store-id": {
|
133507
|
+
describe: "ID of the store in which the secret resides",
|
133508
|
+
type: "string",
|
133509
|
+
requiresArg: true,
|
133510
|
+
demandOption: true
|
133511
|
+
},
|
133512
|
+
"secret-id": {
|
133513
|
+
describe: "ID of the secret to delete",
|
133514
|
+
type: "string",
|
133515
|
+
requiresArg: true,
|
133516
|
+
demandOption: true
|
133517
|
+
},
|
133518
|
+
remote: {
|
133519
|
+
type: "boolean",
|
133520
|
+
description: "Execute command against remote Secrets Store",
|
133521
|
+
default: false
|
133522
|
+
}
|
133523
|
+
},
|
133524
|
+
async handler(args, { config }) {
|
133525
|
+
logger.log(`\u{1F510} Deleting secret... (ID: ${args.secretId})`);
|
133526
|
+
if (args.remote) {
|
133527
|
+
const accountId = config.account_id || await getAccountId();
|
133528
|
+
await deleteSecret(accountId, args.storeId, args.secretId);
|
133529
|
+
} else {
|
133530
|
+
throw new UserError(
|
133531
|
+
"No local dev version of this command available, need to include --remote in command",
|
133532
|
+
{ telemetryMessage: true }
|
133533
|
+
);
|
133534
|
+
}
|
133535
|
+
logger.log(`\u2705 Deleted secret! (ID: ${args.secretId})`);
|
133536
|
+
}
|
133537
|
+
});
|
133538
|
+
var secretsStoreSecretDuplicateCommand = createCommand({
|
133539
|
+
metadata: {
|
133540
|
+
description: "Duplicate a secret within a store",
|
133541
|
+
status: "alpha",
|
133542
|
+
owner: "Product: SSL"
|
133543
|
+
},
|
133544
|
+
positionalArgs: ["store-id"],
|
133545
|
+
args: {
|
133546
|
+
"store-id": {
|
133547
|
+
describe: "ID of the store in which the secret resides",
|
133548
|
+
type: "string",
|
133549
|
+
requiresArg: true,
|
133550
|
+
demandOption: true
|
133551
|
+
},
|
133552
|
+
"secret-id": {
|
133553
|
+
describe: "ID of the secret to duplicate the secret value of",
|
133554
|
+
type: "string",
|
133555
|
+
requiresArg: true,
|
133556
|
+
demandOption: true
|
133557
|
+
},
|
133558
|
+
name: {
|
133559
|
+
describe: "Name of the new secret",
|
133560
|
+
type: "string",
|
133561
|
+
requiresArg: true,
|
133562
|
+
demandOption: true
|
133563
|
+
},
|
133564
|
+
scopes: {
|
133565
|
+
describe: "Scopes for the new secret",
|
133566
|
+
type: "string",
|
133567
|
+
requiresArg: true,
|
133568
|
+
demandOption: true
|
133569
|
+
},
|
133570
|
+
comment: {
|
133571
|
+
describe: "Comment for the new secret",
|
133572
|
+
type: "string"
|
133573
|
+
},
|
133574
|
+
remote: {
|
133575
|
+
type: "boolean",
|
133576
|
+
description: "Execute command against remote Secrets Store",
|
133577
|
+
default: false
|
133578
|
+
}
|
133579
|
+
},
|
133580
|
+
async handler(args, { config }) {
|
133581
|
+
logger.log(`\u{1F510} Duplicating secret... (ID: ${args.secretId})`);
|
133582
|
+
let duplicatedSecret;
|
133583
|
+
if (args.remote) {
|
133584
|
+
const accountId = config.account_id || await getAccountId();
|
133585
|
+
duplicatedSecret = await duplicateSecret(
|
133586
|
+
accountId,
|
133587
|
+
args.storeId,
|
133588
|
+
args.secretId,
|
133589
|
+
{
|
133590
|
+
name: args.name,
|
133591
|
+
scopes: args.scopes.split(","),
|
133592
|
+
comment: args.comment || ""
|
133593
|
+
}
|
133594
|
+
);
|
133595
|
+
} else {
|
133596
|
+
throw new UserError(
|
133597
|
+
"No local dev version of this command available, need to include --remote in command",
|
133598
|
+
{ telemetryMessage: true }
|
133599
|
+
);
|
133600
|
+
}
|
133601
|
+
logger.log(`\u2705 Duplicated secret! (ID: ${duplicatedSecret.id})`);
|
133602
|
+
const prettierSecret = [
|
133603
|
+
{
|
133604
|
+
Name: duplicatedSecret.name,
|
133605
|
+
ID: duplicatedSecret.id,
|
133606
|
+
StoreID: duplicatedSecret.store_id,
|
133607
|
+
Comment: duplicatedSecret.comment,
|
133608
|
+
Scopes: duplicatedSecret.scopes.join(", "),
|
133609
|
+
Status: duplicatedSecret.status,
|
133610
|
+
Created: new Date(duplicatedSecret.created).toLocaleString(),
|
133611
|
+
Modified: new Date(duplicatedSecret.modified).toLocaleString()
|
133612
|
+
}
|
133613
|
+
];
|
133614
|
+
logger.table(prettierSecret);
|
133615
|
+
}
|
133616
|
+
});
|
133617
|
+
|
132966
133618
|
// src/sentry/index.ts
|
132967
133619
|
init_import_meta_url();
|
132968
133620
|
|
@@ -146234,8 +146886,7 @@ var versionsUploadCommand = createCommand({
|
|
146234
146886
|
useConfigRedirectIfAvailable: true,
|
146235
146887
|
overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
|
146236
146888
|
MULTIWORKER: false,
|
146237
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
146238
|
-
ASSETS_RPC: false
|
146889
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
146239
146890
|
}), "overrideExperimentalFlags")
|
146240
146891
|
},
|
146241
146892
|
handler: /* @__PURE__ */ __name(async function versionsUploadHandler(args, { config }) {
|
@@ -146930,9 +147581,15 @@ var workflowsDeleteCommand = createCommand({
|
|
146930
147581
|
}
|
146931
147582
|
},
|
146932
147583
|
positionalArgs: ["name"],
|
146933
|
-
async handler(args) {
|
146934
|
-
|
146935
|
-
|
147584
|
+
async handler(args, { config }) {
|
147585
|
+
const accountId = await requireAuth(config);
|
147586
|
+
await fetchResult(`/accounts/${accountId}/workflows/${args.name}`, {
|
147587
|
+
method: "DELETE"
|
147588
|
+
});
|
147589
|
+
logger.log(
|
147590
|
+
`\u2705 Workflow "${args.name}" removed successfully.
|
147591
|
+
Note that running instances might take a few minutes to be properly terminated.`
|
147592
|
+
);
|
146936
147593
|
}
|
146937
147594
|
});
|
146938
147595
|
|
@@ -148205,6 +148862,65 @@ var workflowsInstancesTerminateCommand = createCommand({
|
|
148205
148862
|
}
|
148206
148863
|
});
|
148207
148864
|
|
148865
|
+
// src/workflows/commands/instances/terminate-all.ts
|
148866
|
+
init_import_meta_url();
|
148867
|
+
var workflowsInstancesTerminateAllCommand = createCommand({
|
148868
|
+
metadata: {
|
148869
|
+
description: "Terminate all workflow instances",
|
148870
|
+
owner: "Product: Workflows",
|
148871
|
+
status: "open-beta",
|
148872
|
+
hidden: true
|
148873
|
+
},
|
148874
|
+
positionalArgs: ["name"],
|
148875
|
+
args: {
|
148876
|
+
name: {
|
148877
|
+
describe: "Name of the workflow",
|
148878
|
+
type: "string",
|
148879
|
+
demandOption: true
|
148880
|
+
},
|
148881
|
+
status: {
|
148882
|
+
describe: "Filter instances to be terminated by status",
|
148883
|
+
type: "string"
|
148884
|
+
}
|
148885
|
+
},
|
148886
|
+
validateArgs: /* @__PURE__ */ __name((args) => {
|
148887
|
+
const validStatusToTerminate = [
|
148888
|
+
"queued",
|
148889
|
+
"running",
|
148890
|
+
"paused",
|
148891
|
+
"waitingForPause",
|
148892
|
+
"waiting"
|
148893
|
+
];
|
148894
|
+
if (args.status !== void 0 && !validStatusToTerminate.includes(args.status)) {
|
148895
|
+
throw new CommandLineArgsError(
|
148896
|
+
`Provided status "${args.status}" is not valid, it must be one of the following: ${validStatusToTerminate.join(", ")}.`
|
148897
|
+
);
|
148898
|
+
}
|
148899
|
+
}, "validateArgs"),
|
148900
|
+
async handler(args, { config }) {
|
148901
|
+
const accountId = await requireAuth(config);
|
148902
|
+
const maybeURLQueryString = args.status !== void 0 ? new URLSearchParams({
|
148903
|
+
status: args.status
|
148904
|
+
}) : void 0;
|
148905
|
+
const result = await fetchResult(
|
148906
|
+
`/accounts/${accountId}/workflows/${args.name}/instances/terminate`,
|
148907
|
+
{
|
148908
|
+
method: "PUT"
|
148909
|
+
},
|
148910
|
+
maybeURLQueryString
|
148911
|
+
);
|
148912
|
+
if (result.status === "ok") {
|
148913
|
+
logger.info(
|
148914
|
+
`\u{1F977} A job to terminate instances from Workflow "${args.name}" ${args.status !== void 0 ? `with status "${args.status}"` : ""} has been started. It might take a few minutes to complete.`
|
148915
|
+
);
|
148916
|
+
return;
|
148917
|
+
}
|
148918
|
+
logger.info(
|
148919
|
+
`\u{1F977} A job to terminate instances from Workflow "${args.name}" ${args.status !== void 0 ? `with status "${args.status}"` : ""} is already running. It might take a few minutes to complete.`
|
148920
|
+
);
|
148921
|
+
}
|
148922
|
+
});
|
148923
|
+
|
148208
148924
|
// src/workflows/commands/list.ts
|
148209
148925
|
init_import_meta_url();
|
148210
148926
|
var workflowsListCommand = createCommand({
|
@@ -148822,6 +149538,54 @@ function createCLIParser(argv) {
|
|
148822
149538
|
wrangler.command("ai", "\u{1F916} Manage AI models", (aiYargs) => {
|
148823
149539
|
return ai(aiYargs.command(subHelp));
|
148824
149540
|
});
|
149541
|
+
registry.define([
|
149542
|
+
{ command: "wrangler secrets-store", definition: secretsStoreNamespace },
|
149543
|
+
{
|
149544
|
+
command: "wrangler secrets-store store",
|
149545
|
+
definition: secretsStoreStoreNamespace
|
149546
|
+
},
|
149547
|
+
{
|
149548
|
+
command: "wrangler secrets-store store create",
|
149549
|
+
definition: secretsStoreStoreCreateCommand
|
149550
|
+
},
|
149551
|
+
{
|
149552
|
+
command: "wrangler secrets-store store delete",
|
149553
|
+
definition: secretsStoreStoreDeleteCommand
|
149554
|
+
},
|
149555
|
+
{
|
149556
|
+
command: "wrangler secrets-store store list",
|
149557
|
+
definition: secretsStoreStoreListCommand
|
149558
|
+
},
|
149559
|
+
{
|
149560
|
+
command: "wrangler secrets-store secret",
|
149561
|
+
definition: secretsStoreSecretNamespace
|
149562
|
+
},
|
149563
|
+
{
|
149564
|
+
command: "wrangler secrets-store secret create",
|
149565
|
+
definition: secretsStoreSecretCreateCommand
|
149566
|
+
},
|
149567
|
+
{
|
149568
|
+
command: "wrangler secrets-store secret list",
|
149569
|
+
definition: secretsStoreSecretListCommand
|
149570
|
+
},
|
149571
|
+
{
|
149572
|
+
command: "wrangler secrets-store secret get",
|
149573
|
+
definition: secretsStoreSecretGetCommand
|
149574
|
+
},
|
149575
|
+
{
|
149576
|
+
command: "wrangler secrets-store secret update",
|
149577
|
+
definition: secretsStoreSecretUpdateCommand
|
149578
|
+
},
|
149579
|
+
{
|
149580
|
+
command: "wrangler secrets-store secret delete",
|
149581
|
+
definition: secretsStoreSecretDeleteCommand
|
149582
|
+
},
|
149583
|
+
{
|
149584
|
+
command: "wrangler secrets-store secret duplicate",
|
149585
|
+
definition: secretsStoreSecretDuplicateCommand
|
149586
|
+
}
|
149587
|
+
]);
|
149588
|
+
registry.registerNamespace("cert");
|
148825
149589
|
registry.define([
|
148826
149590
|
{
|
148827
149591
|
command: "wrangler workflows",
|
@@ -148859,6 +149623,10 @@ function createCLIParser(argv) {
|
|
148859
149623
|
command: "wrangler workflows instances terminate",
|
148860
149624
|
definition: workflowsInstancesTerminateCommand
|
148861
149625
|
},
|
149626
|
+
{
|
149627
|
+
command: "wrangler workflows instances terminate-all",
|
149628
|
+
definition: workflowsInstancesTerminateAllCommand
|
149629
|
+
},
|
148862
149630
|
{
|
148863
149631
|
command: "wrangler workflows instances pause",
|
148864
149632
|
definition: workflowsInstancesPauseCommand
|
@@ -150484,9 +151252,10 @@ ${resolvedAssetsPath}`,
|
|
150484
151252
|
const headers = maybeGetFile(path62.join(resolvedAssetsPath, HEADERS_FILENAME));
|
150485
151253
|
const assetConfig = {
|
150486
151254
|
html_handling: config.assets?.html_handling,
|
150487
|
-
not_found_handling: config.assets?.not_found_handling
|
151255
|
+
not_found_handling: config.assets?.not_found_handling,
|
150488
151256
|
// The _redirects and _headers files are parsed in Miniflare in dev and parsing is not required for deploy
|
150489
|
-
|
151257
|
+
compatibility_date: config.compatibility_date,
|
151258
|
+
compatibility_flags: config.compatibility_flags
|
150490
151259
|
};
|
150491
151260
|
return {
|
150492
151261
|
directory: resolvedAssetsPath,
|
@@ -150935,8 +151704,7 @@ var dev = createCommand({
|
|
150935
151704
|
provideConfig: false,
|
150936
151705
|
overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
|
150937
151706
|
MULTIWORKER: Array.isArray(args.config),
|
150938
|
-
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
150939
|
-
ASSETS_RPC: args.experimentalAssetsRpc
|
151707
|
+
RESOURCES_PROVISION: args.experimentalProvision ?? false
|
150940
151708
|
}), "overrideExperimentalFlags")
|
150941
151709
|
},
|
150942
151710
|
metadata: {
|
@@ -151152,13 +151920,6 @@ var dev = createCommand({
|
|
151152
151920
|
type: "boolean",
|
151153
151921
|
describe: "Use a local lower-fidelity implementation of the Images binding",
|
151154
151922
|
default: false
|
151155
|
-
},
|
151156
|
-
"experimental-assets-rpc": {
|
151157
|
-
alias: "x-assets-rpc",
|
151158
|
-
type: "boolean",
|
151159
|
-
describe: "Support JSRPC bindings to Workers + Assets projects",
|
151160
|
-
default: false,
|
151161
|
-
hidden: true
|
151162
151923
|
}
|
151163
151924
|
},
|
151164
151925
|
async validateArgs(args) {
|
@@ -151814,15 +152575,13 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
151814
152575
|
experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
|
151815
152576
|
experimentalImagesLocalMode: imagesLocalMode ?? false,
|
151816
152577
|
enableIpc: options33?.experimental?.enableIpc,
|
151817
|
-
nodeCompat: void 0
|
151818
|
-
experimentalAssetsRpc: false
|
152578
|
+
nodeCompat: void 0
|
151819
152579
|
};
|
151820
152580
|
const devServer = await run(
|
151821
152581
|
{
|
151822
152582
|
// TODO: can we make this work?
|
151823
152583
|
MULTIWORKER: false,
|
151824
|
-
RESOURCES_PROVISION: false
|
151825
|
-
ASSETS_RPC: false
|
152584
|
+
RESOURCES_PROVISION: false
|
151826
152585
|
},
|
151827
152586
|
() => startDev(devOptions)
|
151828
152587
|
);
|
@@ -153776,8 +154535,7 @@ async function getPlatformProxy(options33 = {}) {
|
|
153776
154535
|
const miniflareOptions = await run(
|
153777
154536
|
{
|
153778
154537
|
MULTIWORKER: false,
|
153779
|
-
RESOURCES_PROVISION: false
|
153780
|
-
ASSETS_RPC: false
|
154538
|
+
RESOURCES_PROVISION: false
|
153781
154539
|
},
|
153782
154540
|
() => getMiniflareOptionsFromConfig(rawConfig, env6, options33)
|
153783
154541
|
);
|