miniflare
Advanced tools
Comparing version 0.0.0-9442ec755 to 0.0.0-9649dbc74
@@ -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-9442ec755", | ||
"version": "0.0.0-9649dbc74", | ||
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -81,4 +81,4 @@ "keywords": [ | ||
"which": "^2.0.2", | ||
"@cloudflare/workers-shared": "0.0.0-9442ec755", | ||
"@cloudflare/kv-asset-handler": "0.3.4" | ||
"@cloudflare/kv-asset-handler": "0.3.4", | ||
"@cloudflare/workers-shared": "0.0.0-9649dbc74" | ||
}, | ||
@@ -85,0 +85,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
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
2532084
39599
391