full site update

This commit is contained in:
2025-07-24 18:46:24 +02:00
parent bfe2b90d8d
commit 37a6e0ab31
6912 changed files with 540482 additions and 361712 deletions

21
node_modules/node-mock-http/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

64
node_modules/node-mock-http/README.md generated vendored Normal file
View File

@@ -0,0 +1,64 @@
# node-mock-http
<!-- automd:badges color=yellow -->
[![npm version](https://img.shields.io/npm/v/node-mock-http?color=yellow)](https://npmjs.com/package/node-mock-http)
[![npm downloads](https://img.shields.io/npm/dm/node-mock-http?color=yellow)](https://npm.chart.dev/node-mock-http)
<!-- /automd -->
Node.js [`http.IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) and [`http.ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse) mocked implementations that allows emulate calling Node.js http handlers. (based on [unjs/unenv v1](https://github.com/unjs/unenv/tree/v1)).
## Usage
> [!NOTE]
> Documentation is incomplete!
```js
import { fetchNodeRequestHandler } from "node-mock-http";
const nodeHandler = (req, res) => {
res.end("OK!");
};
const res = await fetchNodeRequestHandler(
nodeHandler,
"http://example.com/test",
);
```
## Development
<details>
<summary>local development</summary>
- Clone this repository
- Install latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Build project in stub mode using `pnpm build --stub`
- Run interactive tests using `pnpm dev`
</details>
## License
<!-- automd:contributors license=MIT -->
Published under the [MIT](https://github.com/unjs/node-mock-http/blob/main/LICENSE) license.
Made by [community](https://github.com/unjs/node-mock-http/graphs/contributors) 💛
<br><br>
<a href="https://github.com/unjs/node-mock-http/graphs/contributors">
<img src="https://contrib.rocks/image?repo=unjs/node-mock-http" />
</a>
<!-- /automd -->
<!-- automd:with-automd -->
---
_🤖 auto updated with [automd](https://automd.unjs.io)_
<!-- /automd -->

View File

@@ -0,0 +1 @@
"use strict";const node_buffer=require("node:buffer");exports.Buffer=node_buffer.Buffer;

View File

@@ -0,0 +1,2 @@
export { Buffer } from 'node:buffer';
import 'node:events';

View File

@@ -0,0 +1,2 @@
export { Buffer } from 'node:buffer';
import 'node:events';

View File

@@ -0,0 +1,2 @@
export { Buffer } from 'node:buffer';
import 'node:events';

View File

@@ -0,0 +1 @@
export{Buffer}from"node:buffer";

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,25 @@
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
declare function Buffer(arg: any, encodingOrOffset: any, length: any): any;
declare namespace Buffer {
var TYPED_ARRAY_SUPPORT: boolean;
var poolSize: number;
var from: (value: any, encodingOrOffset: any, length?: any) => any;
var alloc: (size: any, fill: any, encoding: any) => Uint8Array<any>;
var allocUnsafe: (size: any) => Uint8Array<any>;
var allocUnsafeSlow: (size: any) => Uint8Array<any>;
var isBuffer: (b: any) => boolean;
var compare: (a: any, b: any) => 0 | 1 | -1;
var isEncoding: (encoding: any) => boolean;
var concat: (list: any, length?: any) => Uint8Array<any>;
var byteLength: (string: any, encoding: any) => any;
}
export { Buffer };

View File

@@ -0,0 +1,25 @@
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
declare function Buffer(arg: any, encodingOrOffset: any, length: any): any;
declare namespace Buffer {
var TYPED_ARRAY_SUPPORT: boolean;
var poolSize: number;
var from: (value: any, encodingOrOffset: any, length?: any) => any;
var alloc: (size: any, fill: any, encoding: any) => Uint8Array<any>;
var allocUnsafe: (size: any) => Uint8Array<any>;
var allocUnsafeSlow: (size: any) => Uint8Array<any>;
var isBuffer: (b: any) => boolean;
var compare: (a: any, b: any) => 0 | 1 | -1;
var isEncoding: (encoding: any) => boolean;
var concat: (list: any, length?: any) => Uint8Array<any>;
var byteLength: (string: any, encoding: any) => any;
}
export { Buffer };

View File

@@ -0,0 +1,25 @@
/**
* The Buffer constructor returns instances of `Uint8Array` that have their
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
* returns a single octet.
*
* The `Uint8Array` prototype remains unmodified.
*/
declare function Buffer(arg: any, encodingOrOffset: any, length: any): any;
declare namespace Buffer {
var TYPED_ARRAY_SUPPORT: boolean;
var poolSize: number;
var from: (value: any, encodingOrOffset: any, length?: any) => any;
var alloc: (size: any, fill: any, encoding: any) => Uint8Array<any>;
var allocUnsafe: (size: any) => Uint8Array<any>;
var allocUnsafeSlow: (size: any) => Uint8Array<any>;
var isBuffer: (b: any) => boolean;
var compare: (a: any, b: any) => 0 | 1 | -1;
var isEncoding: (encoding: any) => boolean;
var concat: (list: any, length?: any) => Uint8Array<any>;
var byteLength: (string: any, encoding: any) => any;
}
export { Buffer };

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";const node_events=require("node:events");exports.EventEmitter=node_events.EventEmitter;

View File

@@ -0,0 +1 @@
export { EventEmitter } from 'node:events';

View File

@@ -0,0 +1 @@
export { EventEmitter } from 'node:events';

View File

@@ -0,0 +1 @@
export { EventEmitter } from 'node:events';

View File

@@ -0,0 +1 @@
export{EventEmitter}from"node:events";

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,141 @@
import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
declare const kCapture: unique symbol;
declare const kShapeMode: unique symbol;
type Listener = (...args: any[]) => void;
declare class EventEmitter implements EventEmitter$1 {
_events: any;
_eventsCount: number;
_maxListeners: number | undefined;
[kCapture]: boolean;
[kShapeMode]: boolean;
static captureRejectionSymbol: symbol;
static errorMonitor: symbol;
static kMaxEventTargetListeners: symbol;
static kMaxEventTargetListenersWarned: symbol;
static usingDomains: boolean;
static get on(): typeof nodeEvents.on;
static get once(): typeof nodeEvents.once;
static get getEventListeners(): typeof nodeEvents.getEventListeners;
static get getMaxListeners(): typeof nodeEvents.getMaxListeners;
static get addAbortListener(): typeof nodeEvents.addAbortListener;
static get EventEmitterAsyncResource(): typeof EventEmitterAsyncResource;
static get EventEmitter(): typeof EventEmitter;
static setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
static listenerCount(emitter: EventEmitter$1, type: string): number | undefined;
static init(): void;
static get captureRejections(): any;
static set captureRejections(value: any);
static get defaultMaxListeners(): number;
static set defaultMaxListeners(arg: number);
constructor(opts?: any);
/**
* Increases the max listeners of the event emitter.
* @param {number} n
* @returns {EventEmitter}
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for the event emitter.
* @returns {number}
*/
getMaxListeners(): number;
/**
* Synchronously calls each of the listeners registered
* for the event.
* @param {...any} [args]
* @returns {boolean}
*/
emit(type: string | symbol, ...args: any[]): boolean;
/**
* Adds a listener to the event emitter.
* @returns {EventEmitter}
*/
addListener(type: string | symbol, listener: Listener): this;
on(type: string | symbol, listener: Listener): this;
/**
* Adds the `listener` function to the beginning of
* the listeners array.
*/
prependListener(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the event emitter.
*/
once(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the beginning of
* the listeners array.
*/
prependOnceListener(type: string | symbol, listener: Listener): this;
/**
* Removes the specified `listener` from the listeners array.
* @param {string | symbol} type
* @param {Function} listener
* @returns {EventEmitter}
*/
removeListener(type: string | symbol, listener: Listener): this;
off(type: string | symbol, listener: Listener): this;
/**
* Removes all listeners from the event emitter. (Only
* removes listeners for a specific event name if specified
* as `type`).
*/
removeAllListeners(type?: string | symbol): this;
/**
* Returns a copy of the array of listeners for the event name
* specified as `type`.
* @param {string | symbol} type
* @returns {Function[]}
*/
listeners(type: string | symbol): any[];
/**
* Returns a copy of the array of listeners and wrappers for
* the event name specified as `type`.
* @returns {Function[]}
*/
rawListeners(type: string | symbol): any[];
/**
* Returns an array listing the events for which
* the emitter has registered listeners.
* @returns {any[]}
*/
eventNames(): (string | symbol)[];
/**
* Returns the number of listeners listening to event name
*/
listenerCount(eventName: string | symbol, listener?: Listener): number;
}
declare class EventEmitterAsyncResource extends EventEmitter {
/**
* @param {{
* name?: string,
* triggerAsyncId?: number,
* requireManualDestroy?: boolean,
* }} [options]
*/
constructor(options: any);
/**
* @param {symbol,string} event
* @param {...any} args
* @returns {boolean}
*/
emit(event: string | symbol, ...args: any[]): boolean;
/**
* @returns {void}
*/
emitDestroy(): void;
/**
* @type {number}
*/
get asyncId(): any;
/**
* @type {number}
*/
get triggerAsyncId(): any;
/**
* @type {EventEmitterReferencingAsyncResource}
*/
get asyncResource(): any;
}
export { EventEmitter };

View File

@@ -0,0 +1,141 @@
import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
declare const kCapture: unique symbol;
declare const kShapeMode: unique symbol;
type Listener = (...args: any[]) => void;
declare class EventEmitter implements EventEmitter$1 {
_events: any;
_eventsCount: number;
_maxListeners: number | undefined;
[kCapture]: boolean;
[kShapeMode]: boolean;
static captureRejectionSymbol: symbol;
static errorMonitor: symbol;
static kMaxEventTargetListeners: symbol;
static kMaxEventTargetListenersWarned: symbol;
static usingDomains: boolean;
static get on(): typeof nodeEvents.on;
static get once(): typeof nodeEvents.once;
static get getEventListeners(): typeof nodeEvents.getEventListeners;
static get getMaxListeners(): typeof nodeEvents.getMaxListeners;
static get addAbortListener(): typeof nodeEvents.addAbortListener;
static get EventEmitterAsyncResource(): typeof EventEmitterAsyncResource;
static get EventEmitter(): typeof EventEmitter;
static setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
static listenerCount(emitter: EventEmitter$1, type: string): number | undefined;
static init(): void;
static get captureRejections(): any;
static set captureRejections(value: any);
static get defaultMaxListeners(): number;
static set defaultMaxListeners(arg: number);
constructor(opts?: any);
/**
* Increases the max listeners of the event emitter.
* @param {number} n
* @returns {EventEmitter}
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for the event emitter.
* @returns {number}
*/
getMaxListeners(): number;
/**
* Synchronously calls each of the listeners registered
* for the event.
* @param {...any} [args]
* @returns {boolean}
*/
emit(type: string | symbol, ...args: any[]): boolean;
/**
* Adds a listener to the event emitter.
* @returns {EventEmitter}
*/
addListener(type: string | symbol, listener: Listener): this;
on(type: string | symbol, listener: Listener): this;
/**
* Adds the `listener` function to the beginning of
* the listeners array.
*/
prependListener(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the event emitter.
*/
once(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the beginning of
* the listeners array.
*/
prependOnceListener(type: string | symbol, listener: Listener): this;
/**
* Removes the specified `listener` from the listeners array.
* @param {string | symbol} type
* @param {Function} listener
* @returns {EventEmitter}
*/
removeListener(type: string | symbol, listener: Listener): this;
off(type: string | symbol, listener: Listener): this;
/**
* Removes all listeners from the event emitter. (Only
* removes listeners for a specific event name if specified
* as `type`).
*/
removeAllListeners(type?: string | symbol): this;
/**
* Returns a copy of the array of listeners for the event name
* specified as `type`.
* @param {string | symbol} type
* @returns {Function[]}
*/
listeners(type: string | symbol): any[];
/**
* Returns a copy of the array of listeners and wrappers for
* the event name specified as `type`.
* @returns {Function[]}
*/
rawListeners(type: string | symbol): any[];
/**
* Returns an array listing the events for which
* the emitter has registered listeners.
* @returns {any[]}
*/
eventNames(): (string | symbol)[];
/**
* Returns the number of listeners listening to event name
*/
listenerCount(eventName: string | symbol, listener?: Listener): number;
}
declare class EventEmitterAsyncResource extends EventEmitter {
/**
* @param {{
* name?: string,
* triggerAsyncId?: number,
* requireManualDestroy?: boolean,
* }} [options]
*/
constructor(options: any);
/**
* @param {symbol,string} event
* @param {...any} args
* @returns {boolean}
*/
emit(event: string | symbol, ...args: any[]): boolean;
/**
* @returns {void}
*/
emitDestroy(): void;
/**
* @type {number}
*/
get asyncId(): any;
/**
* @type {number}
*/
get triggerAsyncId(): any;
/**
* @type {EventEmitterReferencingAsyncResource}
*/
get asyncResource(): any;
}
export { EventEmitter };

View File

@@ -0,0 +1,141 @@
import nodeEvents, { EventEmitter as EventEmitter$1 } from 'node:events';
declare const kCapture: unique symbol;
declare const kShapeMode: unique symbol;
type Listener = (...args: any[]) => void;
declare class EventEmitter implements EventEmitter$1 {
_events: any;
_eventsCount: number;
_maxListeners: number | undefined;
[kCapture]: boolean;
[kShapeMode]: boolean;
static captureRejectionSymbol: symbol;
static errorMonitor: symbol;
static kMaxEventTargetListeners: symbol;
static kMaxEventTargetListenersWarned: symbol;
static usingDomains: boolean;
static get on(): typeof nodeEvents.on;
static get once(): typeof nodeEvents.once;
static get getEventListeners(): typeof nodeEvents.getEventListeners;
static get getMaxListeners(): typeof nodeEvents.getMaxListeners;
static get addAbortListener(): typeof nodeEvents.addAbortListener;
static get EventEmitterAsyncResource(): typeof EventEmitterAsyncResource;
static get EventEmitter(): typeof EventEmitter;
static setMaxListeners(n?: number, ...eventTargets: (EventEmitter | EventTarget)[]): void;
static listenerCount(emitter: EventEmitter$1, type: string): number | undefined;
static init(): void;
static get captureRejections(): any;
static set captureRejections(value: any);
static get defaultMaxListeners(): number;
static set defaultMaxListeners(arg: number);
constructor(opts?: any);
/**
* Increases the max listeners of the event emitter.
* @param {number} n
* @returns {EventEmitter}
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for the event emitter.
* @returns {number}
*/
getMaxListeners(): number;
/**
* Synchronously calls each of the listeners registered
* for the event.
* @param {...any} [args]
* @returns {boolean}
*/
emit(type: string | symbol, ...args: any[]): boolean;
/**
* Adds a listener to the event emitter.
* @returns {EventEmitter}
*/
addListener(type: string | symbol, listener: Listener): this;
on(type: string | symbol, listener: Listener): this;
/**
* Adds the `listener` function to the beginning of
* the listeners array.
*/
prependListener(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the event emitter.
*/
once(type: string | symbol, listener: Listener): this;
/**
* Adds a one-time `listener` function to the beginning of
* the listeners array.
*/
prependOnceListener(type: string | symbol, listener: Listener): this;
/**
* Removes the specified `listener` from the listeners array.
* @param {string | symbol} type
* @param {Function} listener
* @returns {EventEmitter}
*/
removeListener(type: string | symbol, listener: Listener): this;
off(type: string | symbol, listener: Listener): this;
/**
* Removes all listeners from the event emitter. (Only
* removes listeners for a specific event name if specified
* as `type`).
*/
removeAllListeners(type?: string | symbol): this;
/**
* Returns a copy of the array of listeners for the event name
* specified as `type`.
* @param {string | symbol} type
* @returns {Function[]}
*/
listeners(type: string | symbol): any[];
/**
* Returns a copy of the array of listeners and wrappers for
* the event name specified as `type`.
* @returns {Function[]}
*/
rawListeners(type: string | symbol): any[];
/**
* Returns an array listing the events for which
* the emitter has registered listeners.
* @returns {any[]}
*/
eventNames(): (string | symbol)[];
/**
* Returns the number of listeners listening to event name
*/
listenerCount(eventName: string | symbol, listener?: Listener): number;
}
declare class EventEmitterAsyncResource extends EventEmitter {
/**
* @param {{
* name?: string,
* triggerAsyncId?: number,
* requireManualDestroy?: boolean,
* }} [options]
*/
constructor(options: any);
/**
* @param {symbol,string} event
* @param {...any} args
* @returns {boolean}
*/
emit(event: string | symbol, ...args: any[]): boolean;
/**
* @returns {void}
*/
emitDestroy(): void;
/**
* @type {number}
*/
get asyncId(): any;
/**
* @type {number}
*/
get triggerAsyncId(): any;
/**
* @type {EventEmitterReferencingAsyncResource}
*/
get asyncResource(): any;
}
export { EventEmitter };

File diff suppressed because one or more lines are too long

1
node_modules/node-mock-http/dist/index.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

226
node_modules/node-mock-http/dist/index.d.cts generated vendored Normal file
View File

@@ -0,0 +1,226 @@
import NodeHTTP, { IncomingMessage as IncomingMessage$1 } from 'node:http';
import * as NodeNet from 'node:net';
import { Socket as Socket$1 } from 'node:net';
import * as NodeStream from 'node:stream';
import { EventEmitter } from 'node-mock-http/_polyfill/events';
type Callback<E = Error | null | undefined> = (error?: E) => void;
type BufferEncoding = any;
type DuplexClass = new () => NodeStream.Duplex;
declare const Duplex: DuplexClass;
declare class Socket extends Duplex implements NodeNet.Socket {
__unenv__: {};
readonly bufferSize: number;
readonly bytesRead: number;
readonly bytesWritten: number;
readonly connecting: boolean;
readonly destroyed: boolean;
readonly pending: boolean;
readonly localAddress: string;
readonly localPort: number;
readonly remoteAddress?: string;
readonly remoteFamily?: string;
readonly remotePort?: number;
readonly autoSelectFamilyAttemptedAddresses: never[];
readonly readyState: NodeNet.SocketReadyState;
constructor(_options?: NodeNet.SocketConstructorOpts);
write(_buffer: Uint8Array | string, _arg1?: BufferEncoding | Callback<Error | undefined>, _arg2?: Callback<Error | undefined>): boolean;
connect(_arg1: number | string | NodeNet.SocketConnectOpts, _arg2?: string | Callback, _arg3?: Callback): this;
end(_arg1?: Callback | Uint8Array | string, _arg2?: BufferEncoding | Callback, _arg3?: Callback): this;
setEncoding(_encoding?: BufferEncoding): this;
pause(): this;
resume(): this;
setTimeout(_timeout: number, _callback?: Callback): this;
setNoDelay(_noDelay?: boolean): this;
setKeepAlive(_enable?: boolean, _initialDelay?: number): this;
address(): {};
unref(): this;
ref(): this;
destroySoon(): void;
resetAndDestroy(): this;
}
declare class Readable extends EventEmitter implements NodeStream.Readable {
__unenv__: {};
readonly readableEncoding: BufferEncoding | null;
readonly readableEnded: boolean;
readonly readableFlowing: boolean | null;
readonly readableHighWaterMark: number;
readonly readableLength: number;
readonly readableObjectMode: boolean;
readonly readableAborted: boolean;
readonly readableDidRead: boolean;
readonly closed: boolean;
readonly errored: Error | null;
readable: boolean;
destroyed: boolean;
static from(_iterable: Iterable<any> | AsyncIterable<any>, options?: NodeStream.ReadableOptions): Readable;
constructor(_opts?: NodeStream.ReadableOptions);
_read(_size: number): void;
read(_size?: number): void;
setEncoding(_encoding: BufferEncoding): this;
pause(): this;
resume(): this;
isPaused(): boolean;
unpipe(_destination?: any): this;
unshift(_chunk: any, _encoding?: BufferEncoding): void;
wrap(_oldStream: any): this;
push(_chunk: any, _encoding?: BufferEncoding): boolean;
_destroy(_error?: any, _callback?: Callback<any>): void;
destroy(error?: Error): this;
pipe<T>(_destination: T, _options?: {
end?: boolean;
}): T;
compose<T extends NodeJS.ReadableStream>(_stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, _options?: {
signal: AbortSignal;
} | undefined): T;
[Symbol.asyncDispose](): Promise<void>;
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
iterator(_options?: {
destroyOnReturn?: boolean | undefined;
} | undefined): NodeJS.AsyncIterator<any>;
map(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _options?: ArrayOptions | undefined): NodeStream.Readable;
filter(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): NodeStream.Readable;
forEach(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => void | Promise<void>, _options?: ArrayOptions | undefined): Promise<void>;
reduce(_fn: (accumulator: any, data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _initialValue?: any, _options?: ArrayOptions | undefined): Promise<any>;
find(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<any>;
findIndex(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<number>;
some(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<boolean>;
toArray(_options?: Pick<ArrayOptions, "signal"> | undefined): Promise<any[]>;
every(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean | Promise<boolean>, _options?: ArrayOptions | undefined): Promise<boolean>;
flatMap(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _options?: ArrayOptions | undefined): NodeStream.Readable;
drop(_limit: number, _options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
take(_limit: number, _options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
asIndexedPairs(_options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
}
interface ArrayOptions {
concurrency?: number;
signal?: AbortSignal;
}
declare class IncomingMessage extends Readable implements NodeHTTP.IncomingMessage {
aborted: boolean;
httpVersion: string;
httpVersionMajor: number;
httpVersionMinor: number;
complete: boolean;
connection: Socket;
socket: Socket;
headers: NodeHTTP.IncomingHttpHeaders;
trailers: {};
method: string;
url: string;
statusCode: number;
statusMessage: string;
closed: boolean;
errored: Error | null;
readable: boolean;
constructor(socket?: Socket);
get rawHeaders(): any[];
get rawTrailers(): never[];
setTimeout(_msecs: number, _callback?: () => void): this;
get headersDistinct(): Record<string, string[]>;
get trailersDistinct(): Record<string, string[]>;
}
declare class Writable extends EventEmitter implements NodeStream.Writable {
__unenv__: {};
readonly writable: boolean;
writableEnded: boolean;
writableFinished: boolean;
readonly writableHighWaterMark: number;
readonly writableLength: number;
readonly writableObjectMode: boolean;
readonly writableCorked: number;
readonly closed: boolean;
readonly errored: Error | null;
readonly writableNeedDrain: boolean;
readonly writableAborted: boolean;
destroyed: boolean;
_data: unknown;
_encoding: BufferEncoding;
constructor(_opts?: NodeStream.WritableOptions);
pipe<T>(_destenition: T, _options?: {
end?: boolean;
}): T;
_write(chunk: any, encoding: BufferEncoding, callback?: Callback): void;
_writev?(_chunks: Array<{
chunk: any;
encoding: BufferEncoding;
}>, _callback: (error?: Error | null) => void): void;
_destroy(_error: any, _callback: Callback<any>): void;
_final(_callback: Callback): void;
write(chunk: any, arg2?: BufferEncoding | Callback, arg3?: Callback): boolean;
setDefaultEncoding(_encoding: BufferEncoding): this;
end(arg1: Callback | any, arg2?: Callback | BufferEncoding, arg3?: Callback): this;
cork(): void;
uncork(): void;
destroy(_error?: Error): this;
compose<T extends NodeJS.ReadableStream>(_stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, _options?: {
signal: AbortSignal;
} | undefined): T;
}
declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse<IncomingMessage$1> {
statusCode: number;
statusMessage: string;
upgrading: boolean;
chunkedEncoding: boolean;
shouldKeepAlive: boolean;
useChunkedEncodingByDefault: boolean;
sendDate: boolean;
finished: boolean;
headersSent: boolean;
strictContentLength: boolean;
connection: Socket$1 | null;
socket: Socket$1 | null;
req: NodeHTTP.IncomingMessage;
_headers: Record<string, number | string | string[] | undefined>;
constructor(req: NodeHTTP.IncomingMessage);
assignSocket(socket: Socket$1): void;
_flush(): void;
detachSocket(_socket: Socket$1): void;
writeContinue(_callback?: Callback): void;
writeHead(statusCode: number, arg1?: string | NodeHTTP.OutgoingHttpHeaders | NodeHTTP.OutgoingHttpHeader[], arg2?: NodeHTTP.OutgoingHttpHeaders | NodeHTTP.OutgoingHttpHeader[]): this;
writeProcessing(): void;
setTimeout(_msecs: number, _callback?: Callback): this;
appendHeader(name: string, value: string | string[]): this;
setHeader(name: string, value: number | string | string[]): this;
setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
getHeader(name: string): number | string | string[] | undefined;
getHeaders(): NodeHTTP.OutgoingHttpHeaders;
getHeaderNames(): string[];
hasHeader(name: string): boolean;
removeHeader(name: string): void;
addTrailers(_headers: NodeHTTP.OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
flushHeaders(): void;
writeEarlyHints(_headers: NodeHTTP.OutgoingHttpHeaders, cb: () => void): void;
}
type MaybePromise<T> = T | Promise<T>;
type NodeRequestHandler = (req: IncomingMessage, res: ServerResponse) => MaybePromise<void | unknown>;
type NodeRequestHeaders = Record<string, string | string[]>;
type NodeResponseHeaders = Record<string, string | undefined | number | string[]>;
type AbstractRequest = {
[key: string]: any;
url?: URL | string;
method?: string;
headers?: HeadersInit | NodeRequestHeaders;
protocol?: string;
body?: any;
};
type AbstractResponse = {
body: any;
headers: NodeResponseHeaders;
status: number;
statusText: string;
};
declare function callNodeRequestHandler(handler: NodeRequestHandler, aRequest: AbstractRequest): Promise<AbstractResponse>;
declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit & AbstractRequest): Promise<Response>;
export { IncomingMessage, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler };
export type { AbstractRequest, AbstractResponse, NodeRequestHandler, NodeRequestHeaders, NodeResponseHeaders };

226
node_modules/node-mock-http/dist/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,226 @@
import NodeHTTP, { IncomingMessage as IncomingMessage$1 } from 'node:http';
import * as NodeNet from 'node:net';
import { Socket as Socket$1 } from 'node:net';
import * as NodeStream from 'node:stream';
import { EventEmitter } from 'node-mock-http/_polyfill/events';
type Callback<E = Error | null | undefined> = (error?: E) => void;
type BufferEncoding = any;
type DuplexClass = new () => NodeStream.Duplex;
declare const Duplex: DuplexClass;
declare class Socket extends Duplex implements NodeNet.Socket {
__unenv__: {};
readonly bufferSize: number;
readonly bytesRead: number;
readonly bytesWritten: number;
readonly connecting: boolean;
readonly destroyed: boolean;
readonly pending: boolean;
readonly localAddress: string;
readonly localPort: number;
readonly remoteAddress?: string;
readonly remoteFamily?: string;
readonly remotePort?: number;
readonly autoSelectFamilyAttemptedAddresses: never[];
readonly readyState: NodeNet.SocketReadyState;
constructor(_options?: NodeNet.SocketConstructorOpts);
write(_buffer: Uint8Array | string, _arg1?: BufferEncoding | Callback<Error | undefined>, _arg2?: Callback<Error | undefined>): boolean;
connect(_arg1: number | string | NodeNet.SocketConnectOpts, _arg2?: string | Callback, _arg3?: Callback): this;
end(_arg1?: Callback | Uint8Array | string, _arg2?: BufferEncoding | Callback, _arg3?: Callback): this;
setEncoding(_encoding?: BufferEncoding): this;
pause(): this;
resume(): this;
setTimeout(_timeout: number, _callback?: Callback): this;
setNoDelay(_noDelay?: boolean): this;
setKeepAlive(_enable?: boolean, _initialDelay?: number): this;
address(): {};
unref(): this;
ref(): this;
destroySoon(): void;
resetAndDestroy(): this;
}
declare class Readable extends EventEmitter implements NodeStream.Readable {
__unenv__: {};
readonly readableEncoding: BufferEncoding | null;
readonly readableEnded: boolean;
readonly readableFlowing: boolean | null;
readonly readableHighWaterMark: number;
readonly readableLength: number;
readonly readableObjectMode: boolean;
readonly readableAborted: boolean;
readonly readableDidRead: boolean;
readonly closed: boolean;
readonly errored: Error | null;
readable: boolean;
destroyed: boolean;
static from(_iterable: Iterable<any> | AsyncIterable<any>, options?: NodeStream.ReadableOptions): Readable;
constructor(_opts?: NodeStream.ReadableOptions);
_read(_size: number): void;
read(_size?: number): void;
setEncoding(_encoding: BufferEncoding): this;
pause(): this;
resume(): this;
isPaused(): boolean;
unpipe(_destination?: any): this;
unshift(_chunk: any, _encoding?: BufferEncoding): void;
wrap(_oldStream: any): this;
push(_chunk: any, _encoding?: BufferEncoding): boolean;
_destroy(_error?: any, _callback?: Callback<any>): void;
destroy(error?: Error): this;
pipe<T>(_destination: T, _options?: {
end?: boolean;
}): T;
compose<T extends NodeJS.ReadableStream>(_stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, _options?: {
signal: AbortSignal;
} | undefined): T;
[Symbol.asyncDispose](): Promise<void>;
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
iterator(_options?: {
destroyOnReturn?: boolean | undefined;
} | undefined): NodeJS.AsyncIterator<any>;
map(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _options?: ArrayOptions | undefined): NodeStream.Readable;
filter(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): NodeStream.Readable;
forEach(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => void | Promise<void>, _options?: ArrayOptions | undefined): Promise<void>;
reduce(_fn: (accumulator: any, data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _initialValue?: any, _options?: ArrayOptions | undefined): Promise<any>;
find(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<any>;
findIndex(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<number>;
some(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<boolean>;
toArray(_options?: Pick<ArrayOptions, "signal"> | undefined): Promise<any[]>;
every(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean | Promise<boolean>, _options?: ArrayOptions | undefined): Promise<boolean>;
flatMap(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _options?: ArrayOptions | undefined): NodeStream.Readable;
drop(_limit: number, _options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
take(_limit: number, _options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
asIndexedPairs(_options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
}
interface ArrayOptions {
concurrency?: number;
signal?: AbortSignal;
}
declare class IncomingMessage extends Readable implements NodeHTTP.IncomingMessage {
aborted: boolean;
httpVersion: string;
httpVersionMajor: number;
httpVersionMinor: number;
complete: boolean;
connection: Socket;
socket: Socket;
headers: NodeHTTP.IncomingHttpHeaders;
trailers: {};
method: string;
url: string;
statusCode: number;
statusMessage: string;
closed: boolean;
errored: Error | null;
readable: boolean;
constructor(socket?: Socket);
get rawHeaders(): any[];
get rawTrailers(): never[];
setTimeout(_msecs: number, _callback?: () => void): this;
get headersDistinct(): Record<string, string[]>;
get trailersDistinct(): Record<string, string[]>;
}
declare class Writable extends EventEmitter implements NodeStream.Writable {
__unenv__: {};
readonly writable: boolean;
writableEnded: boolean;
writableFinished: boolean;
readonly writableHighWaterMark: number;
readonly writableLength: number;
readonly writableObjectMode: boolean;
readonly writableCorked: number;
readonly closed: boolean;
readonly errored: Error | null;
readonly writableNeedDrain: boolean;
readonly writableAborted: boolean;
destroyed: boolean;
_data: unknown;
_encoding: BufferEncoding;
constructor(_opts?: NodeStream.WritableOptions);
pipe<T>(_destenition: T, _options?: {
end?: boolean;
}): T;
_write(chunk: any, encoding: BufferEncoding, callback?: Callback): void;
_writev?(_chunks: Array<{
chunk: any;
encoding: BufferEncoding;
}>, _callback: (error?: Error | null) => void): void;
_destroy(_error: any, _callback: Callback<any>): void;
_final(_callback: Callback): void;
write(chunk: any, arg2?: BufferEncoding | Callback, arg3?: Callback): boolean;
setDefaultEncoding(_encoding: BufferEncoding): this;
end(arg1: Callback | any, arg2?: Callback | BufferEncoding, arg3?: Callback): this;
cork(): void;
uncork(): void;
destroy(_error?: Error): this;
compose<T extends NodeJS.ReadableStream>(_stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, _options?: {
signal: AbortSignal;
} | undefined): T;
}
declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse<IncomingMessage$1> {
statusCode: number;
statusMessage: string;
upgrading: boolean;
chunkedEncoding: boolean;
shouldKeepAlive: boolean;
useChunkedEncodingByDefault: boolean;
sendDate: boolean;
finished: boolean;
headersSent: boolean;
strictContentLength: boolean;
connection: Socket$1 | null;
socket: Socket$1 | null;
req: NodeHTTP.IncomingMessage;
_headers: Record<string, number | string | string[] | undefined>;
constructor(req: NodeHTTP.IncomingMessage);
assignSocket(socket: Socket$1): void;
_flush(): void;
detachSocket(_socket: Socket$1): void;
writeContinue(_callback?: Callback): void;
writeHead(statusCode: number, arg1?: string | NodeHTTP.OutgoingHttpHeaders | NodeHTTP.OutgoingHttpHeader[], arg2?: NodeHTTP.OutgoingHttpHeaders | NodeHTTP.OutgoingHttpHeader[]): this;
writeProcessing(): void;
setTimeout(_msecs: number, _callback?: Callback): this;
appendHeader(name: string, value: string | string[]): this;
setHeader(name: string, value: number | string | string[]): this;
setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
getHeader(name: string): number | string | string[] | undefined;
getHeaders(): NodeHTTP.OutgoingHttpHeaders;
getHeaderNames(): string[];
hasHeader(name: string): boolean;
removeHeader(name: string): void;
addTrailers(_headers: NodeHTTP.OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
flushHeaders(): void;
writeEarlyHints(_headers: NodeHTTP.OutgoingHttpHeaders, cb: () => void): void;
}
type MaybePromise<T> = T | Promise<T>;
type NodeRequestHandler = (req: IncomingMessage, res: ServerResponse) => MaybePromise<void | unknown>;
type NodeRequestHeaders = Record<string, string | string[]>;
type NodeResponseHeaders = Record<string, string | undefined | number | string[]>;
type AbstractRequest = {
[key: string]: any;
url?: URL | string;
method?: string;
headers?: HeadersInit | NodeRequestHeaders;
protocol?: string;
body?: any;
};
type AbstractResponse = {
body: any;
headers: NodeResponseHeaders;
status: number;
statusText: string;
};
declare function callNodeRequestHandler(handler: NodeRequestHandler, aRequest: AbstractRequest): Promise<AbstractResponse>;
declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit & AbstractRequest): Promise<Response>;
export { IncomingMessage, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler };
export type { AbstractRequest, AbstractResponse, NodeRequestHandler, NodeRequestHeaders, NodeResponseHeaders };

226
node_modules/node-mock-http/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,226 @@
import NodeHTTP, { IncomingMessage as IncomingMessage$1 } from 'node:http';
import * as NodeNet from 'node:net';
import { Socket as Socket$1 } from 'node:net';
import * as NodeStream from 'node:stream';
import { EventEmitter } from 'node-mock-http/_polyfill/events';
type Callback<E = Error | null | undefined> = (error?: E) => void;
type BufferEncoding = any;
type DuplexClass = new () => NodeStream.Duplex;
declare const Duplex: DuplexClass;
declare class Socket extends Duplex implements NodeNet.Socket {
__unenv__: {};
readonly bufferSize: number;
readonly bytesRead: number;
readonly bytesWritten: number;
readonly connecting: boolean;
readonly destroyed: boolean;
readonly pending: boolean;
readonly localAddress: string;
readonly localPort: number;
readonly remoteAddress?: string;
readonly remoteFamily?: string;
readonly remotePort?: number;
readonly autoSelectFamilyAttemptedAddresses: never[];
readonly readyState: NodeNet.SocketReadyState;
constructor(_options?: NodeNet.SocketConstructorOpts);
write(_buffer: Uint8Array | string, _arg1?: BufferEncoding | Callback<Error | undefined>, _arg2?: Callback<Error | undefined>): boolean;
connect(_arg1: number | string | NodeNet.SocketConnectOpts, _arg2?: string | Callback, _arg3?: Callback): this;
end(_arg1?: Callback | Uint8Array | string, _arg2?: BufferEncoding | Callback, _arg3?: Callback): this;
setEncoding(_encoding?: BufferEncoding): this;
pause(): this;
resume(): this;
setTimeout(_timeout: number, _callback?: Callback): this;
setNoDelay(_noDelay?: boolean): this;
setKeepAlive(_enable?: boolean, _initialDelay?: number): this;
address(): {};
unref(): this;
ref(): this;
destroySoon(): void;
resetAndDestroy(): this;
}
declare class Readable extends EventEmitter implements NodeStream.Readable {
__unenv__: {};
readonly readableEncoding: BufferEncoding | null;
readonly readableEnded: boolean;
readonly readableFlowing: boolean | null;
readonly readableHighWaterMark: number;
readonly readableLength: number;
readonly readableObjectMode: boolean;
readonly readableAborted: boolean;
readonly readableDidRead: boolean;
readonly closed: boolean;
readonly errored: Error | null;
readable: boolean;
destroyed: boolean;
static from(_iterable: Iterable<any> | AsyncIterable<any>, options?: NodeStream.ReadableOptions): Readable;
constructor(_opts?: NodeStream.ReadableOptions);
_read(_size: number): void;
read(_size?: number): void;
setEncoding(_encoding: BufferEncoding): this;
pause(): this;
resume(): this;
isPaused(): boolean;
unpipe(_destination?: any): this;
unshift(_chunk: any, _encoding?: BufferEncoding): void;
wrap(_oldStream: any): this;
push(_chunk: any, _encoding?: BufferEncoding): boolean;
_destroy(_error?: any, _callback?: Callback<any>): void;
destroy(error?: Error): this;
pipe<T>(_destination: T, _options?: {
end?: boolean;
}): T;
compose<T extends NodeJS.ReadableStream>(_stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, _options?: {
signal: AbortSignal;
} | undefined): T;
[Symbol.asyncDispose](): Promise<void>;
[Symbol.asyncIterator](): NodeJS.AsyncIterator<any>;
iterator(_options?: {
destroyOnReturn?: boolean | undefined;
} | undefined): NodeJS.AsyncIterator<any>;
map(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _options?: ArrayOptions | undefined): NodeStream.Readable;
filter(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): NodeStream.Readable;
forEach(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => void | Promise<void>, _options?: ArrayOptions | undefined): Promise<void>;
reduce(_fn: (accumulator: any, data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _initialValue?: any, _options?: ArrayOptions | undefined): Promise<any>;
find(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<any>;
findIndex(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<number>;
some(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean, _options?: ArrayOptions | undefined): Promise<boolean>;
toArray(_options?: Pick<ArrayOptions, "signal"> | undefined): Promise<any[]>;
every(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => boolean | Promise<boolean>, _options?: ArrayOptions | undefined): Promise<boolean>;
flatMap(_fn: (data: any, options?: Pick<ArrayOptions, "signal"> | undefined) => any, _options?: ArrayOptions | undefined): NodeStream.Readable;
drop(_limit: number, _options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
take(_limit: number, _options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
asIndexedPairs(_options?: Pick<ArrayOptions, "signal"> | undefined): NodeStream.Readable;
}
interface ArrayOptions {
concurrency?: number;
signal?: AbortSignal;
}
declare class IncomingMessage extends Readable implements NodeHTTP.IncomingMessage {
aborted: boolean;
httpVersion: string;
httpVersionMajor: number;
httpVersionMinor: number;
complete: boolean;
connection: Socket;
socket: Socket;
headers: NodeHTTP.IncomingHttpHeaders;
trailers: {};
method: string;
url: string;
statusCode: number;
statusMessage: string;
closed: boolean;
errored: Error | null;
readable: boolean;
constructor(socket?: Socket);
get rawHeaders(): any[];
get rawTrailers(): never[];
setTimeout(_msecs: number, _callback?: () => void): this;
get headersDistinct(): Record<string, string[]>;
get trailersDistinct(): Record<string, string[]>;
}
declare class Writable extends EventEmitter implements NodeStream.Writable {
__unenv__: {};
readonly writable: boolean;
writableEnded: boolean;
writableFinished: boolean;
readonly writableHighWaterMark: number;
readonly writableLength: number;
readonly writableObjectMode: boolean;
readonly writableCorked: number;
readonly closed: boolean;
readonly errored: Error | null;
readonly writableNeedDrain: boolean;
readonly writableAborted: boolean;
destroyed: boolean;
_data: unknown;
_encoding: BufferEncoding;
constructor(_opts?: NodeStream.WritableOptions);
pipe<T>(_destenition: T, _options?: {
end?: boolean;
}): T;
_write(chunk: any, encoding: BufferEncoding, callback?: Callback): void;
_writev?(_chunks: Array<{
chunk: any;
encoding: BufferEncoding;
}>, _callback: (error?: Error | null) => void): void;
_destroy(_error: any, _callback: Callback<any>): void;
_final(_callback: Callback): void;
write(chunk: any, arg2?: BufferEncoding | Callback, arg3?: Callback): boolean;
setDefaultEncoding(_encoding: BufferEncoding): this;
end(arg1: Callback | any, arg2?: Callback | BufferEncoding, arg3?: Callback): this;
cork(): void;
uncork(): void;
destroy(_error?: Error): this;
compose<T extends NodeJS.ReadableStream>(_stream: T | ((source: any) => void) | Iterable<T> | AsyncIterable<T>, _options?: {
signal: AbortSignal;
} | undefined): T;
}
declare class ServerResponse extends Writable implements NodeHTTP.ServerResponse<IncomingMessage$1> {
statusCode: number;
statusMessage: string;
upgrading: boolean;
chunkedEncoding: boolean;
shouldKeepAlive: boolean;
useChunkedEncodingByDefault: boolean;
sendDate: boolean;
finished: boolean;
headersSent: boolean;
strictContentLength: boolean;
connection: Socket$1 | null;
socket: Socket$1 | null;
req: NodeHTTP.IncomingMessage;
_headers: Record<string, number | string | string[] | undefined>;
constructor(req: NodeHTTP.IncomingMessage);
assignSocket(socket: Socket$1): void;
_flush(): void;
detachSocket(_socket: Socket$1): void;
writeContinue(_callback?: Callback): void;
writeHead(statusCode: number, arg1?: string | NodeHTTP.OutgoingHttpHeaders | NodeHTTP.OutgoingHttpHeader[], arg2?: NodeHTTP.OutgoingHttpHeaders | NodeHTTP.OutgoingHttpHeader[]): this;
writeProcessing(): void;
setTimeout(_msecs: number, _callback?: Callback): this;
appendHeader(name: string, value: string | string[]): this;
setHeader(name: string, value: number | string | string[]): this;
setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
getHeader(name: string): number | string | string[] | undefined;
getHeaders(): NodeHTTP.OutgoingHttpHeaders;
getHeaderNames(): string[];
hasHeader(name: string): boolean;
removeHeader(name: string): void;
addTrailers(_headers: NodeHTTP.OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
flushHeaders(): void;
writeEarlyHints(_headers: NodeHTTP.OutgoingHttpHeaders, cb: () => void): void;
}
type MaybePromise<T> = T | Promise<T>;
type NodeRequestHandler = (req: IncomingMessage, res: ServerResponse) => MaybePromise<void | unknown>;
type NodeRequestHeaders = Record<string, string | string[]>;
type NodeResponseHeaders = Record<string, string | undefined | number | string[]>;
type AbstractRequest = {
[key: string]: any;
url?: URL | string;
method?: string;
headers?: HeadersInit | NodeRequestHeaders;
protocol?: string;
body?: any;
};
type AbstractResponse = {
body: any;
headers: NodeResponseHeaders;
status: number;
statusText: string;
};
declare function callNodeRequestHandler(handler: NodeRequestHandler, aRequest: AbstractRequest): Promise<AbstractResponse>;
declare function fetchNodeRequestHandler(handler: NodeRequestHandler, url: string | URL, init?: RequestInit & AbstractRequest): Promise<Response>;
export { IncomingMessage, ServerResponse, callNodeRequestHandler, fetchNodeRequestHandler };
export type { AbstractRequest, AbstractResponse, NodeRequestHandler, NodeRequestHeaders, NodeResponseHeaders };

1
node_modules/node-mock-http/dist/index.mjs generated vendored Normal file

File diff suppressed because one or more lines are too long

63
node_modules/node-mock-http/package.json generated vendored Normal file
View File

@@ -0,0 +1,63 @@
{
"name": "node-mock-http",
"version": "1.0.1",
"description": "",
"repository": "unjs/node-mock-http",
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"./_polyfill/buffer": {
"import": {
"node": "./dist/_polyfill/buffer/node.mjs",
"default": "./dist/_polyfill/buffer/nodeless.mjs"
},
"require": {
"node": "./dist/_polyfill/buffer/node.cjs",
"default": "./dist/_polyfill/buffer/nodeless.cjs"
}
},
"./_polyfill/events": {
"import": {
"node": "./dist/_polyfill/events/node.mjs",
"default": "./dist/_polyfill/events/nodeless.mjs"
},
"require": {
"node": "./dist/_polyfill/events/node.cjs",
"default": "./dist/_polyfill/events/nodeless.cjs"
}
}
},
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild --minify",
"dev": "vitest dev --coverage",
"lint": "eslint . && prettier -c .",
"lint:fix": "automd && eslint . --fix && prettier -w .",
"prepack": "pnpm build",
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
"test:types": "tsc --noEmit --skipLibCheck"
},
"devDependencies": {
"@types/node": "^24.0.4",
"@vitest/coverage-v8": "^3.2.4",
"automd": "^0.4.0",
"changelogen": "^0.6.1",
"eslint": "^9.29.0",
"eslint-config-unjs": "^0.4.2",
"jiti": "^2.4.2",
"prettier": "^3.6.1",
"typescript": "^5.8.3",
"unbuild": "^3.5.0",
"vitest": "^3.2.4"
},
"packageManager": "pnpm@10.12.3"
}