Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

miniflare

Package Overview
Dependencies
Maintainers
1
Versions
462
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

miniflare - npm Package Compare versions

Comparing version 0.0.0-f3c040016 to 0.0.0-f46330a4d

dist/src/workers/workflows/binding.worker.js

6

dist/src/workers/assets/assets-kv.worker.js

@@ -13,3 +13,7 @@ // src/workers/assets/assets-kv.worker.ts

let { filePath, contentType } = entry, response = await env[SharedBindings.MAYBE_SERVICE_BLOBS].fetch(
new URL(filePath, "http://placeholder")
new URL(
// somewhere in blobservice I think this is being decoded again
filePath.split("/").map((x) => encodeURIComponent(x)).join("/"),
"http://placeholder"
)
), newResponse = new Response(response.body, response);

@@ -16,0 +20,0 @@ return newResponse.headers.append(

11

dist/src/workers/cache/cache.worker.js

@@ -29,5 +29,5 @@ var __create = Object.create;

// ../../node_modules/.pnpm/http-cache-semantics@4.1.0/node_modules/http-cache-semantics/index.js
// ../../node_modules/.pnpm/http-cache-semantics@4.1.1/node_modules/http-cache-semantics/index.js
var require_http_cache_semantics = __commonJS({
"../../node_modules/.pnpm/http-cache-semantics@4.1.0/node_modules/http-cache-semantics/index.js"(exports, module) {
"../../node_modules/.pnpm/http-cache-semantics@4.1.1/node_modules/http-cache-semantics/index.js"(exports, module) {
"use strict";

@@ -41,2 +41,3 @@ var statusCodeCacheableByDefault = /* @__PURE__ */ new Set([

301,
308,
404,

@@ -96,6 +97,6 @@ 405,

return cc;
let parts = header.trim().split(/\s*,\s*/);
let parts = header.trim().split(/,/);
for (let part of parts) {
let [k, v] = part.split(/\s*=\s*/, 2);
cc[k] = v === void 0 ? !0 : v.replace(/^"|"$/g, "");
let [k, v] = part.split(/=/, 2);
cc[k.trim()] = v === void 0 ? !0 : v.trim().replace(/^"|"$/g, "");
}

@@ -102,0 +103,0 @@ return cc;

@@ -689,3 +689,3 @@ // ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs

function isObject(value) {
return value && typeof value == "object";
return !!value && typeof value == "object";
}

@@ -695,2 +695,5 @@ function getType(value) {

}
function isInternal(value) {
return isObject(value) && value[Symbol.for("cloudflare:internal-class")];
}
var ProxyServer = class {

@@ -710,3 +713,3 @@ constructor(_state, env) {

let type = getType(value);
if (type === "Object" && !isPlainObject(value) || type === "Promise") {
if ((type === "Object" || isInternal(value)) && !isPlainObject(value) || type === "Promise") {
let address = this.nextHeapAddress++;

@@ -713,0 +716,0 @@ this.heap.set(address, value), assert2(value !== null);

@@ -60,5 +60,7 @@ var __defProp = Object.defineProperty;

maxRetires: z.number().min(0).max(100).optional(),
// deprecated
maxRetries: z.number().min(0).max(100).optional(),
deadLetterQueue: z.ostring(),
retryDelay: QueueMessageDelaySchema
}), QueueConsumerSchema = /* @__PURE__ */ z.intersection(
}).transform((queue) => (queue.maxRetires !== void 0 && (queue.maxRetries = queue.maxRetires), queue)), QueueConsumerSchema = /* @__PURE__ */ z.intersection(
QueueConsumerOptionsSchema,

@@ -180,3 +182,5 @@ z.object({ workerName: z.string() })

get #maybeProducer() {
return this.#producers[this.name];
return Object.values(this.#producers).find(
(p) => p?.queueName === this.name
);
}

@@ -201,3 +205,3 @@ get #maybeConsumer() {

assert(consumer !== void 0);
let batchSize = consumer.maxBatchSize ?? DEFAULT_BATCH_SIZE, maxAttempts = (consumer.maxRetires ?? DEFAULT_RETRIES) + 1, maxAttemptsS = maxAttempts === 1 ? "" : "s", batch = this.#messages.splice(0, batchSize), startTime = Date.now(), endTime, response;
let batchSize = consumer.maxBatchSize ?? DEFAULT_BATCH_SIZE, maxAttempts = (consumer.maxRetries ?? DEFAULT_RETRIES) + 1, maxAttemptsS = maxAttempts === 1 ? "" : "s", batch = this.#messages.splice(0, batchSize), startTime = Date.now(), endTime, response;
try {

@@ -268,13 +272,17 @@ response = await this.#dispatchBatch(consumer.workerName, batch), endTime = Date.now();

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();
};

@@ -281,0 +289,0 @@ };

{
"name": "miniflare",
"version": "0.0.0-f3c040016",
"version": "0.0.0-f46330a4d",
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers",

@@ -41,4 +41,4 @@ "keywords": [

"undici": "^5.28.4",
"workerd": "1.20240909.0",
"ws": "^8.17.1",
"workerd": "1.20241022.0",
"ws": "^8.18.0",
"youch": "^3.2.2",

@@ -49,3 +49,3 @@ "zod": "^3.22.3"

"@ava/typescript": "^4.1.0",
"@cloudflare/workers-types": "^4.20240909.0",
"@cloudflare/workers-types": "^4.20241022.0",
"@microsoft/api-extractor": "^7.47.0",

@@ -57,3 +57,3 @@ "@types/debug": "^4.1.7",

"@types/mime": "^3.0.4",
"@types/node": "20.8.3",
"@types/node": "^18.19.59",
"@types/rimraf": "^4.0.5",

@@ -77,2 +77,3 @@ "@types/stoppable": "^1.1.1",

"expect-type": "^0.15.0",
"heap-js": "^2.5.0",
"http-cache-semantics": "^4.1.0",

@@ -85,4 +86,5 @@ "kleur": "^4.1.5",

"which": "^2.0.2",
"@cloudflare/workers-shared": "0.0.0-f3c040016",
"@cloudflare/kv-asset-handler": "0.3.4"
"@cloudflare/kv-asset-handler": "0.3.4",
"@cloudflare/workflows-shared": "0.1.1",
"@cloudflare/workers-shared": "0.0.0-f46330a4d"
},

@@ -89,0 +91,0 @@ "engines": {

@@ -217,2 +217,16 @@ # 🔥 Miniflare

### `interface WorkflowOptions`
- `name: string`
The name of the Workflow.
- `className: string`
The name of the class exported from the Worker that implements the `WorkflowEntrypoint`.
- `scriptName?`: string
The name of the script that includes the `WorkflowEntrypoint`. This is optional because it defaults to the current script if not set.
#### Core

@@ -578,2 +592,18 @@

#### Assets
- `directory?: string`
Path to serve Workers static asset files from.
- `binding?: string`
Binding name to inject as a `Fetcher` binding to allow access to static assets from within the Worker.
- `assetOptions?: { html_handling?: HTMLHandlingOptions, not_found_handling?: NotFoundHandlingOptions}`
Configuration for file-based asset routing - see [docs](https://developers.cloudflare.com/workers/static-assets/routing/#routing-configuration) for options
#### Workflows
- `workflows?: WorkflowOptions[]`
Configuration for one or more Workflows in your project.
#### Analytics Engine, Sending Email, Vectorize and Workers for Platforms

@@ -719,2 +749,6 @@

- `workflowsPersist?: Persistence`
Where to persist data stored in Workflows. See docs for `Persistence`.
#### Analytics Engine, Browser Rendering, Sending Email, Vectorize, Workers AI and Workers for Platforms

@@ -721,0 +755,0 @@

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc