UNPKG

@interopio/gateway

Version:

[![npm version](https://img.shields.io/npm/v/@interopio/gateway.svg)](https://www.npmjs.com/package/@interopio/gateway)

18 lines (12 loc) 614 B
import {IOGateway} from '../../../gateway'; export type Fetch = (endpoint: string | URL , request: Omit<RequestInit, 'signal'>, timeout: number) => Promise<Response> export type RestPublisherConfig = { endpoint: string | URL timeout?: number authentication?: { user: string, password: string } | {path?: string} | false headers?: HeadersInit fetch?: Fetch } export const fetchWithTimeout: () => Fetch; export const name = 'rest'; export function create(config: RestPublisherConfig, logger: IOGateway.Logging.Logger): (msg: 'start' | 'stop' | IOGateway.Metrics.Update) => Promise<unknown>;