wrangler 3.43.0 → 3.44.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/package.json +3 -3
- package/wrangler-dist/cli.js +235 -95
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.44.0",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wrangler",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"selfsigned": "^2.0.1",
|
|
96
96
|
"source-map": "0.6.1",
|
|
97
97
|
"xxhash-wasm": "^1.0.1",
|
|
98
|
-
"
|
|
99
|
-
"
|
|
98
|
+
"@cloudflare/kv-asset-handler": "0.3.1",
|
|
99
|
+
"miniflare": "3.20240329.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@cloudflare/ai": "^1.0.35",
|
package/wrangler-dist/cli.js
CHANGED
|
@@ -118532,7 +118532,7 @@ init_import_meta_url();
|
|
|
118532
118532
|
init_import_meta_url();
|
|
118533
118533
|
|
|
118534
118534
|
// package.json
|
|
118535
|
-
var version = "3.
|
|
118535
|
+
var version = "3.44.0";
|
|
118536
118536
|
var package_default = {
|
|
118537
118537
|
name: "wrangler",
|
|
118538
118538
|
version,
|
|
@@ -125245,6 +125245,42 @@ ${importers.map(
|
|
|
125245
125245
|
}
|
|
125246
125246
|
}), "nodejsCompatPlugin");
|
|
125247
125247
|
|
|
125248
|
+
// src/deployment-bundle/esbuild-plugins/standard-url.ts
|
|
125249
|
+
init_import_meta_url();
|
|
125250
|
+
var standardURLPlugin = /* @__PURE__ */ __name(() => ({
|
|
125251
|
+
name: "standard URL plugin",
|
|
125252
|
+
setup(pluginBuild) {
|
|
125253
|
+
pluginBuild.onResolve({ filter: /^node:url$|^url$/ }, ({ importer }) => {
|
|
125254
|
+
if (importer === "standard-url-plugin")
|
|
125255
|
+
return;
|
|
125256
|
+
return {
|
|
125257
|
+
path: "wrangler-url-polyfill",
|
|
125258
|
+
namespace: "wrangler-url"
|
|
125259
|
+
};
|
|
125260
|
+
});
|
|
125261
|
+
pluginBuild.onResolve(
|
|
125262
|
+
{ filter: /^wrangler:url$/ },
|
|
125263
|
+
async ({ kind, resolveDir }) => {
|
|
125264
|
+
const result = await pluginBuild.resolve("url", {
|
|
125265
|
+
kind,
|
|
125266
|
+
resolveDir,
|
|
125267
|
+
importer: "standard-url-plugin"
|
|
125268
|
+
});
|
|
125269
|
+
return result;
|
|
125270
|
+
}
|
|
125271
|
+
);
|
|
125272
|
+
pluginBuild.onLoad(
|
|
125273
|
+
{ filter: /^wrangler-url-polyfill$/, namespace: "wrangler-url" },
|
|
125274
|
+
() => {
|
|
125275
|
+
return {
|
|
125276
|
+
loader: "js",
|
|
125277
|
+
contents: `export * from "wrangler:url"; export const URL = globalThis.URL`
|
|
125278
|
+
};
|
|
125279
|
+
}
|
|
125280
|
+
);
|
|
125281
|
+
}
|
|
125282
|
+
}), "standardURLPlugin");
|
|
125283
|
+
|
|
125248
125284
|
// src/deployment-bundle/find-additional-modules.ts
|
|
125249
125285
|
init_import_meta_url();
|
|
125250
125286
|
var import_promises3 = require("node:fs/promises");
|
|
@@ -125973,7 +126009,11 @@ async function bundleWorker(entry, destination, {
|
|
|
125973
126009
|
},
|
|
125974
126010
|
plugins: [
|
|
125975
126011
|
moduleCollector.plugin,
|
|
125976
|
-
...legacyNodeCompat ? [
|
|
126012
|
+
...legacyNodeCompat ? [
|
|
126013
|
+
(0, import_node_globals_polyfill.default)({ buffer: true }),
|
|
126014
|
+
standardURLPlugin(),
|
|
126015
|
+
(0, import_node_modules_polyfill.default)()
|
|
126016
|
+
] : [],
|
|
125977
126017
|
nodejsCompatPlugin(!!nodejsCompat),
|
|
125978
126018
|
cloudflareInternalPlugin,
|
|
125979
126019
|
buildResultPlugin,
|
|
@@ -135465,6 +135505,9 @@ var OpenAPI = {
|
|
|
135465
135505
|
ENCODE_PATH: void 0
|
|
135466
135506
|
};
|
|
135467
135507
|
|
|
135508
|
+
// src/cloudchamber/client/models/AssignIPv4.ts
|
|
135509
|
+
init_import_meta_url();
|
|
135510
|
+
|
|
135468
135511
|
// src/cloudchamber/client/models/BadRequestWithCodeError.ts
|
|
135469
135512
|
init_import_meta_url();
|
|
135470
135513
|
var BadRequestWithCodeError;
|
|
@@ -135539,6 +135582,9 @@ init_import_meta_url();
|
|
|
135539
135582
|
// src/cloudchamber/client/models/NodeGroup.ts
|
|
135540
135583
|
init_import_meta_url();
|
|
135541
135584
|
|
|
135585
|
+
// src/cloudchamber/client/models/SchedulingPolicy.ts
|
|
135586
|
+
init_import_meta_url();
|
|
135587
|
+
|
|
135542
135588
|
// src/cloudchamber/client/models/State.ts
|
|
135543
135589
|
init_import_meta_url();
|
|
135544
135590
|
|
|
@@ -135911,10 +135957,11 @@ var DeploymentsService = class {
|
|
|
135911
135957
|
* @param image Filter deployments by image
|
|
135912
135958
|
* @param state Filter deployments by deployment state
|
|
135913
135959
|
* @param ipv4 Filter deployments by ipv4 address
|
|
135960
|
+
* @param label Filter deployments by label
|
|
135914
135961
|
* @returns ListDeploymentsV2 List of deployments with their corresponding placements
|
|
135915
135962
|
* @throws ApiError
|
|
135916
135963
|
*/
|
|
135917
|
-
static listDeploymentsV2(location, image, state, ipv4) {
|
|
135964
|
+
static listDeploymentsV2(location, image, state, ipv4, label) {
|
|
135918
135965
|
return request(OpenAPI, {
|
|
135919
135966
|
method: "GET",
|
|
135920
135967
|
url: "/deployments/v2",
|
|
@@ -135922,7 +135969,8 @@ var DeploymentsService = class {
|
|
|
135922
135969
|
location,
|
|
135923
135970
|
image,
|
|
135924
135971
|
state,
|
|
135925
|
-
ipv4
|
|
135972
|
+
ipv4,
|
|
135973
|
+
label
|
|
135926
135974
|
},
|
|
135927
135975
|
errors: {
|
|
135928
135976
|
400: `Unknown account`,
|
|
@@ -136132,7 +136180,7 @@ var ImageRegistriesService = class {
|
|
|
136132
136180
|
* Delete a registry from the account
|
|
136133
136181
|
* Delete a registry from the account, this will make Cloudchamber unable to pull images from the registry
|
|
136134
136182
|
* @param domain
|
|
136135
|
-
* @returns
|
|
136183
|
+
* @returns EmptyResponse The image registry is deleted
|
|
136136
136184
|
* @throws ApiError
|
|
136137
136185
|
*/
|
|
136138
136186
|
static deleteImageRegistry(domain2) {
|
|
@@ -136187,9 +136235,6 @@ var ImageRegistriesService = class {
|
|
|
136187
136235
|
};
|
|
136188
136236
|
__name(ImageRegistriesService, "ImageRegistriesService");
|
|
136189
136237
|
|
|
136190
|
-
// src/cloudchamber/client/services/IntrospectService.ts
|
|
136191
|
-
init_import_meta_url();
|
|
136192
|
-
|
|
136193
136238
|
// src/cloudchamber/client/services/IPsService.ts
|
|
136194
136239
|
init_import_meta_url();
|
|
136195
136240
|
|
|
@@ -137032,7 +137077,7 @@ async function getNetworkInput(args) {
|
|
|
137032
137077
|
type: "confirm"
|
|
137033
137078
|
});
|
|
137034
137079
|
return {
|
|
137035
|
-
assign_ipv4: ipv4 ? "predefined" : "none"
|
|
137080
|
+
assign_ipv4: ipv4 ? "predefined" /* PREDEFINED */ : "none" /* NONE */
|
|
137036
137081
|
};
|
|
137037
137082
|
}
|
|
137038
137083
|
__name(getNetworkInput, "getNetworkInput");
|
|
@@ -147844,7 +147889,15 @@ var Handler9 = /* @__PURE__ */ __name(async (args) => {
|
|
|
147844
147889
|
const textVars = Object.fromEntries(
|
|
147845
147890
|
Object.entries(config.vars).filter(([_3, v2]) => typeof v2 === "string")
|
|
147846
147891
|
);
|
|
147847
|
-
logger.log(
|
|
147892
|
+
logger.log(
|
|
147893
|
+
JSON.stringify({
|
|
147894
|
+
vars: textVars,
|
|
147895
|
+
pages_build_output_dir: import_node_path40.default.relative(
|
|
147896
|
+
args.projectDir,
|
|
147897
|
+
config.pages_build_output_dir
|
|
147898
|
+
)
|
|
147899
|
+
})
|
|
147900
|
+
);
|
|
147848
147901
|
}, "Handler");
|
|
147849
147902
|
|
|
147850
147903
|
// src/pages/deploy.tsx
|
|
@@ -151873,6 +151926,11 @@ async function getQueue(config, queueName) {
|
|
|
151873
151926
|
);
|
|
151874
151927
|
}
|
|
151875
151928
|
__name(getQueue, "getQueue");
|
|
151929
|
+
async function getQueueByID(config, queueID) {
|
|
151930
|
+
const accountId = await requireAuth(config);
|
|
151931
|
+
return await fetchResult(`/accounts/${accountId}/queues/${queueID}`, {});
|
|
151932
|
+
}
|
|
151933
|
+
__name(getQueueByID, "getQueueByID");
|
|
151876
151934
|
async function postConsumer(config, queueName, body) {
|
|
151877
151935
|
const accountId = await requireAuth(config);
|
|
151878
151936
|
return fetchResult(
|
|
@@ -152495,6 +152553,12 @@ var actionsForEventCategories = {
|
|
|
152495
152553
|
"object-create": ["PutObject", "CompleteMultipartUpload", "CopyObject"],
|
|
152496
152554
|
"object-delete": ["DeleteObject"]
|
|
152497
152555
|
};
|
|
152556
|
+
var eventCategoryByAction = {
|
|
152557
|
+
PutObject: "object-create",
|
|
152558
|
+
CompleteMultipartUpload: "object-create",
|
|
152559
|
+
CopyObject: "object-create",
|
|
152560
|
+
DeleteObject: "object-delete"
|
|
152561
|
+
};
|
|
152498
152562
|
function eventNotificationHeaders(apiCredentials) {
|
|
152499
152563
|
const headers = {
|
|
152500
152564
|
"Content-Type": "application/json"
|
|
@@ -152508,6 +152572,42 @@ function eventNotificationHeaders(apiCredentials) {
|
|
|
152508
152572
|
return headers;
|
|
152509
152573
|
}
|
|
152510
152574
|
__name(eventNotificationHeaders, "eventNotificationHeaders");
|
|
152575
|
+
async function tableFromNotificationGetResponse(config, response, queueIdentifier) {
|
|
152576
|
+
const reducer = /* @__PURE__ */ __name(async ([_3, { queue, rules }]) => {
|
|
152577
|
+
const queueResp = await queueIdentifier(config, queue);
|
|
152578
|
+
const rows = [];
|
|
152579
|
+
for (const { prefix = "", suffix = "", actions } of rules) {
|
|
152580
|
+
rows.push({
|
|
152581
|
+
queue_name: queueResp.queue_name,
|
|
152582
|
+
prefix,
|
|
152583
|
+
suffix,
|
|
152584
|
+
event_type: Array.from(
|
|
152585
|
+
actions.reduce((acc, action) => {
|
|
152586
|
+
acc.add(eventCategoryByAction[action]);
|
|
152587
|
+
return acc;
|
|
152588
|
+
}, /* @__PURE__ */ new Set())
|
|
152589
|
+
).join(",")
|
|
152590
|
+
});
|
|
152591
|
+
}
|
|
152592
|
+
return rows;
|
|
152593
|
+
}, "reducer");
|
|
152594
|
+
let tableOutput = [];
|
|
152595
|
+
for (const entry of Object.entries(response)) {
|
|
152596
|
+
const result = await reducer(entry);
|
|
152597
|
+
tableOutput = tableOutput.concat(...result);
|
|
152598
|
+
}
|
|
152599
|
+
return tableOutput;
|
|
152600
|
+
}
|
|
152601
|
+
__name(tableFromNotificationGetResponse, "tableFromNotificationGetResponse");
|
|
152602
|
+
async function getEventNotificationConfig(apiCredentials, accountId, bucketName) {
|
|
152603
|
+
const headers = eventNotificationHeaders(apiCredentials);
|
|
152604
|
+
logger.log(`Fetching notification configuration for bucket ${bucketName}...`);
|
|
152605
|
+
return await fetchResult(
|
|
152606
|
+
`/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration`,
|
|
152607
|
+
{ method: "GET", headers }
|
|
152608
|
+
);
|
|
152609
|
+
}
|
|
152610
|
+
__name(getEventNotificationConfig, "getEventNotificationConfig");
|
|
152511
152611
|
async function putEventNotificationConfig(config, apiCredentials, accountId, bucketName, queueName, eventTypes, prefix, suffix) {
|
|
152512
152612
|
const queue = await getQueue(config, queueName);
|
|
152513
152613
|
const headers = eventNotificationHeaders(apiCredentials);
|
|
@@ -152518,9 +152618,13 @@ async function putEventNotificationConfig(config, apiCredentials, accountId, buc
|
|
|
152518
152618
|
const body = {
|
|
152519
152619
|
rules: [{ prefix, suffix, actions }]
|
|
152520
152620
|
};
|
|
152621
|
+
const ruleFor = eventTypes.map(
|
|
152622
|
+
(et) => et === "object-create" ? "creation" : "deletion"
|
|
152623
|
+
);
|
|
152521
152624
|
logger.log(
|
|
152522
|
-
`
|
|
152523
|
-
|
|
152625
|
+
`Creating event notification rule for object ${ruleFor.join(
|
|
152626
|
+
" and "
|
|
152627
|
+
)} (${actions.join(",")})`
|
|
152524
152628
|
);
|
|
152525
152629
|
return await fetchResult(
|
|
152526
152630
|
`/accounts/${accountId}/event_notifications/r2/${bucketName}/configuration/queues/${queue.queue_id}`,
|
|
@@ -152541,6 +152645,110 @@ async function deleteEventNotificationConfig(config, apiCredentials, accountId,
|
|
|
152541
152645
|
}
|
|
152542
152646
|
__name(deleteEventNotificationConfig, "deleteEventNotificationConfig");
|
|
152543
152647
|
|
|
152648
|
+
// src/r2/notification.ts
|
|
152649
|
+
init_import_meta_url();
|
|
152650
|
+
function GetOptions(yargs) {
|
|
152651
|
+
return yargs.positional("bucket", {
|
|
152652
|
+
describe: "The name of the bucket for which notifications will be emitted",
|
|
152653
|
+
type: "string",
|
|
152654
|
+
demandOption: true
|
|
152655
|
+
});
|
|
152656
|
+
}
|
|
152657
|
+
__name(GetOptions, "GetOptions");
|
|
152658
|
+
async function GetHandler(args) {
|
|
152659
|
+
await printWranglerBanner();
|
|
152660
|
+
const config = readConfig(args.config, args);
|
|
152661
|
+
const accountId = await requireAuth(config);
|
|
152662
|
+
const apiCreds = requireApiToken();
|
|
152663
|
+
const resp = await getEventNotificationConfig(
|
|
152664
|
+
apiCreds,
|
|
152665
|
+
accountId,
|
|
152666
|
+
`${args.bucket}`
|
|
152667
|
+
);
|
|
152668
|
+
const tableOutput = await tableFromNotificationGetResponse(
|
|
152669
|
+
config,
|
|
152670
|
+
resp[args.bucket],
|
|
152671
|
+
getQueueByID
|
|
152672
|
+
);
|
|
152673
|
+
logger.table(tableOutput);
|
|
152674
|
+
}
|
|
152675
|
+
__name(GetHandler, "GetHandler");
|
|
152676
|
+
function CreateOptions4(yargs) {
|
|
152677
|
+
return yargs.positional("bucket", {
|
|
152678
|
+
describe: "The name of the bucket for which notifications will be emitted",
|
|
152679
|
+
type: "string",
|
|
152680
|
+
demandOption: true
|
|
152681
|
+
}).option("event-types", {
|
|
152682
|
+
describe: "Specify the kinds of object events to emit notifications for. ex. '--event-types object-create object-delete'",
|
|
152683
|
+
alias: "event-type",
|
|
152684
|
+
choices: Object.keys(actionsForEventCategories),
|
|
152685
|
+
demandOption: true,
|
|
152686
|
+
requiresArg: true,
|
|
152687
|
+
type: "array"
|
|
152688
|
+
}).option("prefix", {
|
|
152689
|
+
describe: "only actions on objects with this prefix will emit notifications",
|
|
152690
|
+
requiresArg: false,
|
|
152691
|
+
type: "string"
|
|
152692
|
+
}).option("suffix", {
|
|
152693
|
+
describe: "only actions on objects with this suffix will emit notifications",
|
|
152694
|
+
type: "string"
|
|
152695
|
+
}).option("queue", {
|
|
152696
|
+
describe: "The name of the queue to which event notifications will be sent. ex '--queue my-queue'",
|
|
152697
|
+
demandOption: true,
|
|
152698
|
+
requiresArg: true,
|
|
152699
|
+
type: "string"
|
|
152700
|
+
});
|
|
152701
|
+
}
|
|
152702
|
+
__name(CreateOptions4, "CreateOptions");
|
|
152703
|
+
async function CreateHandler4(args) {
|
|
152704
|
+
await printWranglerBanner();
|
|
152705
|
+
const config = readConfig(args.config, args);
|
|
152706
|
+
const accountId = await requireAuth(config);
|
|
152707
|
+
const apiCreds = requireApiToken();
|
|
152708
|
+
const { bucket, queue, eventTypes, prefix = "", suffix = "" } = args;
|
|
152709
|
+
await putEventNotificationConfig(
|
|
152710
|
+
config,
|
|
152711
|
+
apiCreds,
|
|
152712
|
+
accountId,
|
|
152713
|
+
`${bucket}`,
|
|
152714
|
+
`${queue}`,
|
|
152715
|
+
eventTypes,
|
|
152716
|
+
`${prefix}`,
|
|
152717
|
+
`${suffix}`
|
|
152718
|
+
);
|
|
152719
|
+
logger.log("Configuration created successfully!");
|
|
152720
|
+
}
|
|
152721
|
+
__name(CreateHandler4, "CreateHandler");
|
|
152722
|
+
function DeleteOptions2(yargs) {
|
|
152723
|
+
return yargs.positional("bucket", {
|
|
152724
|
+
describe: "The name of the bucket for which notifications will be emitted",
|
|
152725
|
+
type: "string",
|
|
152726
|
+
demandOption: true
|
|
152727
|
+
}).option("queue", {
|
|
152728
|
+
describe: "The name of the queue that is configured to receive notifications. ex '--queue my-queue'",
|
|
152729
|
+
demandOption: true,
|
|
152730
|
+
requiresArg: true,
|
|
152731
|
+
type: "string"
|
|
152732
|
+
});
|
|
152733
|
+
}
|
|
152734
|
+
__name(DeleteOptions2, "DeleteOptions");
|
|
152735
|
+
async function DeleteHandler2(args) {
|
|
152736
|
+
await printWranglerBanner();
|
|
152737
|
+
const config = readConfig(args.config, args);
|
|
152738
|
+
const accountId = await requireAuth(config);
|
|
152739
|
+
const apiCreds = requireApiToken();
|
|
152740
|
+
const { bucket, queue } = args;
|
|
152741
|
+
await deleteEventNotificationConfig(
|
|
152742
|
+
config,
|
|
152743
|
+
apiCreds,
|
|
152744
|
+
accountId,
|
|
152745
|
+
`${bucket}`,
|
|
152746
|
+
`${queue}`
|
|
152747
|
+
);
|
|
152748
|
+
logger.log("Configuration deleted successfully!");
|
|
152749
|
+
}
|
|
152750
|
+
__name(DeleteHandler2, "DeleteHandler");
|
|
152751
|
+
|
|
152544
152752
|
// src/r2/sippy.ts
|
|
152545
152753
|
init_import_meta_url();
|
|
152546
152754
|
var NO_SUCH_OBJECT_KEY = 10007;
|
|
@@ -152724,7 +152932,7 @@ async function EnableHandler(args) {
|
|
|
152724
152932
|
logger.log(`\u2728 Successfully enabled Sippy on the '${args.name}' bucket.`);
|
|
152725
152933
|
}
|
|
152726
152934
|
__name(EnableHandler, "EnableHandler");
|
|
152727
|
-
function
|
|
152935
|
+
function GetOptions2(yargs) {
|
|
152728
152936
|
return yargs.positional("name", {
|
|
152729
152937
|
describe: "The name of the bucket",
|
|
152730
152938
|
type: "string",
|
|
@@ -152736,8 +152944,8 @@ function GetOptions(yargs) {
|
|
|
152736
152944
|
type: "string"
|
|
152737
152945
|
});
|
|
152738
152946
|
}
|
|
152739
|
-
__name(
|
|
152740
|
-
async function
|
|
152947
|
+
__name(GetOptions2, "GetOptions");
|
|
152948
|
+
async function GetHandler2(args) {
|
|
152741
152949
|
const config = readConfig(args.config, args);
|
|
152742
152950
|
const accountId = await requireAuth(config);
|
|
152743
152951
|
try {
|
|
@@ -152755,7 +152963,7 @@ async function GetHandler(args) {
|
|
|
152755
152963
|
}
|
|
152756
152964
|
}
|
|
152757
152965
|
}
|
|
152758
|
-
__name(
|
|
152966
|
+
__name(GetHandler2, "GetHandler");
|
|
152759
152967
|
function DisableOptions(yargs) {
|
|
152760
152968
|
return yargs.positional("name", {
|
|
152761
152969
|
describe: "The name of the bucket",
|
|
@@ -153214,8 +153422,8 @@ ${key} is ${prettyBytes(objectSize, {
|
|
|
153214
153422
|
).command(
|
|
153215
153423
|
"get <name>",
|
|
153216
153424
|
"Check the status of Sippy on an R2 bucket",
|
|
153217
|
-
|
|
153218
|
-
|
|
153425
|
+
GetOptions2,
|
|
153426
|
+
GetHandler2
|
|
153219
153427
|
);
|
|
153220
153428
|
}
|
|
153221
153429
|
);
|
|
@@ -153224,88 +153432,20 @@ ${key} is ${prettyBytes(objectSize, {
|
|
|
153224
153432
|
"Manage event notifications for an R2 bucket",
|
|
153225
153433
|
(r2EvNotifyYargs) => {
|
|
153226
153434
|
return r2EvNotifyYargs.command(
|
|
153435
|
+
"get <bucket>",
|
|
153436
|
+
"Get event notification configuration for a bucket",
|
|
153437
|
+
GetOptions,
|
|
153438
|
+
GetHandler
|
|
153439
|
+
).command(
|
|
153227
153440
|
"create <bucket>",
|
|
153228
153441
|
"Create new event notification configuration for an R2 bucket",
|
|
153229
|
-
|
|
153230
|
-
|
|
153231
|
-
describe: "The name of the bucket for which notifications will be emitted",
|
|
153232
|
-
type: "string",
|
|
153233
|
-
demandOption: true
|
|
153234
|
-
}).option("event-types", {
|
|
153235
|
-
describe: "Specify the kinds of object events to emit notifications for. ex. '--event-types object-create object-delete'",
|
|
153236
|
-
alias: "event-type",
|
|
153237
|
-
choices: Object.keys(actionsForEventCategories),
|
|
153238
|
-
demandOption: true,
|
|
153239
|
-
requiresArg: true,
|
|
153240
|
-
type: "array"
|
|
153241
|
-
}).option("prefix", {
|
|
153242
|
-
describe: "only actions on objects with this prefix will emit notifications",
|
|
153243
|
-
requiresArg: false,
|
|
153244
|
-
type: "string"
|
|
153245
|
-
}).option("suffix", {
|
|
153246
|
-
describe: "only actions on objects with this suffix will emit notifications",
|
|
153247
|
-
type: "string"
|
|
153248
|
-
}).option("queue", {
|
|
153249
|
-
describe: "The name of the queue to which event notifications will be sent. ex '--queue my-queue'",
|
|
153250
|
-
demandOption: true,
|
|
153251
|
-
requiresArg: true,
|
|
153252
|
-
type: "string"
|
|
153253
|
-
});
|
|
153254
|
-
},
|
|
153255
|
-
async (args) => {
|
|
153256
|
-
await printWranglerBanner();
|
|
153257
|
-
const config = readConfig(args.config, args);
|
|
153258
|
-
const accountId = await requireAuth(config);
|
|
153259
|
-
const apiCreds = requireApiToken();
|
|
153260
|
-
const {
|
|
153261
|
-
bucket,
|
|
153262
|
-
queue,
|
|
153263
|
-
eventTypes,
|
|
153264
|
-
prefix = "",
|
|
153265
|
-
suffix = ""
|
|
153266
|
-
} = args;
|
|
153267
|
-
await putEventNotificationConfig(
|
|
153268
|
-
config,
|
|
153269
|
-
apiCreds,
|
|
153270
|
-
accountId,
|
|
153271
|
-
`${bucket}`,
|
|
153272
|
-
`${queue}`,
|
|
153273
|
-
eventTypes,
|
|
153274
|
-
`${prefix}`,
|
|
153275
|
-
`${suffix}`
|
|
153276
|
-
);
|
|
153277
|
-
logger.log("Configuration created successfully!");
|
|
153278
|
-
}
|
|
153442
|
+
CreateOptions4,
|
|
153443
|
+
CreateHandler4
|
|
153279
153444
|
).command(
|
|
153280
153445
|
"delete <bucket>",
|
|
153281
153446
|
"Delete event notification configuration for an R2 bucket and queue",
|
|
153282
|
-
|
|
153283
|
-
|
|
153284
|
-
describe: "The name of the bucket for which notifications will be emitted",
|
|
153285
|
-
type: "string",
|
|
153286
|
-
demandOption: true
|
|
153287
|
-
}).option("queue", {
|
|
153288
|
-
describe: "The name of the queue that is configured to receive notifications. ex '--queue my-queue'",
|
|
153289
|
-
demandOption: true,
|
|
153290
|
-
requiresArg: true,
|
|
153291
|
-
type: "string"
|
|
153292
|
-
});
|
|
153293
|
-
},
|
|
153294
|
-
async (args) => {
|
|
153295
|
-
await printWranglerBanner();
|
|
153296
|
-
const config = readConfig(args.config, args);
|
|
153297
|
-
const accountId = await requireAuth(config);
|
|
153298
|
-
const apiCreds = requireApiToken();
|
|
153299
|
-
const { bucket, queue } = args;
|
|
153300
|
-
await deleteEventNotificationConfig(
|
|
153301
|
-
config,
|
|
153302
|
-
apiCreds,
|
|
153303
|
-
accountId,
|
|
153304
|
-
`${bucket}`,
|
|
153305
|
-
`${queue}`
|
|
153306
|
-
);
|
|
153307
|
-
logger.log("Configuration deleted successfully!");
|
|
153308
|
-
}
|
|
153447
|
+
DeleteOptions2,
|
|
153448
|
+
DeleteHandler2
|
|
153309
153449
|
);
|
|
153310
153450
|
}
|
|
153311
153451
|
);
|