Skip to content

PURISTA API / Modules / @purista/base-http-bridge

Module: @purista/base-http-bridge

Table of contents

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

HttpEventBridgeConfig

Ƭ HttpEventBridgeConfig: Object

Type declaration

NameTypeDescription
apiPrefix?stringthe prefix to be used if the command is configured as REST api endpoint according to the OpenAPI defintion needs to enableRestApiExpose set to true Default ts /api
commandPayloadAsCloudEvent?booleancommand invocations are wrapped in CloudEvent Link https://github.com/cloudevents/spec/tree/v1.0 Default ts false
enableHttpCompression?booleanenable HTTP compression in web server Default ts true
enableRestApiExpose?booleanexpose commands as regular REST endpoints when they are configured as endpoints Default ts true
name?stringname of the bridge Default ts HttpEventBridge
pathPrefix?stringthe prefix to be used for exposing commands as endpoints expecting a event bus message Default ts purista
serve(options: { fetch: (request: Request) => Promise<unknown> | unknown ; hostname?: string ; port?: number }) => Server | Http2Server | Http2SecureServerThe serve function is depending on the runtime. - Bun: Bun.serve - Node.js: serve function from additional package @hono/hono-node-server - Deno: serve function from package https://deno.land/std/http/server.ts See https://hono.dev
serverHost?stringHost of the server. Default ts 127.0.0.1
serverPort?numberPort of the server. Default ts 8080
subscriptionPayloadAsCloudEvent?booleansubscription invocations are wrapped in CloudEvent Link https://github.com/cloudevents/spec/tree/v1.0 Default ts false

Defined in

base-http-bridge/src/HttpEventBridge/types/HttpEventBridgeConfig.ts:4


RouterFunction

Ƭ RouterFunction<T>: (this: T, c: Context) => Promise<Response>

Type parameters

NameType
Textends HttpEventBridge<HttpEventBridgeConfig> = HttpEventBridge<HttpEventBridgeConfig>

Type declaration

▸ (this, c): Promise<Response>

Parameters
NameType
thisT
cContext
Returns

Promise<Response>

Defined in

base-http-bridge/src/HttpEventBridge/types/RouterFunction.ts:6

Variables

puristaVersion

Const puristaVersion: "1.11.0"

Defined in

base-http-bridge/src/version.ts:1

Functions

getDefaultHttpEventBridgeConfig

getDefaultHttpEventBridgeConfig(): Object

Returns

Object

NameTypeDescription
apiPrefix?stringthe prefix to be used if the command is configured as REST api endpoint according to the OpenAPI defintion needs to enableRestApiExpose set to true Default ts /api
commandPayloadAsCloudEvent?booleancommand invocations are wrapped in CloudEvent Link https://github.com/cloudevents/spec/tree/v1.0 Default ts false
defaultCommandTimeout?numberOverwrite the hardcoded default timeout of command invocations
enableHttpCompression?booleanenable HTTP compression in web server Default ts true
enableRestApiExpose?booleanexpose commands as regular REST endpoints when they are configured as endpoints Default ts true
instanceId?stringThe instance id of the event bridge. If not set, a id will generated each time a instance is created. Use this if there is a need to always have the same instance id.
logLevel?LogLevelNameIf no logger instance is given, use this log level
logger?LoggerA logger instance
name?stringname of the bridge Default ts HttpEventBridge
pathPrefix?stringthe prefix to be used for exposing commands as endpoints expecting a event bus message Default ts purista
serverHost?stringHost of the server. Default ts 127.0.0.1
serverPort?numberPort of the server. Default ts 8080
spanProcessor?SpanProcessorA OpenTelemetry span processor
subscriptionPayloadAsCloudEvent?booleansubscription invocations are wrapped in CloudEvent Link https://github.com/cloudevents/spec/tree/v1.0 Default ts false

Defined in

base-http-bridge/src/HttpEventBridge/getDefaultHttpEventBridgeConfig.impl.ts:5