Module

for-http

HTTP client module for REST API interactions

View Source index.ts, line 4

Classes

HttpDispatcher

Bridges a Dispatch to an HttpAdapter by opening a ServerEventConnector that listens on the adapter's events endpoint and forwards each received event to the registered observers. In subscription mode it also syncs the locally observed topics by subscribing/unsubscribing with the SSE server, correlating each client through a x-correlation-id header (DecafHeaders.CORRELATION_ID) so the server can scope subscriptions and enforce a single connection per client.

Interfaces

HttpFlags

Interface extending RepositoryFlags with HTTP-specific options

Namespaces

axios

This module provides classes and utilities for interacting with REST APIs. It exposes repository and service classes for making HTTP requests, along with type definitions and adapters for different HTTP clients. The module includes RestRepository and RestService for API interactions.

hooks

Exposes the webhook models, subscription and delivery services, observers, middleware and utilities that implement Decaf's Observer pattern over webhooks, including topic matching, request signing and retry scheduling.

Members

# inner constant COMMIT

Stores the current git commit hash for the package. The build replaces the placeholder with the actual commit hash at publish time.

Represents the current commit hash of the module build.

View Source index.ts, line 27

# inner constant FULL_VERSION

Stores the semver version and commit hash for the package. The build replaces the placeholder with the actual <version>-<commit> value at publish time.

Represents the full version string of the module.

View Source index.ts, line 34

# inner constant VERSION

Version identifier for the module

Current version of the for-http module

View Source index.ts, line 21

Type Definitions

Object

# HttpConfig

Configuration type for HTTP connections specifying protocol and host

HTTP configuration type

Properties:
Name Type Attributes Default Description
protocol 'http' | 'https'

The HTTP protocol to use

host string

The host address

idInUrl boolean <optional>
true

When true (default), write operations (create, update) include the resource id (and composed pk parts) in the URL path, matching REST semantics. Set to false to POST/PUT against the collection URL only.

protocol "http" | "https"
host string
parsers Array <optional>
eventsListenerPath string <optional>
headers boolean <optional>
events boolean <optional>
eventsSubscription boolean <optional>
eventHeaderResolver function <optional>
idInUrl boolean <optional>

View Source types.ts, line 6