@remix-run/node
Advanced tools
Comparing version 0.0.0-experimental-db4e08b8 to 0.0.0-experimental-e0ead3bf
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
import type AbortController from "abort-controller"; | ||
import type { RequestInfo, RequestInit, Response } from "node-fetch"; | ||
import { Request as NodeRequest } from "node-fetch"; | ||
import { Request as BaseNodeRequest } from "node-fetch"; | ||
import type { UploadHandler } from "./formData"; | ||
export type { HeadersInit, RequestInfo, ResponseInit } from "node-fetch"; | ||
export { Headers, Response } from "node-fetch"; | ||
interface RemixRequestInit extends RequestInit { | ||
interface NodeRequestInit extends RequestInit { | ||
abortController?: AbortController; | ||
} | ||
declare class RemixRequest extends NodeRequest { | ||
declare class NodeRequest extends BaseNodeRequest { | ||
private abortController?; | ||
constructor(input: RequestInfo, init?: RemixRequestInit | undefined); | ||
constructor(input: RequestInfo, init?: NodeRequestInit | undefined); | ||
formData(uploadHandler?: UploadHandler): Promise<FormData>; | ||
clone(): RemixRequest; | ||
clone(): NodeRequest; | ||
} | ||
export { RemixRequest as Request, RemixRequestInit as RequestInit }; | ||
export { NodeRequest as Request, NodeRequestInit as RequestInit }; | ||
/** | ||
@@ -18,0 +18,0 @@ * A `fetch` function for node that matches the web Fetch API. Based on |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -80,3 +80,3 @@ * Copyright (c) Remix Software Inc. | ||
class RemixRequest extends nodeFetch.Request { | ||
class NodeRequest extends nodeFetch.Request { | ||
constructor(input, init) { | ||
@@ -108,3 +108,3 @@ var _init; | ||
clone() { | ||
return new RemixRequest(super.clone()); | ||
return new NodeRequest(this); | ||
} | ||
@@ -149,3 +149,3 @@ | ||
}); | ||
exports.Request = RemixRequest; | ||
exports.Request = NodeRequest; | ||
exports.fetch = fetch; |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -53,3 +53,3 @@ * Copyright (c) Remix Software Inc. | ||
let arr = this._fields[name]; | ||
return arr && arr.slice(-1)[0] || null; | ||
return (arr === null || arr === void 0 ? void 0 : arr.slice(-1)[0]) || null; | ||
} | ||
@@ -56,0 +56,0 @@ |
@@ -5,2 +5,5 @@ import type { InternalSignFunctionDoNotUseMe, InternalUnsignFunctionDoNotUseMe } from "@remix-run/server-runtime/cookieSigning"; | ||
namespace NodeJS { | ||
interface ProcessEnv { | ||
NODE_ENV: "development" | "production" | "test"; | ||
} | ||
interface Global { | ||
@@ -7,0 +10,0 @@ atob: typeof atob; |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
@@ -7,5 +7,5 @@ export { AbortController } from "abort-controller"; | ||
export { installGlobals } from "./globals"; | ||
export { parseMultipartFormData } from "./parseMultipartFormData"; | ||
export { parseMultipartFormData as unstable_parseMultipartFormData } from "./parseMultipartFormData"; | ||
export { createFileSessionStorage } from "./sessions/fileStorage"; | ||
export { createFileUploadHandler, NodeOnDiskFile } from "./upload/fileUploadHandler"; | ||
export { createMemoryUploadHandler } from "./upload/memoryUploadHandler"; | ||
export { createFileUploadHandler as unstable_createFileUploadHandler, NodeOnDiskFile } from "./upload/fileUploadHandler"; | ||
export { createMemoryUploadHandler as unstable_createMemoryUploadHandler } from "./upload/memoryUploadHandler"; |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -37,7 +37,7 @@ * Copyright (c) Remix Software Inc. | ||
exports.installGlobals = globals.installGlobals; | ||
exports.parseMultipartFormData = parseMultipartFormData.parseMultipartFormData; | ||
exports.unstable_parseMultipartFormData = parseMultipartFormData.parseMultipartFormData; | ||
exports.createFileSessionStorage = fileStorage.createFileSessionStorage; | ||
exports.NodeOnDiskFile = fileUploadHandler.NodeOnDiskFile; | ||
exports.createFileUploadHandler = fileUploadHandler.createFileUploadHandler; | ||
exports.createMemoryUploadHandler = memoryUploadHandler.createMemoryUploadHandler; | ||
exports.unstable_createFileUploadHandler = fileUploadHandler.createFileUploadHandler; | ||
exports.unstable_createMemoryUploadHandler = memoryUploadHandler.createMemoryUploadHandler; | ||
Object.defineProperty(exports, 'Headers', { | ||
@@ -44,0 +44,0 @@ enumerable: true, |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -11,2 +11,2 @@ * Copyright (c) Remix Software Inc. | ||
*/ | ||
export { createFileSessionStorage, createFileUploadHandler, createMemoryUploadHandler, parseMultipartFormData } from '@remix-run/node'; | ||
export { createFileSessionStorage, unstable_createFileUploadHandler, unstable_createMemoryUploadHandler, unstable_parseMultipartFormData } from '@remix-run/node'; |
@@ -1,1 +0,1 @@ | ||
export { createFileSessionStorage, createFileUploadHandler, createMemoryUploadHandler, parseMultipartFormData } from "@remix-run/node"; | ||
export { createFileSessionStorage, unstable_createFileUploadHandler, unstable_createMemoryUploadHandler, unstable_parseMultipartFormData } from "@remix-run/node"; |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -23,13 +23,13 @@ * Copyright (c) Remix Software Inc. | ||
}); | ||
Object.defineProperty(exports, 'createFileUploadHandler', { | ||
Object.defineProperty(exports, 'unstable_createFileUploadHandler', { | ||
enumerable: true, | ||
get: function () { return node.createFileUploadHandler; } | ||
get: function () { return node.unstable_createFileUploadHandler; } | ||
}); | ||
Object.defineProperty(exports, 'createMemoryUploadHandler', { | ||
Object.defineProperty(exports, 'unstable_createMemoryUploadHandler', { | ||
enumerable: true, | ||
get: function () { return node.createMemoryUploadHandler; } | ||
get: function () { return node.unstable_createMemoryUploadHandler; } | ||
}); | ||
Object.defineProperty(exports, 'parseMultipartFormData', { | ||
Object.defineProperty(exports, 'unstable_parseMultipartFormData', { | ||
enumerable: true, | ||
get: function () { return node.parseMultipartFormData; } | ||
get: function () { return node.unstable_parseMultipartFormData; } | ||
}); |
{ | ||
"name": "@remix-run/node", | ||
"description": "Node.js platform abstractions for Remix", | ||
"version": "0.0.0-experimental-db4e08b8", | ||
"version": "0.0.0-experimental-e0ead3bf", | ||
"license": "MIT", | ||
@@ -15,3 +15,3 @@ "repository": { | ||
"dependencies": { | ||
"@remix-run/server-runtime": "0.0.0-experimental-db4e08b8", | ||
"@remix-run/server-runtime": "0.0.0-experimental-e0ead3bf", | ||
"@types/busboy": "^0.3.1", | ||
@@ -18,0 +18,0 @@ "@types/node-fetch": "^2.5.12", |
/// <reference types="node" /> | ||
import type { Readable } from "stream"; | ||
import { Readable } from "stream"; | ||
import type { UploadHandler } from "./formData"; | ||
import { FormData as NodeFormData } from "./formData"; | ||
export declare function parseMultipartFormData(request: Request, uploadHandler: UploadHandler): Promise<FormData>; | ||
export declare function internalParseFormData(contentType: string, stream: Readable, abortController?: AbortController, uploadHandler?: UploadHandler): Promise<NodeFormData>; | ||
export declare function internalParseFormData(contentType: string, body: string | Buffer | Readable, abortController?: AbortController, uploadHandler?: UploadHandler): Promise<NodeFormData>; |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -15,2 +15,3 @@ * Copyright (c) Remix Software Inc. | ||
var stream = require('stream'); | ||
var Busboy = require('busboy'); | ||
@@ -26,5 +27,13 @@ var formData = require('./formData.js'); | ||
} | ||
async function internalParseFormData(contentType, stream, abortController, uploadHandler) { | ||
async function internalParseFormData(contentType, body, abortController, uploadHandler) { | ||
let formData$1 = new formData.FormData(); | ||
let fileWorkQueue = []; | ||
let stream$1; | ||
if (typeof body === "string" || Buffer.isBuffer(body)) { | ||
stream$1 = stream.Readable.from(body.toString()); | ||
} else { | ||
stream$1 = body; | ||
} | ||
await new Promise(async (resolve, reject) => { | ||
@@ -42,4 +51,4 @@ let busboy = new Busboy__default["default"]({ | ||
aborted = true; | ||
stream.unpipe(); | ||
stream.removeAllListeners(); | ||
stream$1.unpipe(); | ||
stream$1.removeAllListeners(); | ||
busboy.removeAllListeners(); | ||
@@ -87,7 +96,7 @@ abortController === null || abortController === void 0 ? void 0 : abortController.abort(); | ||
}); | ||
stream.on("error", abort); | ||
stream.on("aborted", abort); | ||
stream$1.on("error", abort); | ||
stream$1.on("aborted", abort); | ||
busboy.on("error", abort); | ||
busboy.on("finish", resolve); | ||
stream.pipe(busboy); | ||
stream$1.pipe(busboy); | ||
}); | ||
@@ -94,0 +103,0 @@ await Promise.all(fileWorkQueue); |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/node v0.0.0-experimental-db4e08b8 | ||
* @remix-run/node v0.0.0-experimental-e0ead3bf | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
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
41808
1149
+ Added@remix-run/server-runtime@0.0.0-experimental-e0ead3bf(transitive)
- Removed@remix-run/server-runtime@0.0.0-experimental-db4e08b8(transitive)
Updated@remix-run/server-runtime@0.0.0-experimental-e0ead3bf