miniflare
Advanced tools
@@ -179,3 +179,5 @@ var __defProp = Object.defineProperty; | ||
get #maybeProducer() { | ||
return this.#producers[this.name]; | ||
return Object.values(this.#producers).find( | ||
(p) => p?.queueName === this.name | ||
); | ||
} | ||
@@ -266,13 +268,17 @@ get #maybeConsumer() { | ||
message = async (req) => { | ||
if (this.#maybeConsumer === void 0) | ||
return new Response(); | ||
validateMessageSize(req.headers); | ||
let contentType = validateContentType(req.headers), delay = validateMessageDelay(req.headers), body = Buffer2.from(await req.arrayBuffer()); | ||
return this.#maybeConsumer === void 0 ? new Response() : (this.#enqueue( | ||
let contentType = validateContentType(req.headers), delay = validateMessageDelay(req.headers) ?? this.#maybeProducer?.deliveryDelay, body = Buffer2.from(await req.arrayBuffer()); | ||
return this.#enqueue( | ||
[{ contentType, delaySecs: delay, body }], | ||
this.#maybeProducer?.deliveryDelay | ||
), new Response()); | ||
), new Response(); | ||
}; | ||
batch = async (req) => { | ||
if (this.#maybeConsumer === void 0) | ||
return new Response(); | ||
validateBatchSize(req.headers); | ||
let delay = validateMessageDelay(req.headers) ?? this.#maybeProducer?.deliveryDelay, body = QueuesBatchRequestSchema.parse(await req.json()); | ||
return this.#maybeConsumer === void 0 ? new Response() : (this.#enqueue(body.messages, delay), new Response()); | ||
return this.#enqueue(body.messages, delay), new Response(); | ||
}; | ||
@@ -279,0 +285,0 @@ }; |
{ | ||
"name": "miniflare", | ||
"version": "0.0.0-e8975a93a", | ||
"version": "0.0.0-ecd82e847", | ||
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
"undici": "^5.28.4", | ||
"workerd": "1.20240821.1", | ||
"workerd": "1.20240909.0", | ||
"ws": "^8.17.1", | ||
@@ -49,3 +49,3 @@ "youch": "^3.2.2", | ||
"@ava/typescript": "^4.1.0", | ||
"@cloudflare/workers-types": "^4.20240821.1", | ||
"@cloudflare/workers-types": "^4.20240909.0", | ||
"@microsoft/api-extractor": "^7.47.0", | ||
@@ -84,3 +84,3 @@ "@types/debug": "^4.1.7", | ||
"@cloudflare/kv-asset-handler": "0.3.4", | ||
"@cloudflare/workers-shared": "0.0.0-e8975a93a" | ||
"@cloudflare/workers-shared": "0.0.0-ecd82e847" | ||
}, | ||
@@ -87,0 +87,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
2532084
91.54%39599
82.58%48
14.29%12
100%