miniflare
Advanced tools
Comparing version 3.20240909.1 to 3.20240909.2
@@ -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": "3.20240909.1", | ||
"version": "3.20240909.2", | ||
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -82,3 +82,3 @@ "keywords": [ | ||
"@cloudflare/kv-asset-handler": "0.3.4", | ||
"@cloudflare/workers-shared": "0.5.1" | ||
"@cloudflare/workers-shared": "0.5.3" | ||
}, | ||
@@ -85,0 +85,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2531473
39577