reshuffle
Version:
Reshuffle is a fast, unopinionated, minimalist integration framework
26 lines (25 loc) • 1.18 kB
TypeScript
/// <reference types="node" />
import { RequestInfo, RequestInit } from 'node-fetch';
import { URL } from 'url';
import { Request, Response, NextFunction } from 'express';
import Reshuffle from '../Reshuffle';
import { BaseHttpConnector, EventConfiguration } from 'reshuffle-base-connector';
export interface HttpConnectorConfigOptions {
authKey?: string;
authScript?: string;
}
export interface HttpConnectorEventOptions {
method: string;
path: string;
}
export default class HttpConnector extends BaseHttpConnector<HttpConnectorConfigOptions, HttpConnectorEventOptions> {
on(options: HttpConnectorEventOptions, eventId?: string): EventConfiguration;
onStart(app: Reshuffle): void;
handle(req: Request, res: Response, next: NextFunction): Promise<boolean>;
onStop(): void;
fetch(url: RequestInfo, options?: RequestInit): Promise<import("node-fetch").Response>;
fetchWithRetries(url: string, options?: RequestInit, retry?: Record<string, any>): Promise<unknown>;
fetchWithTimeout(url: string, options: RequestInit, ms: number): Promise<unknown>;
formatURL(components: Record<string, any>): string;
parseURL(url: string): URL;
}