Packages · @purista/core

@purista/core

This is the main package of PURISTA.

Signature

@purista/core.ts typescript
@purista/core

Enumerations

5 entries

EBMessageType

Enums

Source
EBMessageType.ts typescript
enum EBMessageType

Type of event bridge message

PuristaSpanName

Enums

Source
PuristaSpanName.ts typescript
enum PuristaSpanName

Opentelemetry span names used by PURISTA framework

PuristaSpanTag

Enums

Source
PuristaSpanTag.ts typescript
enum PuristaSpanTag

Opentelemetry tags set by PURISTA framework

StatusCode

Enums

Source
StatusCode.ts typescript
enum StatusCode

Message and error status codes. The codes are based on HTTP status codes

StoreType

Enums

Source
StoreType.ts typescript
enum StoreType

Classes

14 entries

AgentQueueBuilder

Classes

Source
AgentQueueBuilder.ts typescript
class AgentQueueBuilder<S>

Builds an attached PURISTA agent from normal core queue, worker, command, stream definitions, and a provider-neutral agent manifest.

ClientBuilder

Classes

Source
ClientBuilder.ts typescript
class ClientBuilder

ClientBuilder to generate clients, based on service definitions.

DefaultLogger

Classes

Source
DefaultLogger.ts typescript
class DefaultLogger

GenericEventEmitter

Classes

Source
GenericEventEmitter.ts typescript
class GenericEventEmitter<T>

HandledError

Classes

Source
HandledError.ts typescript
class HandledError

A handled error is an error which is handled or thrown by business logic. It is wanted to expose it the outside world. Scenarios are input validation failures or "404 Not Found" errors which should be returned to the caller.

HttpClient

Classes

Source
HttpClient.ts typescript
class HttpClient<CustomConfig>

HTTP client with JSON helpers, timeout handling, tracing, metrics, and normalized errors.

Logger

Classes

Source
Logger.ts typescript
class Logger

PuristaMetricsRecorder

Classes

Source
PuristaMetricsRecorder.ts typescript
class PuristaMetricsRecorder

OpenTelemetry API backed PURISTA metrics recorder.

QueueDefinitionBuilder

Classes

Source
QueueDefinitionBuilder.ts typescript
class QueueDefinitionBuilder

Builds a durable queue contract for background work.

QueueWorkerBuilder

Classes

Source
QueueWorkerBuilder.ts typescript
class QueueWorkerBuilder

Builds a queue worker definition for one queue.

ScheduleDefinitionBuilder

Classes

Source
ScheduleDefinitionBuilder.ts typescript
class ScheduleDefinitionBuilder

Builds a schedule contract for an external scheduler.

StreamDefinitionBuilder

Classes

Source
StreamDefinitionBuilder.ts typescript
class StreamDefinitionBuilder<S, C>

Builds a stream definition for incremental output or aggregate stream results.

SubscriptionConsumerControlError

Classes

Source
SubscriptionConsumerControlError.ts typescript
class SubscriptionConsumerControlError

UnhandledError

Classes

Source
UnhandledError.ts typescript
class UnhandledError

A unhandled error will be thrown if some error response is returned during invoking a service function or when the invocation timed out. This error is not handled by business logic and it is maybe unwanted to expose this error outside.

Interfaces

11 entries

GlobalContext

Interfaces

Source
GlobalContext.ts typescript
interface GlobalContext

Context passed to all submodules

IEmitter

Interfaces

Source
IEmitter.ts typescript
interface IEmitter<T>

ILogger

Interfaces

Source
ILogger.ts typescript
interface ILogger

MemoryMetricRecord

Interfaces

Source
MemoryMetricRecord.ts typescript
interface MemoryMetricRecord

Deterministic metric record captured by the memory recorder.

PuristaMetricDefinition

Interfaces

Source
PuristaMetricDefinition.ts typescript
interface PuristaMetricDefinition<AttributesSchema>

Declares one framework or application metric.

PuristaMetricsRecorderInterface

Interfaces

Source
PuristaMetricsRecorderInterface.ts typescript
interface PuristaMetricsRecorderInterface

A provider-neutral recorder used by framework code and metric contexts.

PuristaMetricsRuntimeOptions

Interfaces

Source
PuristaMetricsRuntimeOptions.ts typescript
interface PuristaMetricsRuntimeOptions

Runtime metrics options consumed by PURISTA recorders.

RestClient

Interfaces

Source
RestClient.ts typescript
interface RestClient

REST API client abstraction for JSON-oriented HTTP calls.

StreamHandle

Interfaces

Source
StreamHandle.ts typescript
interface StreamHandle<Chunk, Final>

StreamWriter

Interfaces

Source
StreamWriter.ts typescript
interface StreamWriter<Chunk, Final>

TransformSchemaObjectOptions

Interfaces

Source
TransformSchemaObjectOptions.ts typescript
interface TransformSchemaObjectOptions

Type Aliases

233 entries

addPrefixToObject

Types

Source
addPrefixToObject.ts typescript
type addPrefixToObject = mapped

Helper for better typescript type. All keys of given object must start with the given prefix. Otherwise Typescript will complain.

AgentDefinition

Types

Source
AgentDefinition.ts typescript
type AgentDefinition = void

Attached agent definition before expansion into service definitions.

AgentExecutionDefinition

Types

Source
AgentExecutionDefinition.ts typescript
type AgentExecutionDefinition = { definition: HarnessAgentDefinition<any, any, any>; kind: "harnessAgent" } | { definition: HarnessWorkflowDefinition<any, any, any>; kind: "harnessWorkflow" } | { handler: AgentHandler<Payload, Parameter, Resources, Models, CommandTools, AgentTools, Output, Metrics>; kind: "runFunction" }

Internal execution definition selected by exactly one agent execution setter.

AgentExecutionKind

Types

Source
AgentExecutionKind.ts typescript
type AgentExecutionKind = "harnessAgent" | "harnessWorkflow" | "runFunction"

Execution implementation kind used by an attached agent definition.

AgentExecutionPolicy

Types

Source
AgentExecutionPolicy.ts typescript
type AgentExecutionPolicy = void

Queue execution policy applied to the generated agent worker and queue.

AgentHandler

Types

Source
AgentHandler.ts typescript
type AgentHandler = (context: AgentHandlerContext<Payload, Parameter, Resources, Models, CommandTools, AgentTools, Metrics>) => Promise<Output>

Run function shape accepted by `AgentQueueBuilder.setRunFunction(...)`.

AgentHandlerContext

Types

Source
AgentHandlerContext.ts typescript
type AgentHandlerContext = void

Context passed to an attached agent run function.

AgentHandlerModelBindings

Types

Source
AgentHandlerModelBindings.ts typescript
type AgentHandlerModelBindings = mapped

Typed model handles exposed to an agent run function.

AgentHttpExposure

Types

Source
AgentHttpExposure.ts typescript
type AgentHttpExposure = void

HTTP projection metadata for the generated agent command or stream.

AgentInvokeMap

Types

Source
AgentInvokeMap.ts typescript
type AgentInvokeMap = mapped

Typed child-agent invocation map exposed at `context.invoke.agents`.

AgentManifest

Types

Source
AgentManifest.ts typescript
type AgentManifest = void

Provider-neutral manifest describing an attached PURISTA agent.

AgentModelBinding

Types

Source
AgentModelBinding.ts typescript
type AgentModelBinding = void

Declares a model alias required by an attached PURISTA agent.

AgentModelCapability

Types

Source
AgentModelCapability.ts typescript
type AgentModelCapability = ModelCapability

Model capability names supported by `@purista/harness` model bindings.

AgentQueueBuilderTypes

Types

Source
AgentQueueBuilderTypes.ts typescript
type AgentQueueBuilderTypes = void

Type accumulator used by `AgentQueueBuilder` to preserve typed schemas, tools, models, and metrics.

AgentQueueResultPolicy

Types

Source
AgentQueueResultPolicy.ts typescript
type AgentQueueResultPolicy = void

Controls how generated queues persist and/or emit agent worker completion metadata.

AgentQueueResultPolicyMode

Types

Source
AgentQueueResultPolicyMode.ts typescript
type AgentQueueResultPolicyMode = "none" | "event" | "state" | "state-and-event"

Storage or event side effect used for queued agent run results.

AgentResponseMode

Types

Source
AgentResponseMode.ts typescript
type AgentResponseMode = "accepted" | "status" | "stream" | "event" | "callback"

Public response contract exposed by the generated agent command or stream.

AgentResponseModeOptions

Types

Source
AgentResponseModeOptions.ts typescript
type AgentResponseModeOptions = void

Options for long-running agent response contracts.

AgentRunEvent

Types

Source
AgentRunEvent.ts typescript
type AgentRunEvent = void

Harness run event decorated with PURISTA agent identity metadata.

AgentRunIdentity

Types

Source
AgentRunIdentity.ts typescript
type AgentRunIdentity = void

Stable run identity propagated through attached agent execution events and results.

AgentRunResult

Types

Source
AgentRunResult.ts typescript
type AgentRunResult = void

Aggregate result returned by an attached agent runtime.

AgentRuntimeInvocationInput

Types

Source
AgentRuntimeInvocationInput.ts typescript
type AgentRuntimeInvocationInput = void

Aggregate invocation input passed from generated PURISTA definitions into the agent runtime.

AgentRuntimeModelBinding

Types

Source
AgentRuntimeModelBinding.ts typescript
type AgentRuntimeModelBinding = { capabilities: typeOperator; defaults: ModelDefaults; model: string; provider: ModelProvider; providerOptions: Record<string, unknown> } & Partial<Pick<Binding, "model">>

AgentRuntimeModelBindings

Types

Source
AgentRuntimeModelBindings.ts typescript
type AgentRuntimeModelBindings = mapped

Runtime model bindings keyed by every model alias declared on an agent builder.

AgentRuntimeOptions

Types

Source
AgentRuntimeOptions.ts typescript
type AgentRuntimeOptions = void

Runtime options required to initialize attached agents for a service instance.

AgentRuntimeRef

Types

Source
AgentRuntimeRef.ts typescript
type AgentRuntimeRef = void

Mutable runtime reference bound when the owning service instance is created.

AgentRuntimeStreamInvocationInput

Types

Source
AgentRuntimeStreamInvocationInput.ts typescript
type AgentRuntimeStreamInvocationInput = AgentRuntimeInvocationInput & { writer: { close: void; fail: void; onCancel: void; write: void } }

Streaming invocation input passed from generated PURISTA stream definitions into the agent runtime.

AgentSandboxPolicy

Types

Source
AgentSandboxPolicy.ts typescript
type AgentSandboxPolicy = void

Optional sandbox adapter configuration passed through to the agent runtime.

AgentSessionPolicy

Types

Source
AgentSessionPolicy.ts typescript
type AgentSessionPolicy = { mode: "ephemeral" } | { mode: "conversation"; payloadPath: typeOperator }

Session behavior used by the harness runtime for each agent run.

AllowedAgentDefinition

Types

Source
AllowedAgentDefinition.ts typescript
type AllowedAgentDefinition = void

Declares one attached agent that this attached agent may call.

AllowedCommandToolDefinition

Types

Source
AllowedCommandToolDefinition.ts typescript
type AllowedCommandToolDefinition = void

Declares one service command that an attached agent may call as a typed tool.

AnyAgentQueueBuilderTypes

Types

Source
AnyAgentQueueBuilderTypes.ts typescript
type AnyAgentQueueBuilderTypes = AgentQueueBuilderTypes<Schema, Schema, Schema, Record<string, unknown>, Record<string, AgentModelBinding>, Record<string, AllowedCommandToolDefinition>, Record<string, AllowedAgentDefinition>, AgentExecutionKind | undefined, PuristaMetricDefinitions>

Broad agent builder type used where any attached agent definition is accepted.

AttachedAgentDefinition

Types

Source
AttachedAgentDefinition.ts typescript
type AttachedAgentDefinition = AgentDefinition<S> & { command: AttachedCoreDefinition & { commandName: string }; queue: AttachedCoreDefinition & { queueName: string }; stream: AttachedCoreDefinition & { streamName: string }; worker: AttachedCoreDefinition & { name: string; queueName: string } }

Agent plus the generated queue, worker, command, and stream definitions added to a service.

AttachedCoreDefinition

Types

Source
AttachedCoreDefinition.ts typescript
type AttachedCoreDefinition = object

Core definition metadata attached to generated queue, worker, command, and stream artifacts.

AuthCredentials

Types

Source
AuthCredentials.ts typescript
type AuthCredentials = void

HTTP authentication information kept in memory by HttpClient.

BrokerHeaderCommandMsg

Types

Source
BrokerHeaderCommandMsg.ts typescript
type BrokerHeaderCommandMsg = Prettify<BrokerHeaderCustomMsg & { receiverInstanceId: InstanceId; receiverServiceName: string; receiverServiceTarget: string; receiverServiceVersion: string }>

BrokerHeaderCommandResponseMsg

Types

Source
BrokerHeaderCommandResponseMsg.ts typescript
type BrokerHeaderCommandResponseMsg = Prettify<BrokerHeaderCommandMsg & { receiverInstanceId: InstanceId }>

BrokerHeaderCustomMsg

Types

Source
BrokerHeaderCustomMsg.ts typescript
type BrokerHeaderCustomMsg = void

ClientBuilderConfig

Types

Source
ClientBuilderConfig.ts typescript
type ClientBuilderConfig = z.infer<typeof httpClientConfigSchema>

ClientBuilderEvents

Types

Source
ClientBuilderEvents.ts typescript
type ClientBuilderEvents = void

CloudEvent

Types

Source
CloudEvent.ts typescript
type CloudEvent = void

Command

Types

Source
Command.ts typescript
type Command = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.Command; payload: { parameter: ParameterType; payload: PayloadType }; receiver: EBMessageAddress } & EBMessageBase>

Command is a event bridge message, which is emitted by sender to event bridge. The event bridge dispatches the event to the receiver. A command expects to get a response message from receiver back to sender.

CommandContextMockResult

Types

Source
CommandContextMockResult.ts typescript
type CommandContextMockResult = void

CommandContextMockServiceClass

Types

Source
CommandContextMockServiceClass.ts typescript
type CommandContextMockServiceClass = T extends CommandDefinitionBuilder<S, any> ? S : ServiceClass

CommandDefinitionBuilderTypes

Types

Source
CommandDefinitionBuilderTypes.ts typescript
type CommandDefinitionBuilderTypes = void

Type accumulator used by `CommandDefinitionBuilder` for schemas, hooks, invocations, events, and queues.

CommandDefinitionList

Types

Source
CommandDefinitionList.ts typescript
type CommandDefinitionList = Promise<CommandDefinition<S, any, any, any, any, any, any, any, any, any, any, any, any, any, CommandDefinitionMetadataBase, any>>[]

Helper type for creating list of service commands to be passed as input to service class

CommandDefinitionListResolved

Types

Source
CommandDefinitionListResolved.ts typescript
type CommandDefinitionListResolved = CommandDefinition<S, any, any, any, any, any, any, any, any, any, any, any, any, any, CommandDefinitionMetadataBase, any>[]

CommandDefinitionMetadataBase

Types

Source
CommandDefinitionMetadataBase.ts typescript
type CommandDefinitionMetadataBase = void

CommandToolInvokeMap

Types

Source
CommandToolInvokeMap.ts typescript
type CommandToolInvokeMap = mapped

Typed command tool call map exposed at `context.invoke.tools`.

Complete

Types

Source
Complete.ts typescript
type Complete = mapped

A helper which forces to provide all object keys, even if they are optional.

CompressionMethod

Types

Source
CompressionMethod.ts typescript
type CompressionMethod = "gzip" | "deflat" | "br" | undefined

Config

Types

Source
Config.ts typescript
type Config = z.infer<typeof configSchema>

ConfigFull

Types

Source
ConfigFull.ts typescript
type ConfigFull = z.infer<typeof configFullSchema>

ConfigStoreCacheMap

Types

Source
ConfigStoreCacheMap.ts typescript
type ConfigStoreCacheMap = Map<string, { createdAt: number; value: string }>

Constructor

Types

Source
Constructor.ts typescript
type Constructor = (...args: A) => T

Generic constructor type that preserves argument tuple inference.

ContentType

Types

Source
ContentType.ts typescript
type ContentType = "application/json" | "application/javascript" | "text/csv" | "text/css" | "text/html" | "text/javascript" | "text/markdown" | "text/plain" | "text/xml" | string

List of content types for message payloads. If the content type is other than `application/json`, the message payload must be a string. It is up to the implementation to extract the content type from the original message and to convert or transform data.

ContextBase

Types

Source
ContextBase.ts typescript
type ContextBase = void

The ContextBase provides is a basic type. Each context for command function, subscription function and all Hooks and transformers will have at least the properties of this type.

CorrelationId

Types

Source
CorrelationId.ts typescript
type CorrelationId = string

the correlation id links the command invocation message with the command response message

CreateCommandContextMockInput

Types

Source
CreateCommandContextMockInput.ts typescript
type CreateCommandContextMockInput = void

CreateCommandTestHarnessOptions

Types

Source
CreateCommandTestHarnessOptions.ts typescript
type CreateCommandTestHarnessOptions = InstanceConfigType<InferCommandHarnessServiceBuilderConfig<TServiceBuilder>> & { eventBridge: EventBridge; queueBridge: QueueBridge }

CreateStreamContextMockInput

Types

Source
CreateStreamContextMockInput.ts typescript
type CreateStreamContextMockInput = void

CreateSubscriptionContextMockInput

Types

Source
CreateSubscriptionContextMockInput.ts typescript
type CreateSubscriptionContextMockInput = void

CustomMessage

Types

Source
CustomMessage.ts typescript
type CustomMessage = Prettify<{ eventName: string; messageType: EBMessageType.CustomMessage; payload: Payload; receiver: EBMessageAddress } & EBMessageBase>

A custom message is a message which can be used to pass business information. The producer emits the message without knowledge about any consumer. The producer does not expect a response from a consumer.

DefaultConfigStoreConfig

Types

Source
DefaultConfigStoreConfig.ts typescript
type DefaultConfigStoreConfig = Record<string, unknown>

DefaultEventBridgeConfig

Types

Source
DefaultEventBridgeConfig.ts typescript
type DefaultEventBridgeConfig = void

The configuration for the DefaultEventBridge.

DefaultSecretStoreConfig

Types

Source
DefaultSecretStoreConfig.ts typescript
type DefaultSecretStoreConfig = Record<string, unknown>

DefaultStateStoreConfig

Types

Source
DefaultStateStoreConfig.ts typescript
type DefaultStateStoreConfig = Record<string, unknown>

EBMessage

Types

Source
EBMessage.ts typescript
type EBMessage = Command | CommandResponse | InfoMessage | CustomMessage | StreamMessage

EBMessage is some message which is handled by the event bridge.

EBMessageAddress

Types

Source
EBMessageAddress.ts typescript
type EBMessageAddress = void

A event bridge message address describes the sender or receiver of a message.

EBMessageBase

Types

Source
EBMessageBase.ts typescript
type EBMessageBase = void

Default fields which are part of any purista message

EBMessageId

Types

Source
EBMessageId.ts typescript
type EBMessageId = string

Unique id of the event bridge message

EBMessageSenderAddress

Types

Source
EBMessageSenderAddress.ts typescript
type EBMessageSenderAddress = Prettify<Omit<EBMessageAddress, "instanceId"> & Required<Pick<EBMessageAddress, "instanceId">>>

A event bridge message address describes the sender or receiver of a message.

EmitCustomMessageFunction

Types

Source
EmitCustomMessageFunction.ts typescript
type EmitCustomMessageFunction = (eventName: K, payload: EmitList[K], contentType?: ContentType, contentEncoding?: string) => Promise<void>

Emits the given payload as custom message with the given event name.

EmitSchemaList

Types

Source
EmitSchemaList.ts typescript
type EmitSchemaList = mapped

EmptyObject

Types

Source
EmptyObject.ts typescript
type EmptyObject = object

ErrorResponsePayload

Types

Source
ErrorResponsePayload.ts typescript
type ErrorResponsePayload = void

Error message payload

EventBridgeCapabilityOverrides

Types

Source
EventBridgeCapabilityOverrides.ts typescript
type EventBridgeCapabilityOverrides = Partial<Omit<EventBridgeCapabilities, "consumerFailureHandling">> & { consumerFailureHandling: Partial<EventBridgeCapabilities["consumerFailureHandling"]> }

Capability overrides accepted by `getEventBridgeMock` for strict reliability tests.

EventBridgeConfig

Types

Source
EventBridgeConfig.ts typescript
type EventBridgeConfig = Prettify<{ defaultCommandTimeout: number; instanceId: string; logger: Logger; logLevel: LogLevelName; metrics: PuristaMetricsRuntimeOptions; metricsRecorder: PuristaMetricsRecorder; ... } & CustomConfig>

The config object for an event bridge. Every event bridge implementation must use this type for configuration.

EventKey

Types

Source
EventKey.ts typescript
type EventKey = string & typeOperator

EventMap

Types

Source
EventMap.ts typescript
type EventMap = Record<string, unknown>

Event payload map where key is the event name and value is the payload type.

EventReceiver

Types

Source
EventReceiver.ts typescript
type EventReceiver = (parameter: T) => void

ExportAsyncApiOptions

Types

Source
ExportAsyncApiOptions.ts typescript
type ExportAsyncApiOptions = void

ExportKubernetesCronJobsOptions

Types

Source
ExportKubernetesCronJobsOptions.ts typescript
type ExportKubernetesCronJobsOptions = void

ExportRuntimeCapabilitiesOptions

Types

Source
ExportRuntimeCapabilitiesOptions.ts typescript
type ExportRuntimeCapabilitiesOptions = void

ExportScheduleManifestOptions

Types

Source
ExportScheduleManifestOptions.ts typescript
type ExportScheduleManifestOptions = void

FromCloudEventOptions

Types

Source
FromCloudEventOptions.ts typescript
type FromCloudEventOptions = void

FromEmitToOtherType

Types

Source
FromEmitToOtherType.ts typescript
type FromEmitToOtherType = mapped

Changes the canEmit proxy type to given type

FromInvokeToOtherType

Types

Source
FromInvokeToOtherType.ts typescript
type FromInvokeToOtherType = mapped

Changes the canInvoke proxy type to given type

FullDefinition

Types

Source
FullDefinition.ts typescript
type FullDefinition = void

FullServiceDefinition

Types

Source
FullServiceDefinition.ts typescript
type FullServiceDefinition = object

GetMessageParamsType

Types

Source
GetMessageParamsType.ts typescript
type GetMessageParamsType = TransformInputParamsSchema extends Schema ? InferIn<TransformInputParamsSchema> : ParamsSchema extends Schema ? InferIn<ParamsSchema> : unknown

GetMessagePayloadType

Types

Source
GetMessagePayloadType.ts typescript
type GetMessagePayloadType = TransformInputPayloadSchema extends Schema ? InferIn<TransformInputPayloadSchema> : PayloadSchema extends Schema ? InferIn<PayloadSchema> : unknown

HttpClientConfig

Types

Source
HttpClientConfig.ts typescript
type HttpClientConfig = Prettify<{ baseUrl: string; basicAuth: { password: string; username: string }; bearerToken: string; defaultHeaders: Record<string, string>; defaultTimeout: number; enableOpentelemetry: boolean; ... } & CustomConfig>

Basic configuration for HttpClient.

HttpClientRequestOptions

Types

Source
HttpClientRequestOptions.ts typescript
type HttpClientRequestOptions = void

Options for a single HTTP request.

HttpExposedServiceMeta

Types

Source
HttpExposedServiceMeta.ts typescript
type HttpExposedServiceMeta = Prettify<CommandDefinitionMetadataBase & { expose: { http: { method: unknown; mode: unknown; openApi: unknown; path: unknown; stream: unknown } } }>

HttpExposureOptions

Types

Source
HttpExposureOptions.ts typescript
type HttpExposureOptions = void

Infer

Types

Source
Infer.ts typescript
type Infer = StandardSchemaV1.InferOutput<TSchema>

Infers output type from a schema.

InferIn

Types

Source
InferIn.ts typescript
type InferIn = StandardSchemaV1.InferInput<TSchema>

Infers input type from a schema.

InferMetricAttributes

Types

Source
InferMetricAttributes.ts typescript
type InferMetricAttributes = Definition extends PuristaMetricDefinition<AttributesSchema> ? AttributesSchema extends Schema ? InferIn<AttributesSchema> : undefined : never

Infers the attribute input type for a metric definition.

InferOptionalInput

Types

Source
InferOptionalInput.ts typescript
type InferOptionalInput = [NonNullable<T>] extends [never] ? unknown : NonNullable<T> extends Schema ? InferIn<NonNullable<T>> : unknown

Infers an agent tool input schema when one is declared, otherwise falls back to `unknown`.

InferOptionalOutput

Types

Source
InferOptionalOutput.ts typescript
type InferOptionalOutput = [NonNullable<T>] extends [never] ? unknown : NonNullable<T> extends Schema ? Infer<NonNullable<T>> : unknown

Infers an agent tool output schema when one is declared, otherwise falls back to `unknown`.

InferParameter

Types

Source
InferParameter.ts typescript
type InferParameter = S extends Schema ? InferIn<S> : unknown

InferPayload

Types

Source
InferPayload.ts typescript
type InferPayload = S extends Schema ? InferIn<S> : unknown

InferTypeOrEmptyObject

Types

Source
InferTypeOrEmptyObject.ts typescript
type InferTypeOrEmptyObject = T extends Schema ? Infer<T> extends EmptyObject ? Infer<T> : EmptyObject : EmptyObject

InFlightDiagnostics

Types

Source
InFlightDiagnostics.ts typescript
type InFlightDiagnostics = void

InFlightExecutionCounts

Types

Source
InFlightExecutionCounts.ts typescript
type InFlightExecutionCounts = Record<"command" | "subscription" | "stream" | "generic", number>

InfoInvokeTimeout

Types

Source
InfoInvokeTimeout.ts typescript
type InfoInvokeTimeout = { messageType: EBMessageType.InfoInvokeTimeout } & InfoServiceBase

InfoInvokeTimeoutPayload

Types

Source
InfoInvokeTimeoutPayload.ts typescript
type InfoInvokeTimeoutPayload = void

InfoMessage

Types

Source
InfoMessage.ts typescript
type InfoMessage = InfoServiceDrain | InfoServiceFunctionAdded | InfoServiceInit | InfoServiceNotReady | InfoServiceReady | InfoServiceShutdown | InfoInvokeTimeout | InfoSubscriptionError

InfoMessageType

Types

Source
InfoMessageType.ts typescript
type InfoMessageType = EBMessageType.InfoServiceDrain | EBMessageType.InfoServiceFunctionAdded | EBMessageType.InfoServiceInit | EBMessageType.InfoServiceNotReady | EBMessageType.InfoServiceReady | EBMessageType.InfoServiceShutdown | EBMessageType.InfoInvokeTimeout | EBMessageType.InfoSubscriptionError

InfoServiceBase

Types

Source
InfoServiceBase.ts typescript
type InfoServiceBase = Prettify<{ contentEncoding: "utf-8"; contentType: "application/json"; payload: unknown } & EBMessageBase>

InfoServiceDrain

Types

Source
InfoServiceDrain.ts typescript
type InfoServiceDrain = Prettify<{ messageType: EBMessageType.InfoServiceDrain } & InfoServiceBase>

InfoServiceFunctionAdded

Types

Source
InfoServiceFunctionAdded.ts typescript
type InfoServiceFunctionAdded = Prettify<{ messageType: EBMessageType.InfoServiceFunctionAdded } & InfoServiceBase>

InfoServiceInit

Types

Source
InfoServiceInit.ts typescript
type InfoServiceInit = Prettify<{ messageType: EBMessageType.InfoServiceInit } & InfoServiceBase>

InfoServiceNotReady

Types

Source
InfoServiceNotReady.ts typescript
type InfoServiceNotReady = Prettify<{ messageType: EBMessageType.InfoServiceNotReady } & InfoServiceBase>

InfoServiceReady

Types

Source
InfoServiceReady.ts typescript
type InfoServiceReady = Prettify<{ messageType: EBMessageType.InfoServiceReady } & InfoServiceBase>

InfoServiceShutdown

Types

Source
InfoServiceShutdown.ts typescript
type InfoServiceShutdown = Prettify<{ messageType: EBMessageType.InfoServiceShutdown } & InfoServiceBase>

InfoSubscriptionError

Types

Source
InfoSubscriptionError.ts typescript
type InfoSubscriptionError = Prettify<{ messageType: EBMessageType.InfoSubscriptionError } & InfoServiceBase>

InstanceConfigType

Types

Source
InstanceConfigType.ts typescript
type InstanceConfigType = Prettify<{ ai: AgentRuntimeOptions<Record<unknown, unknown>>; configStore: ConfigStore; logger: Logger; logLevel: LogLevelName; metrics: PuristaMetricsRuntimeOptions; metricsRecorder: PuristaMetricsRecorder; ... } & typeOperator extends never ? { resources: never } : { resources: unknown[unknown] } & typeOperator extends never ? { serviceConfig: never } : { serviceConfig: unknown[unknown] }>

Runtime configuration accepted by `ServiceBuilder.getInstance(...)`.

InstanceId

Types

Source
InstanceId.ts typescript
type InstanceId = string

the instance id of the event bridge

InstanceOrType

Types

Source
InstanceOrType.ts typescript
type InstanceOrType = T extends Constructor ? InstanceType<T> : T

InvokeFunction

Types

Source
InvokeFunction.ts typescript
type InvokeFunction = (address: EBMessageAddress, payload: PayloadType, parameter: ParameterType) => Promise<InvokeResponseType>

Invokes a command and returns the result. It is recommended to validate the result against a schema which only contains the data you actually need.

InvokeList

Types

Source
InvokeList.ts typescript
type InvokeList = Record<string, Record<string, Record<string, { outputSchema: Schema; parameterSchema: Schema; payloadSchema: Schema }>>>

InvokeValidationMap

Types

Source
InvokeValidationMap.ts typescript
type InvokeValidationMap = object

IsConstructor

Types

Source
IsConstructor.ts typescript
type IsConstructor = T extends Constructor ? true : false

JsonRecord

Types

Source
JsonRecord.ts typescript
type JsonRecord = Record<string, unknown>

JSON object shape used by provider export helpers for provider-native manifest fragments.

JsonSchemaOptions

Types

Source
JsonSchemaOptions.ts typescript
type JsonSchemaOptions = void

KubernetesCronJobManifest

Types

Source
KubernetesCronJobManifest.ts typescript
type KubernetesCronJobManifest = void

KubernetesCronJobScheduleInput

Types

Source
KubernetesCronJobScheduleInput.ts typescript
type KubernetesCronJobScheduleInput = void

KubernetesCronJobTriggerTemplate

Types

Source
KubernetesCronJobTriggerTemplate.ts typescript
type KubernetesCronJobTriggerTemplate = void

LogFnParamType

Types

Source
LogFnParamType.ts typescript
type LogFnParamType = [unknown, optional, rest] | [string, rest]

LoggerOptions

Types

Source
LoggerOptions.ts typescript
type LoggerOptions = void

LoggerStubs

Types

Source
LoggerStubs.ts typescript
type LoggerStubs = void

LogLevelName

Types

Source
LogLevelName.ts typescript
type LogLevelName = "info" | "error" | "warn" | "debug" | "trace" | "fatal"

MetricAttributeArgs

Types

Source
MetricAttributeArgs.ts typescript
type MetricAttributeArgs = [Attributes] extends [undefined] ? [] : [attributes]

Method argument tuple for metric attributes.

NeverObject

Types

Source
NeverObject.ts typescript
type NeverObject = Record<string, never>

Newable

Types

Source
Newable.ts typescript
type Newable = (config: ServiceConstructorInput<S>) => T

Constructor type accepted by `ServiceBuilder.setCustomClass(...)`.

NonEmptyString

Types

Source
NonEmptyString.ts typescript
type NonEmptyString = "" extends T ? never : T

ObjectWithKeysFromStringArray

Types

Source
ObjectWithKeysFromStringArray.ts typescript
type ObjectWithKeysFromStringArray = mapped

Type helper which can create a typed record, based on given string array type.

OpenStreamFunction

Types

Source
OpenStreamFunction.ts typescript
type OpenStreamFunction = (address: EBMessageAddress, payload: PayloadType, parameter: ParameterType) => Promise<StreamHandle<Chunk, Final>>

PausedQueueWorkerState

Types

Source
PausedQueueWorkerState.ts typescript
type PausedQueueWorkerState = void

PausedSubscriptionConsumerHealthState

Types

Source
PausedSubscriptionConsumerHealthState.ts typescript
type PausedSubscriptionConsumerHealthState = PausedSubscriptionConsumerState & { registrationKey: string }

PausedSubscriptionConsumersByRegistrationKey

Types

Source
PausedSubscriptionConsumersByRegistrationKey.ts typescript
type PausedSubscriptionConsumersByRegistrationKey = Record<string, PausedSubscriptionConsumerState>

PausedSubscriptionConsumerState

Types

Source
PausedSubscriptionConsumerState.ts typescript
type PausedSubscriptionConsumerState = void

PendigInvocation

Types

Source
PendigInvocation.ts typescript
type PendigInvocation = void

Prettify

Types

Source
Prettify.ts typescript
type Prettify = mapped & object

PrincipalId

Types

Source
PrincipalId.ts typescript
type PrincipalId = string

the principal id

PuristaMetricAttributes

Types

Source
PuristaMetricAttributes.ts typescript
type PuristaMetricAttributes = Record<string, PuristaMetricAttributeValue>

Attribute map accepted by PURISTA metrics after low-cardinality policy checks.

PuristaMetricAttributeValue

Types

Source
PuristaMetricAttributeValue.ts typescript
type PuristaMetricAttributeValue = string | number | boolean

Scalar metric attribute value accepted by PURISTA.

PuristaMetricContext

Types

Source
PuristaMetricContext.ts typescript
type PuristaMetricContext = mapped

Typed metric context exposed to handlers.

PuristaMetricContextProperty

Types

Source
PuristaMetricContextProperty.ts typescript
type PuristaMetricContextProperty = void

Adds the typed PURISTA metric context to a handler context type.

PuristaMetricDefinitions

Types

Source
PuristaMetricDefinitions.ts typescript
type PuristaMetricDefinitions = Record<string, PuristaMetricDefinition<any>>

Named metric definitions keyed by their metric name.

PuristaMetricHandle

Types

Source
PuristaMetricHandle.ts typescript
type PuristaMetricHandle = Definition extends { kind: "histogram" } ? { record: void } : { add: void }

Handler-facing metric handle. Counters use `add`; histograms use `record`.

PuristaMetricKind

Types

Source
PuristaMetricKind.ts typescript
type PuristaMetricKind = "counter" | "upDownCounter" | "histogram"

Supported PURISTA metric instrument kinds.

PuristaMetricRecord

Types

Source
PuristaMetricRecord.ts typescript
type PuristaMetricRecord = MemoryMetricRecord

QueryParameter

Types

Source
QueryParameter.ts typescript
type QueryParameter = void

QueueContext

Types

Source
QueueContext.ts typescript
type QueueContext = void

QueueDefinitionList

Types

Source
QueueDefinitionList.ts typescript
type QueueDefinitionList = Promise<QueueDefinition>[]

QueueDefinitionListResolved

Types

Source
QueueDefinitionListResolved.ts typescript
type QueueDefinitionListResolved = QueueDefinition[]

QueueHealthState

Types

Source
QueueHealthState.ts typescript
type QueueHealthState = void

QueueHealthStatus

Types

Source
QueueHealthStatus.ts typescript
type QueueHealthStatus = "ok" | "warn" | "error"

QueueInvokeClientMap

Types

Source
QueueInvokeClientMap.ts typescript
type QueueInvokeClientMap = mapped

QueueInvokeFunction

Types

Source
QueueInvokeFunction.ts typescript
type QueueInvokeFunction = (queueName: string, payload: Payload, parameter?: Params, options?: Omit<QueueEnqueueOptions<Payload, Params>, "queueName" | "payload" | "parameter">) => Promise<QueueEnqueueResult>

QueueInvokeList

Types

Source
QueueInvokeList.ts typescript
type QueueInvokeList = Record<string, { parameterSchema: Schema; payloadSchema: Schema }>

QueueJobStatusRecord

Types

Source
QueueJobStatusRecord.ts typescript
type QueueJobStatusRecord = void

QueueJobStore

Types

Source
QueueJobStore.ts typescript
type QueueJobStore = void

QueueLease

Types

Source
QueueLease.ts typescript
type QueueLease = void

QueueResultPolicyDelivery

Types

Source
QueueResultPolicyDelivery.ts typescript
type QueueResultPolicyDelivery = "required" | "best-effort"

Delivery requirement for queue result publication.

QueueResultStatus

Types

Source
QueueResultStatus.ts typescript
type QueueResultStatus = "success" | "failed" | "cancelled" | "dead-lettered" | "progress"

Canonical queue result status values.

QueueScheduleFunction

Types

Source
QueueScheduleFunction.ts typescript
type QueueScheduleFunction = (queueName: string, runAt: Date | number, payload: Payload, parameter?: Params, options?: Omit<QueueEnqueueOptions<Payload, Params>, "queueName" | "payload" | "parameter" | "delayMs">) => Promise<QueueEnqueueResult>

QueueScheduleProxy

Types

Source
QueueScheduleProxy.ts typescript
type QueueScheduleProxy = mapped

QueueWorkerAfterGuardHook

Types

Source
QueueWorkerAfterGuardHook.ts typescript
type QueueWorkerAfterGuardHook = (this: S, context: QueueJobContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes>, result: Readonly<QueueHandlerResult | undefined>, message: Readonly<QueueMessage<MessagePayloadType, MessageParamsType>>) => Promise<void>

QueueWorkerBeforeGuardHook

Types

Source
QueueWorkerBeforeGuardHook.ts typescript
type QueueWorkerBeforeGuardHook = (this: S, context: QueueJobContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes>, message: Readonly<QueueMessage<MessagePayloadType, MessageParamsType>>) => Promise<void>

QueueWorkerDefinitionList

Types

Source
QueueWorkerDefinitionList.ts typescript
type QueueWorkerDefinitionList = Promise<QueueWorkerDefinition>[]

QueueWorkerDefinitionListResolved

Types

Source
QueueWorkerDefinitionListResolved.ts typescript
type QueueWorkerDefinitionListResolved = QueueWorkerDefinition[]

QueueWorkerPauseHealthState

Types

Source
QueueWorkerPauseHealthState.ts typescript
type QueueWorkerPauseHealthState = PausedQueueWorkerState & { queueName: string }

QueueWorkerPauseStateByQueue

Types

Source
QueueWorkerPauseStateByQueue.ts typescript
type QueueWorkerPauseStateByQueue = Record<string, PausedQueueWorkerState>

RuntimeBridgeCapabilities

Types

Source
RuntimeBridgeCapabilities.ts typescript
type RuntimeBridgeCapabilities = void

RuntimeCapabilityReportMode

Types

Source
RuntimeCapabilityReportMode.ts typescript
type RuntimeCapabilityReportMode = "definition-only" | "runtime-inspect"

ScheduleConcurrencyPolicy

Types

Source
ScheduleConcurrencyPolicy.ts typescript
type ScheduleConcurrencyPolicy = "allow" | "forbid" | "replace"

ScheduleDefinition

Types

Source
ScheduleDefinition.ts typescript
type ScheduleDefinition = void

Provider-neutral schedule metadata exported from PURISTA definitions.

ScheduleExpression

Types

Source
ScheduleExpression.ts typescript
type ScheduleExpression = { kind: "cron"; timezone: string; value: string } | { everyMs: number; kind: "interval" } | { kind: "oneShot"; runAt: string | number | Date }

ScheduleManifest

Types

Source
ScheduleManifest.ts typescript
type ScheduleManifest = void

ScheduleMissedRunPolicy

Types

Source
ScheduleMissedRunPolicy.ts typescript
type ScheduleMissedRunPolicy = "skip" | "runOnce" | "backfill"

ScheduleOptions

Types

Source
ScheduleOptions.ts typescript
type ScheduleOptions = void

ScheduleTargetKind

Types

Source
ScheduleTargetKind.ts typescript
type ScheduleTargetKind = "event" | "queue" | "command"

Schema

Types

Source
Schema.ts typescript
type Schema = StandardSchemaV1

Common Standard Schema abstraction used across PURISTA boundaries.

SecretStoreCacheMap

Types

Source
SecretStoreCacheMap.ts typescript
type SecretStoreCacheMap = Map<string, { createdAt: number; value: string }>

ServiceBuilderTypes

Types

Source
ServiceBuilderTypes.ts typescript
type ServiceBuilderTypes = void

ServiceClassMetrics

Types

Source
ServiceClassMetrics.ts typescript
type ServiceClassMetrics = S extends { __serviceClassTypes: Types } ? Types extends ServiceClassTypes<any, any, Metrics> ? Metrics extends PuristaMetricDefinitions ? Metrics : EmptyObject : EmptyObject : EmptyObject

ServiceClassTypes

Types

Source
ServiceClassTypes.ts typescript
type ServiceClassTypes = void

ServiceContractInput

Types

Source
ServiceContractInput.ts typescript
type ServiceContractInput = FullDefinition | FullServiceDefinition

ServiceDefinitions

Types

Source
ServiceDefinitions.ts typescript
type ServiceDefinitions = void

ServiceHealthState

Types

Source
ServiceHealthState.ts typescript
type ServiceHealthState = void

ServiceHealthStatus

Types

Source
ServiceHealthStatus.ts typescript
type ServiceHealthStatus = "ok" | "warn" | "error"

ServiceInfoType

Types

Source
ServiceInfoType.ts typescript
type ServiceInfoType = void

General service information

SetNewTypeValue

Types

Source
SetNewTypeValue.ts typescript
type SetNewTypeValue = mapped

SetNewTypeValues

Types

Source
SetNewTypeValues.ts typescript
type SetNewTypeValues = mapped

ShutdownEntry

Types

Source
ShutdownEntry.ts typescript
type ShutdownEntry = void

Entry of thing you like to shutdown gracefully

StoreBaseConfig

Types

Source
StoreBaseConfig.ts typescript
type StoreBaseConfig = Prettify<{ cacheTtl: number; enableCache: boolean; enableGet: boolean; enableRemove: boolean; enableSet: boolean; logger: Logger; ... } & Config>

Basic configuration object which is used by any store

StreamContextMockResult

Types

Source
StreamContextMockResult.ts typescript
type StreamContextMockResult = void

StreamContextMockServiceClass

Types

Source
StreamContextMockServiceClass.ts typescript
type StreamContextMockServiceClass = T extends StreamDefinitionBuilder<S, any> ? S : ServiceClass

StreamControl

Types

Source
StreamControl.ts typescript
type StreamControl = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.Stream; payload: StreamControlPayload; receiver: EBMessageAddress & Required<unknown> } & EBMessageBase>

StreamControlPayload

Types

Source
StreamControlPayload.ts typescript
type StreamControlPayload = void

StreamDefinition

Types

Source
StreamDefinition.ts typescript
type StreamDefinition = void

StreamDefinitionBuilderTypes

Types

Source
StreamDefinitionBuilderTypes.ts typescript
type StreamDefinitionBuilderTypes = void

Type accumulator used by `StreamDefinitionBuilder` for schemas, invocations, events, and queue access.

StreamDefinitionList

Types

Source
StreamDefinitionList.ts typescript
type StreamDefinitionList = Promise<StreamDefinition<S, any, any, any, any, any, any, any, any, any, any, StreamDefinitionMetadataBase, any>>[]

StreamDefinitionListResolved

Types

Source
StreamDefinitionListResolved.ts typescript
type StreamDefinitionListResolved = StreamDefinition<S, any, any, any, any, any, any, any, any, any, any, StreamDefinitionMetadataBase, any>[]

StreamDefinitionMetadataBase

Types

Source
StreamDefinitionMetadataBase.ts typescript
type StreamDefinitionMetadataBase = void

StreamErrorPayload

Types

Source
StreamErrorPayload.ts typescript
type StreamErrorPayload = void

StreamFrame

Types

Source
StreamFrame.ts typescript
type StreamFrame = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.Stream; payload: StreamFramePayload<Chunk, Final>; receiver: EBMessageSenderAddress } & EBMessageBase>

StreamFramePayload

Types

Source
StreamFramePayload.ts typescript
type StreamFramePayload = void

StreamFrameType

Types

Source
StreamFrameType.ts typescript
type StreamFrameType = "open" | "start" | "chunk" | "complete" | "error" | "cancel" | "heartbeat"

StreamFunction

Types

Source
StreamFunction.ts typescript
type StreamFunction = (this: S, context: StreamFunctionContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes, ServiceClassMetrics<S>>, payload: Readonly<FunctionPayloadType>, parameter: Readonly<FunctionParamsType>, writer: StreamWriter<ChunkType, FinalType>) => Promise<void>

StreamFunctionContext

Types

Source
StreamFunctionContext.ts typescript
type StreamFunctionContext = Prettify<ContextBase<Metrics> & PuristaMetricContextProperty<Metrics> & StreamFunctionContextEnhancements<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>>

StreamFunctionContextEnhancements

Types

Source
StreamFunctionContextEnhancements.ts typescript
type StreamFunctionContextEnhancements = void

StreamInvokeList

Types

Source
StreamInvokeList.ts typescript
type StreamInvokeList = Record<string, Record<string, Record<string, { chunkSchema: Schema; finalSchema: Schema; parameterSchema: Schema; payloadSchema: Schema; validateChunk: boolean; validateFinal: boolean }>>>

StreamMessage

Types

Source
StreamMessage.ts typescript
type StreamMessage = StreamOpenRequest | StreamControl | StreamFrame<Chunk, Final>

StreamOpenRequest

Types

Source
StreamOpenRequest.ts typescript
type StreamOpenRequest = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.Stream; payload: StreamOpenRequestPayload<PayloadType, ParameterType>; receiver: EBMessageAddress } & EBMessageBase>

StreamOpenRequestPayload

Types

Source
StreamOpenRequestPayload.ts typescript
type StreamOpenRequestPayload = void

SubscriptionContextMockResult

Types

Source
SubscriptionContextMockResult.ts typescript
type SubscriptionContextMockResult = void

SubscriptionContextMockServiceClass

Types

Source
SubscriptionContextMockServiceClass.ts typescript
type SubscriptionContextMockServiceClass = T extends SubscriptionDefinitionBuilder<S, any> ? S : ServiceClass

SubscriptionDefinitionBuilderTypes

Types

Source
SubscriptionDefinitionBuilderTypes.ts typescript
type SubscriptionDefinitionBuilderTypes = void

Type accumulator used by `SubscriptionDefinitionBuilder` for schemas, hooks, invocations, events, and queues.

SubscriptionDefinitionList

Types

Source
SubscriptionDefinitionList.ts typescript
type SubscriptionDefinitionList = Promise<SubscriptionDefinition<ServiceClassType, any, any, any, any, any, any, any, any, any, any, any, SubscriptionDefinitionMetadataBase, any>>[]

Helper type for creating list of service commands to be passed as input to service class

SubscriptionDefinitionListResolved

Types

Source
SubscriptionDefinitionListResolved.ts typescript
type SubscriptionDefinitionListResolved = SubscriptionDefinition<ServiceClassType, any, any, any, any, any, any, any, any, any, any, any, SubscriptionDefinitionMetadataBase, any>[]

SubscriptionDefinitionMetadataBase

Types

Source
SubscriptionDefinitionMetadataBase.ts typescript
type SubscriptionDefinitionMetadataBase = void

SubscriptionHandlerControlResult

Types

Source
SubscriptionHandlerControlResult.ts typescript
type SubscriptionHandlerControlResult = Exclude<SubscriptionHandlerResult, { status: "ack" }>

SubscriptionHandlerResult

Types

Source
SubscriptionHandlerResult.ts typescript
type SubscriptionHandlerResult = { status: "ack" } | { delayMs: number; reason: string; status: "retry" } | { reason: string; status: "deadLetter" } | { reason: string; status: "drop" } | { reason: string; status: "stop-consumer" }

SubscriptionStorageEntry

Types

Source
SubscriptionStorageEntry.ts typescript
type SubscriptionStorageEntry = void

SupportedHttpMethod

Types

Source
SupportedHttpMethod.ts typescript
type SupportedHttpMethod = "GET" | "POST" | "PATCH" | "PUT" | "DELETE"

Supported HTTP-Methods for defining endpoints

TenantId

Types

Source
TenantId.ts typescript
type TenantId = string

the tenant id

TraceId

Types

Source
TraceId.ts typescript
type TraceId = string

The trace id which will be passed through all commands, invocations and subscriptions

ValidationResult

Types

Source
ValidationResult.ts typescript
type ValidationResult = { data: TOutput; success: true } | { issues: ReadonlyArray<StandardSchemaV1.Issue>; success: false }

Unified validation result shape for all supported schema vendors.

Variables

11 entries

CONFIG_FILE_NAME

Variables

Source
CONFIG_FILE_NAME.ts typescript
const CONFIG_FILE_NAME: "purista.client.json"

configFullSchema

Variables

Source
configFullSchema.ts typescript
const configFullSchema: ZodObject<{ buildAs: ZodDefault<ZodLiteral<"esm">>; definitionPath: ZodString; eventBridgeClient: ZodObject<{ clientName: ZodDefault<unknown> }, $strip>; httpClient: ZodObject<{ clientName: ZodDefault<unknown> }, $strip>; outputPath: ZodString; package: ZodOptional<ZodObject<{ description: unknown; name: unknown; private: unknown }, $strip>>; ... }, $strip>

configSchema

Variables

Source
configSchema.ts typescript
const configSchema: ZodObject<{ buildAs: ZodDefault<ZodLiteral<"esm">>; definitionPath: ZodString; eventBridgeClient: ZodOptional<ZodObject<{ clientName: unknown }, $strip>>; httpClient: ZodOptional<ZodObject<{ clientName: unknown }, $strip>>; outputPath: ZodString; package: ZodOptional<ZodObject<{ description: unknown; name: unknown; private: unknown }, $strip>>; ... }, $strip>

defaultQueueLifecycleConfig

Variables

Source
defaultQueueLifecycleConfig.ts typescript
const defaultQueueLifecycleConfig: QueueLifecycleConfig

Opinionated defaults for queues so builders can omit lifecycle overrides yet still get resilient behaviour.

eventBridgeClientConfigSchema

Variables

Source
eventBridgeClientConfigSchema.ts typescript
const eventBridgeClientConfigSchema: ZodObject<{ clientName: ZodDefault<ZodString> }, $strip>

frameworkMetricDefinitions

Variables

Source
frameworkMetricDefinitions.ts typescript
const frameworkMetricDefinitions: { http.client.request.duration: PuristaMetricDefinition<undefined>; http.server.active_requests: PuristaMetricDefinition<undefined>; http.server.request.duration: PuristaMetricDefinition<undefined>; messaging.client.consumed.messages: PuristaMetricDefinition<undefined>; messaging.client.operation.duration: PuristaMetricDefinition<undefined>; messaging.client.sent.messages: PuristaMetricDefinition<undefined>; ... }

PURISTA framework metric catalog.

httpClientConfigSchema

Variables

Source
httpClientConfigSchema.ts typescript
const httpClientConfigSchema: ZodObject<{ clientName: ZodDefault<ZodString> }, $strip>

infoMessageTypes

Variables

Source
infoMessageTypes.ts typescript
const infoMessageTypes: EBMessageType[]

MIN_CONTENT_SIZE_FOR_COMPRESSION

Variables

Source
MIN_CONTENT_SIZE_FOR_COMPRESSION.ts typescript
const MIN_CONTENT_SIZE_FOR_COMPRESSION: 1024

puristaVersion

Variables

Source
puristaVersion.ts typescript
const puristaVersion: "3.0.1"

The PURISTA package version embedded in the published runtime build.

ServiceInfoValidator

Variables

Source
ServiceInfoValidator.ts typescript
const ServiceInfoValidator: { set: void }

Functions

54 entries

assertNonArrowFunction

Functions

Source
assertNonArrowFunction.ts typescript
assertNonArrowFunction(fn: (...args: never[]) => unknown, label: string): void

convertEmitValidationsToSchema

Functions

Source
convertEmitValidationsToSchema.ts typescript
convertEmitValidationsToSchema<T>(emits: T): Promise<FromEmitToOtherType<T, SchemaObject>>

convertInvokeValidationsToSchema

Functions

Source
convertInvokeValidationsToSchema.ts typescript
convertInvokeValidationsToSchema<T>(invokes: T): Promise<FromInvokeToOtherType<T, { outputSchema: SchemaObject; parameterSchema: SchemaObject; payloadSchema: SchemaObject }>>

createInvokeFunctionProxy

Functions

Source
createInvokeFunctionProxy.ts typescript
createInvokeFunctionProxy<TFaux>(invokeOg: InvokeFunction, address?: EBMessageAddress, lvl: number): TFaux

createMemoryMetricsRecorder

Functions

Source
createMemoryMetricsRecorder.ts typescript
createMemoryMetricsRecorder(options: PuristaMetricsRuntimeOptions): PuristaMetricsRecorder & { records: MemoryMetricRecord[]; clear: void }

createMetricContext

Functions

Source
createMetricContext.ts typescript
createMetricContext<Definitions>(definitions: Definitions, recorder: PuristaMetricsRecorder): PuristaMetricContext<Definitions>

createNoopMetricsRecorder

Functions

Source
createNoopMetricsRecorder.ts typescript
createNoopMetricsRecorder(): PuristaMetricsRecorder

createOpenStreamFunctionProxy

Functions

Source
createOpenStreamFunctionProxy.ts typescript
createOpenStreamFunctionProxy<TFaux>(openStreamOg: OpenStreamFunction, address?: EBMessageAddress, lvl: number): TFaux

createQueueEnqueueProxy

Functions

Source
createQueueEnqueueProxy.ts typescript
createQueueEnqueueProxy<TQueues>(enqueueFn: QueueInvokeFunction, queues?: TQueues): QueueInvokeFunction & QueueInvokeClientMap<TQueues>

createQueueScheduleProxy

Functions

Source
createQueueScheduleProxy.ts typescript
createQueueScheduleProxy<TQueues>(scheduleFn: QueueScheduleFunction, queues?: TQueues): QueueScheduleFunction & QueueScheduleProxy<QueueInvokeClientMap<TQueues>>

createStateStoreQueueJobStore

Functions

Source
createStateStoreQueueJobStore.ts typescript
createStateStoreQueueJobStore(stateStore: StateStore, prefix: string): QueueJobStore

exportAsyncApi

Functions

Source
exportAsyncApi.ts typescript
exportAsyncApi(options: ExportAsyncApiOptions): Promise<{ asyncapi: string; channels: JsonRecord; components: { messages: JsonRecord; schemas: { PuristaHeaders: { properties: unknown; type: unknown } } }; defaultContentType: string; info: { title: string; version: string }; operations: JsonRecord; ... }>

exportCloudEventsSchema

Functions

Source
exportCloudEventsSchema.ts typescript
exportCloudEventsSchema(): { $schema: string; properties: { contentencoding: { type: string }; correlationid: { type: string }; data: boolean; datacontenttype: { type: string }; id: { type: string }; instanceId: { type: string }; ... }; required: string[]; title: string; type: string }

exportKubernetesCronJobs

Functions

Source
exportKubernetesCronJobs.ts typescript
exportKubernetesCronJobs(options: ExportKubernetesCronJobsOptions): Promise<KubernetesCronJobManifest[]>

exportRuntimeCapabilities

Functions

Source
exportRuntimeCapabilities.ts typescript
exportRuntimeCapabilities(options: ExportRuntimeCapabilitiesOptions): { eventBridge: { capabilities: EventBridgeCapabilities | undefined; name: string } | undefined; mode: RuntimeCapabilityReportMode; queueBridge: { capabilities: QueueBridgeCapabilities | undefined; idempotency: { enforced: unknown; exactlyOnce: unknown } | undefined; longRunning: { leaseExtension: unknown; leaseInspection: unknown; strictStartupValidation: unknown } | undefined; name: string; resultPolicies: { event: unknown; state: unknown; stateAndEvent: unknown } | undefined } | undefined; version: string }

exportScheduleManifest

Functions

Source
exportScheduleManifest.ts typescript
exportScheduleManifest(options: ExportScheduleManifestOptions): Promise<ScheduleManifest>

exportServiceDefinitions

Functions

Source
exportServiceDefinitions.ts typescript
exportServiceDefinitions(serviceBuilders: ServiceBuilder<ServiceBuilderTypes>[]): Promise<FullDefinition>

fromCloudEvent

Functions

Source
fromCloudEvent.ts typescript
fromCloudEvent<Payload>(cloudEvent: JsonRecord | CloudEvent, options: FromCloudEventOptions): { contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: CustomMessage; ... }

getCommandFunctionWithValidation

Functions

Source
getCommandFunctionWithValidation.ts typescript
getCommandFunctionWithValidation<S>(fn: CommandFunction<S, unknown, unknown, unknown, unknown, unknown, any, any, any, any, any>, inputPayloadSchema: Schema | undefined, inputParameterSchema: Schema | undefined, outputPayloadSchema: Schema | undefined, beforeGuards: Record<string, CommandBeforeGuardHook<S, unknown, unknown, unknown, unknown, any, any, any, any, any>>): (this: S, context: { configs: { getConfig: ConfigGetterFunction; removeConfig: ConfigDeleteFunction; setConfig: ConfigSetterFunction }; emit: EmitCustomMessageFunction<any>; logger: Logger; message: Readonly<Command<MessagePayloadType, MessageParamsType>>; metrics: PuristaMetricContext<Metrics>; queue: QueueContext & QueueContext<any>; ... }, payload: unknown, parameter: unknown) => Promise<unknown>

getDefaultEventBridgeConfig

Functions

Source
getDefaultEventBridgeConfig.ts typescript
getDefaultEventBridgeConfig(): Complete<DefaultEventBridgeConfig>

getDefaultLogLevel

Functions

Source
getDefaultLogLevel.ts typescript
getDefaultLogLevel(): LogLevelName

getFrameworkMetricDefinition

Functions

Source
getFrameworkMetricDefinition.ts typescript
getFrameworkMetricDefinition(name: string): PuristaMetricDefinition<undefined> | undefined

getNewSubscriptionStorageEntry

Functions

Source
getNewSubscriptionStorageEntry.ts typescript
getNewSubscriptionStorageEntry(subscription: Subscription, cb: (message: EBMessage) => Promise<Omit<{ contentEncoding: unknown; contentType: unknown; correlationId: unknown; eventName: unknown; id: unknown; messageType: unknown; ... }, unknown | unknown> | undefined>): SubscriptionStorageEntry

getSubscriptionFunctionWithValidation

Functions

Source
getSubscriptionFunctionWithValidation.ts typescript
getSubscriptionFunctionWithValidation<S>(fn: SubscriptionFunction<S, unknown, unknown, unknown, any, any, any, any, any>, inputPayloadSchema: Schema | undefined, inputParameterSchema: Schema | undefined, outputPayloadSchema: Schema | undefined, beforeGuards: Record<string, SubscriptionBeforeGuardHook<S, unknown, unknown, any, any, any, any, any>>): (this: S, context: { configs: { getConfig: ConfigGetterFunction; removeConfig: ConfigDeleteFunction; setConfig: ConfigSetterFunction }; emit: EmitCustomMessageFunction<any>; logger: Logger; message: Readonly<EBMessage>; metrics: PuristaMetricContext<Metrics>; queue: QueueContext & QueueContext<any>; ... }, payload: unknown, parameter: unknown) => Promise<unknown>

getTimeoutPromise

Functions

Source
getTimeoutPromise.ts typescript
getTimeoutPromise<T>(fn: Promise<T>, ttl: number): Promise<T>

initDefaultConfigStore

Functions

Source
initDefaultConfigStore.ts typescript
initDefaultConfigStore(options: { logger: Logger }): DefaultConfigStore

initDefaultSecretStore

Functions

Source
initDefaultSecretStore.ts typescript
initDefaultSecretStore(options: { logger: Logger }): DefaultSecretStore

initDefaultStateStore

Functions

Source
initDefaultStateStore.ts typescript
initDefaultStateStore(options: { logger: Logger }): DefaultStateStore

initLogger

Functions

Source
initLogger.ts typescript
initLogger(level: LogLevelName, opt?: LoggerOptions<never, boolean>): Logger

isAllowedMetricAttributeKey

Functions

Source
isAllowedMetricAttributeKey.ts typescript
isAllowedMetricAttributeKey(key: string): boolean

isCustomMessage

Functions

Source
isCustomMessage.ts typescript
isCustomMessage(message: EBMessage): message

isHttpExposedServiceMeta

Functions

Source
isHttpExposedServiceMeta.ts typescript
isHttpExposedServiceMeta(input?: unknown): input

isInfoMessage

Functions

Source
isInfoMessage.ts typescript
isInfoMessage(message: EBMessage): message

isInfoServiceFunctionAdded

Functions

Source
isInfoServiceFunctionAdded.ts typescript
isInfoServiceFunctionAdded(message: EBMessage): message

isMessageMatchingSubscription

Functions

Source
isMessageMatchingSubscription.ts typescript
isMessageMatchingSubscription(_log: Logger, message: EBMessage, subscription: SubscriptionStorageEntry): boolean

isStreamControl

Functions

Source
isStreamControl.ts typescript
isStreamControl(message: StreamMessage): message

isStreamFrame

Functions

Source
isStreamFrame.ts typescript
isStreamFrame<Chunk, Final>(message: StreamMessage<Chunk, Final>): message

isStreamMessage

Functions

Source
isStreamMessage.ts typescript
isStreamMessage(message: EBMessage): message

isStreamOpenRequest

Functions

Source
isStreamOpenRequest.ts typescript
isStreamOpenRequest(message: StreamMessage): message

isSubscriptionConsumerControlError

Functions

Source
isSubscriptionConsumerControlError.ts typescript
isSubscriptionConsumerControlError(value: unknown): value

isSubscriptionHandlerControlResult

Functions

Source
isSubscriptionHandlerControlResult.ts typescript
isSubscriptionHandlerControlResult(value: unknown): value

isSubscriptionHandlerResult

Functions

Source
isSubscriptionHandlerResult.ts typescript
isSubscriptionHandlerResult(value: unknown): value

mergeMetricAttributes

Functions

Source
mergeMetricAttributes.ts typescript
mergeMetricAttributes(defaultAttributes?: PuristaMetricAttributes, attributes?: PuristaMetricAttributes): { attributes: PuristaMetricAttributes; droppedAttributeKeys: string[] }

mergeServiceDefinition

Functions

Source
mergeServiceDefinition.ts typescript
mergeServiceDefinition<T>(existing: FullServiceDefinition, definitionToAdd: ServiceDefinitions): T

safeBind

Functions

Source
safeBind.ts typescript
safeBind<ThisType, Args, ReturnType>(fn: (this: ThisType, ...args: Args) => ReturnType, thisArg: ThisType): (...args: Args) => ReturnType

schemaObjectToTsType

Functions

Source
schemaObjectToTsType.ts typescript
schemaObjectToTsType(schemaObject: SchemaObject | ReferenceObject, options?: Partial<GlobalContext>): string

throwIfNotValidMessage

Functions

Source
throwIfNotValidMessage.ts typescript
throwIfNotValidMessage(input: unknown): void

toCloudEvent

Functions

Source
toCloudEvent.ts typescript
toCloudEvent<Payload>(message: { contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: CustomMessage; ... }): CloudEvent

toJSONSchema

Functions

Source
toJSONSchema.ts typescript
toJSONSchema(schema: Schema, options?: JsonSchemaOptions): Promise<SchemaObject>

transformSchemaObject

Functions

Source
transformSchemaObject.ts typescript
transformSchemaObject(schemaObject: SchemaObject | ReferenceObject, ctx: GlobalContext, path: string): string

validate

Functions

Source
validate.ts typescript
validate<TSchema>(schema: TSchema, value: unknown): Promise<ValidationResult<Infer<TSchema>>>

validateMetricAttributes

Functions

Source
validateMetricAttributes.ts typescript
validateMetricAttributes(attributes?: Record<string, unknown>): { attributes: PuristaMetricAttributes; droppedAttributeKeys: string[] }

validateMetricDefinition

Functions

Source
validateMetricDefinition.ts typescript
validateMetricDefinition(name: string, definition: PuristaMetricDefinition<any>, knownMetricNames: Iterable<string>): Promise<void>

validateMetricDefinitions

Functions

Source
validateMetricDefinitions.ts typescript
validateMetricDefinitions(definitions: Record<string, PuristaMetricDefinition<any>>): Promise<void>

Command

17 entries

CommandDefinitionBuilder

Classes

Source
CommandDefinitionBuilder.ts typescript
class CommandDefinitionBuilder<S, C>

Command definition builder is a helper to create and define a command for a service. It helps to set all needed information like schemas and hooks. With these information, the types are automatically set and extended.

CommandAfterGuardHook

Types

Source
CommandAfterGuardHook.ts typescript
type CommandAfterGuardHook = (this: S, context: CommandFunctionContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>, result: Readonly<FunctionOutputType>, originalPayload: Readonly<FunctionPayloadType>, originalParameter: Readonly<FunctionParamsType>) => Promise<void>

Definition of after guard hook functions. This guard is called after function successfully returns and after output validation.

CommandBeforeGuardHook

Types

Source
CommandBeforeGuardHook.ts typescript
type CommandBeforeGuardHook = (this: S, context: CommandFunctionContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>, payload: Readonly<FunctionPayloadType>, parameter: Readonly<FunctionParamsType>) => Promise<void>

Guard is called after command function input validation and before executing the command function. The guard is usefull to separate for example auth checks from business logic. It should throw HandledError or return void.

CommandDefinition

Types

Source
CommandDefinition.ts typescript
type CommandDefinition = void

The definition for a command provided by some service.

CommandErrorResponse

Types

Source
CommandErrorResponse.ts typescript
type CommandErrorResponse = Prettify<{ contentEncoding: "utf-8"; contentType: "application/json"; correlationId: CorrelationId; isHandledError: boolean; messageType: EBMessageType.CommandErrorResponse; payload: { data: unknown; message: string; status: StatusCode }; ... } & EBMessageBase>

CommandErrorResponse is a response to a specific previously received command which indicates some failure.

CommandFunction

Types

Source
CommandFunction.ts typescript
type CommandFunction = (this: S, context: CommandFunctionContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes, ServiceClassMetrics<S>>, payload: Readonly<FunctionPayloadType>, parameter: Readonly<FunctionParamsType>) => Promise<FunctionOutputType>

CommandFunction is a function which will be triggered when a matching event bridge message is received by the service

CommandFunctionContext

Types

Source
CommandFunctionContext.ts typescript
type CommandFunctionContext = Prettify<ContextBase<Metrics> & PuristaMetricContextProperty<Metrics> & CommandFunctionContextEnhancements<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>>

The command function context which will be passed into command function.

CommandFunctionContextEnhancements

Types

Source
CommandFunctionContextEnhancements.ts typescript
type CommandFunctionContextEnhancements = void

It provides the original command message with types for payload and parameter. Also, the methods:

CommandResponse

Types

Source
CommandResponse.ts typescript
type CommandResponse = CommandSuccessResponse<T> | CommandErrorResponse

CommandResponse is a response to a specific previously received command which can be either a success or failure

CommandSuccessResponse

Types

Source
CommandSuccessResponse.ts typescript
type CommandSuccessResponse = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.CommandSuccessResponse; payload: PayloadType; receiver: EBMessageSenderAddress } & EBMessageBase>

CommandSuccessResponse is a response to a specific previously received command. It indicates that the command was executed successfully and contains the result payload

CommandTransformFunctionContext

Types

Source
CommandTransformFunctionContext.ts typescript
type CommandTransformFunctionContext = Prettify<ContextBase & { message: Readonly<Command<unknown, unknown>>; resources: Resources }>

CommandTransformInputHook

Types

Source
CommandTransformInputHook.ts typescript
type CommandTransformInputHook = (this: S, context: CommandTransformFunctionContext<MessagePayloadType, MessageParamsType, Resources>, payload: Readonly<TransformInputPayload>, parameter: Readonly<TransformInputParams>) => Promise<{ parameter: FunctionParamsType; payload: FunctionPayloadType }>

The command transform gets the raw message payload and parameter input, which is validated against the transform input schemas. The command transform function is called before guard hooks and before the actual command function.

CommandTransformOutputHook

Types

Source
CommandTransformOutputHook.ts typescript
type CommandTransformOutputHook = (this: S, context: CommandTransformFunctionContext<MessagePayloadType, MessageParamsType, Resources>, input: Readonly<FinalFunctionOutputType>, params: Readonly<FunctionParamsType>) => Promise<TransformOutputHookOutput>

This transform hook is executed after function output validation and AfterGuardHooks.

isCommand

Functions

Source
isCommand.ts typescript
isCommand(message: EBMessage): message

isCommandErrorResponse

Functions

Source
isCommandErrorResponse.ts typescript
isCommandErrorResponse(message: unknown): message

isCommandResponse

Functions

Source
isCommandResponse.ts typescript
isCommandResponse(message: EBMessage): message

isCommandSuccessResponse

Functions

Source
isCommandSuccessResponse.ts typescript
isCommandSuccessResponse(message: EBMessage): message

Event bridge

23 entries

EventBridgeCommandTransport

Enums

Source
EventBridgeCommandTransport.ts typescript
enum EventBridgeCommandTransport

Command request/response transport strategy used by an event bridge.

EventBridgeLateResponseHandling

Enums

Source
EventBridgeLateResponseHandling.ts typescript
enum EventBridgeLateResponseHandling

Policy for command responses that arrive after invocation timeout.

EventBridgeResponseConfirmationLevel

Enums

Source
EventBridgeResponseConfirmationLevel.ts typescript
enum EventBridgeResponseConfirmationLevel

Confirmation level available for command responses.

EventBridgeStreamLateFrameHandling

Enums

Source
EventBridgeStreamLateFrameHandling.ts typescript
enum EventBridgeStreamLateFrameHandling

Policy for stream frames that arrive after stream timeout.

DefaultEventBridge

Classes

Source
DefaultEventBridge.ts typescript
class DefaultEventBridge

Process-local in-memory event bridge for development and tests.

EventBridgeBaseClass

Classes

Source
EventBridgeBaseClass.ts typescript
class EventBridgeBaseClass<ConfigType>

The base class to be extended by event bridge implementations

InFlightExecutionTracker

Classes

Source
InFlightExecutionTracker.ts typescript
class InFlightExecutionTracker

Tracks active event bridge handler promises for drain and health reporting.

PendingInvocationRegistry

Classes

Source
PendingInvocationRegistry.ts typescript
class PendingInvocationRegistry<T>

Registry for command invocations awaiting correlated responses.

PendingStreamRegistry

Classes

Source
PendingStreamRegistry.ts typescript
class PendingStreamRegistry<Chunk, Final>

Registry for stream invocations awaiting correlated frames.

EventBridge

Interfaces

Source
EventBridge.ts typescript
interface EventBridge

Event transport adapter contract used by PURISTA services.

DefinitionEventBridgeConfig

Types

Source
DefinitionEventBridgeConfig.ts typescript
type DefinitionEventBridgeConfig = void

Event bridge delivery requirements requested by command, stream, or subscription definitions.

DefinitionEventBridgeConsumerFailureHandling

Types

Source
DefinitionEventBridgeConsumerFailureHandling.ts typescript
type DefinitionEventBridgeConsumerFailureHandling = void

Advisory failure handling for broker-backed consumers such as subscriptions.

DefinitionEventBridgeConsumerFailureMode

Types

Source
DefinitionEventBridgeConsumerFailureMode.ts typescript
type DefinitionEventBridgeConsumerFailureMode = "strict" | "best-effort"

Startup behavior when requested consumer failure semantics are unsupported.

EventBridgeCapabilities

Types

Source
EventBridgeCapabilities.ts typescript
type EventBridgeCapabilities = void

Capability matrix reported by an EventBridge.

EventBridgeCommandCapabilities

Types

Source
EventBridgeCommandCapabilities.ts typescript
type EventBridgeCommandCapabilities = void

Command reliability capabilities for an event bridge.

EventBridgeConsumerFailureCapabilities

Types

Source
EventBridgeConsumerFailureCapabilities.ts typescript
type EventBridgeConsumerFailureCapabilities = void

Subscription consumer failure capabilities for an event bridge.

EventBridgeInFlightExecutionCounts

Types

Source
EventBridgeInFlightExecutionCounts.ts typescript
type EventBridgeInFlightExecutionCounts = Record<InFlightExecutionKind, number>

In-flight execution counts grouped by work kind.

EventBridgeStreamCapabilities

Types

Source
EventBridgeStreamCapabilities.ts typescript
type EventBridgeStreamCapabilities = void

Stream transport capabilities for an event bridge.

InFlightExecutionKind

Types

Source
InFlightExecutionKind.ts typescript
type InFlightExecutionKind = "command" | "subscription" | "stream" | "generic"

Work kind tracked during event bridge drain and diagnostics.

PendingInvocation

Types

Source
PendingInvocation.ts typescript
type PendingInvocation = void

Internal pending command invocation callbacks and timeout handle.

PendingStreamSession

Types

Source
PendingStreamSession.ts typescript
type PendingStreamSession = void

Mutable stream session stored for one pending stream invocation.

PushResult

Types

Source
PushResult.ts typescript
type PushResult = "accepted" | "late" | "missing"

Result of routing a stream frame or error to a pending stream session.

getCommandQueueName

Functions

Source
getCommandQueueName.ts typescript
getCommandQueueName(address: EBMessageAddress): string

Helper

19 entries

convertToCamelCase

Functions

Source
convertToCamelCase.ts typescript
convertToCamelCase(str: string): string

convertToKebabCase

Functions

Source
convertToKebabCase.ts typescript
convertToKebabCase(str: string): string

convertToPascalCase

Functions

Source
convertToPascalCase.ts typescript
convertToPascalCase(str: string): string

convertToSnakeCase

Functions

Source
convertToSnakeCase.ts typescript
convertToSnakeCase(str: string): string

createErrorResponse

Functions

Source
createErrorResponse.ts typescript
createErrorResponse(instanceId: string, originalEBMessage: Readonly<Command>, statusCode: StatusCode, error?: unknown): Readonly<Omit<CommandErrorResponse, "instanceId">>

createInfoMessage

Functions

Source
createInfoMessage.ts typescript
createInfoMessage(messageType: InfoMessageType, sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string }, additional?: Partial<InfoMessage>): InfoMessage

createSuccessResponse

Functions

Source
createSuccessResponse.ts typescript
createSuccessResponse<T>(instanceId: string, originalEBMessage: Readonly<Command>, payload: T, eventName?: string, contentType: string, contentEncoding: string): Readonly<CommandSuccessResponse<T>>

deserializeOtp

Functions

Source
deserializeOtp.ts typescript
deserializeOtp(logger: Logger, otp?: string): Context | undefined

getCleanedMessage

Functions

Source
getCleanedMessage.ts typescript
getCleanedMessage(message: Readonly<EBMessage>, stripeOutContent: boolean): Record<string, unknown>

getErrorMessageForCode

Functions

Source
getErrorMessageForCode.ts typescript
getErrorMessageForCode(code: StatusCode): string

getNewCorrelationId

Functions

Source
getNewCorrelationId.ts typescript
getNewCorrelationId(): string

getNewEBMessageId

Functions

Source
getNewEBMessageId.ts typescript
getNewEBMessageId(): string

getNewInstanceId

Functions

Source
getNewInstanceId.ts typescript
getNewInstanceId(): string

getNewTraceId

Functions

Source
getNewTraceId.ts typescript
getNewTraceId(): string

getSubscriptionQueueName

Functions

Source
getSubscriptionQueueName.ts typescript
getSubscriptionQueueName(address: EBMessageAddress): string

getUniqueId

Functions

Source
getUniqueId.ts typescript
getUniqueId(): string

gracefulShutdown

Functions

Source
gracefulShutdown.ts typescript
gracefulShutdown(logger: Logger, list: ShutdownEntry[], timeoutMs: number): void

isDevelop

Functions

Source
isDevelop.ts typescript
isDevelop(): boolean

serializeOtp

Functions

Source
serializeOtp.ts typescript
serializeOtp(): string

Queue

25 entries

DefinitionQueueBridgeConfig

Types

Source
DefinitionQueueBridgeConfig.ts typescript
type DefinitionQueueBridgeConfig = void

Queue bridge delivery requirements requested by the service definition.

EventToQueueBindingDefinition

Types

Source
EventToQueueBindingDefinition.ts typescript
type EventToQueueBindingDefinition = void

Binds an emitted event to a queue enqueue operation.

EventToQueueIdempotencyMode

Types

Source
EventToQueueIdempotencyMode.ts typescript
type EventToQueueIdempotencyMode = "advisory" | "strict"

Idempotency requirement for event-to-queue bindings.

EventToQueueIdempotencyStrategy

Types

Source
EventToQueueIdempotencyStrategy.ts typescript
type EventToQueueIdempotencyStrategy = "messageId" | "correlationId" | "eventField" | "none" | (event: any) => string | undefined

Strategy used to derive an idempotency key from the source event.

QueueDefinition

Types

Source
QueueDefinition.ts typescript
type QueueDefinition = void

Public definition of a queue contract attached to a PURISTA service.

QueueEnqueueOptions

Types

Source
QueueEnqueueOptions.ts typescript
type QueueEnqueueOptions = void

Options passed to a queue bridge when enqueueing work.

QueueExecutionProfileName

Types

Source
QueueExecutionProfileName.ts typescript
type QueueExecutionProfileName = "longRunning"

Named execution profile for queue workers.

QueueHandlerResult

Types

Source
QueueHandlerResult.ts typescript
type QueueHandlerResult = { headers: Record<string, string>; output: unknown; status: "success" } | { delayMs: number; reason: string; status: "retry" } | { delayMs: number; fatal: boolean; reason: string; status: "fail" }

Result returned by a queue worker handler.

QueueJobContext

Types

Source
QueueJobContext.ts typescript
type QueueJobContext = ContextBase<Metrics> & PuristaMetricContextProperty<Metrics> & { emit: EmitCustomMessageFunction<EmitList>; job: QueueJobControls; message: Readonly<QueueMessage<MessagePayloadType, MessageParamsType>>; queue: QueueContext<QueueInvokes>; resources: Resources; service: Invokes; ... }

Context object passed to queue worker handlers.

QueueJobControls

Types

Source
QueueJobControls.ts typescript
type QueueJobControls = void

Runtime controls available to a queue worker for the currently leased job.

QueueLifecycleConfig

Types

Source
QueueLifecycleConfig.ts typescript
type QueueLifecycleConfig = void

Queue retry, leasing, heartbeat, and poison-message policy.

QueueLongRunningExecutionProfile

Types

Source
QueueLongRunningExecutionProfile.ts typescript
type QueueLongRunningExecutionProfile = void

Runtime policy for work that may exceed a normal lease interval.

QueueMessage

Types

Source
QueueMessage.ts typescript
type QueueMessage = void

Provider-neutral queue message shape used by bridges and workers.

QueueMetrics

Types

Source
QueueMetrics.ts typescript
type QueueMetrics = void

Queue operational metrics returned by a bridge.

QueueOrderingGuarantee

Types

Source
QueueOrderingGuarantee.ts typescript
type QueueOrderingGuarantee = "none" | "fifo" | "partition"

Ordering guarantee requested by a queue definition.

QueueResultEventIdStrategy

Types

Source
QueueResultEventIdStrategy.ts typescript
type QueueResultEventIdStrategy = "jobIdAndStatus" | (input: { attempt: number; jobId: string; queueName: string; status: QueueResultStatus }) => string

Strategy used to generate result event ids.

QueueResultEventPayload

Types

Source
QueueResultEventPayload.ts typescript
type QueueResultEventPayload = void

Payload emitted for queue result events.

QueueResultPolicy

Types

Source
QueueResultPolicy.ts typescript
type QueueResultPolicy = void

Controls how queue worker outcomes are persisted or emitted.

QueueResultPolicyMode

Types

Source
QueueResultPolicyMode.ts typescript
type QueueResultPolicyMode = "none" | "event" | "state" | "state-and-event"

Queue result publication mode.

QueueRetryStrategy

Types

Source
QueueRetryStrategy.ts typescript
type QueueRetryStrategy = void

Exponential backoff settings for queue retries.

QueueTransformContext

Types

Source
QueueTransformContext.ts typescript
type QueueTransformContext = ContextBase & { resources: Resources }

Context passed to queue transform hooks.

QueueTransformHook

Types

Source
QueueTransformHook.ts typescript
type QueueTransformHook = (this: S, context: QueueTransformContext<Resources>, payload: Readonly<Payload>, parameter: Readonly<Params | undefined>) => Promise<{ parameter: Params; payload: Payload }>

Hook that can normalize queue payload and parameters before enqueue or execute.

QueueWorkerDefinition

Types

Source
QueueWorkerDefinition.ts typescript
type QueueWorkerDefinition = void

Public definition of a worker attached to a queue.

QueueWorkerHandler

Types

Source
QueueWorkerHandler.ts typescript
type QueueWorkerHandler = (context: QueueJobContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes, Metrics>, message: QueueMessage<MessagePayloadType, MessageParamsType>) => Promise<QueueHandlerResult | undefined>

Function that processes one leased queue message.

QueueWorkerMode

Types

Source
QueueWorkerMode.ts typescript
type QueueWorkerMode = "continuous" | "interval" | "sequential"

Queue worker polling mode.

Queue bridge

10 entries

DefaultQueueBridge

Classes

Source
DefaultQueueBridge.ts typescript
class DefaultQueueBridge

In-memory queue bridge for development and unit tests.

QueueBridge

Interfaces

Source
QueueBridge.ts typescript
interface QueueBridge

Queue transport adapter contract used by PURISTA services and queue workers.

DefaultQueueBridgeOptions

Types

Source
DefaultQueueBridgeOptions.ts typescript
type DefaultQueueBridgeOptions = void

Configuration for the process-local DefaultQueueBridge.

QueueBridgeCapabilities

Types

Source
QueueBridgeCapabilities.ts typescript
type QueueBridgeCapabilities = void

Capability matrix reported by a QueueBridge.

QueueDeadLetterListOptions

Types

Source
QueueDeadLetterListOptions.ts typescript
type QueueDeadLetterListOptions = void

Pagination options for dead-letter and lease inspection APIs.

QueueDeadLetterRedriveOptions

Types

Source
QueueDeadLetterRedriveOptions.ts typescript
type QueueDeadLetterRedriveOptions = void

Options for moving dead-letter messages back to the live queue.

QueueEnqueueResult

Types

Source
QueueEnqueueResult.ts typescript
type QueueEnqueueResult = void

Metadata returned after a message has been accepted for queue delivery.

QueueLeaseInspectionRecord

Types

Source
QueueLeaseInspectionRecord.ts typescript
type QueueLeaseInspectionRecord = void

Diagnostic view of an active queue lease.

QueueLeaseOptions

Types

Source
QueueLeaseOptions.ts typescript
type QueueLeaseOptions = void

Options used when leasing work from a queue.

QueueRetryRequest

Types

Source
QueueRetryRequest.ts typescript
type QueueRetryRequest = void

Retry request returned to a queue bridge when work should run again.

Schema

3 entries

OpenApiZodAny

Types

Source
OpenApiZodAny.ts typescript
type OpenApiZodAny = ZodType & { metaOpenApi: SchemaObject | SchemaObject[] }

Zod schema augmented with PURISTA OpenAPI metadata.

extendApi

Functions

Source
extendApi.ts typescript
extendApi<TSchema>(schema: TSchema, meta: SchemaObject | SchemaObject[]): TSchema

validationToSchema

Functions

Source
validationToSchema.ts typescript
validationToSchema<T>(schema?: T): Promise<SchemaObject | undefined>

Service

4 entries

Service

Classes

Source
Service.ts typescript
class Service<S>

Base class for all services. This class provides base functions to work with the event bridge, logging and so on

ServiceBuilder

Classes

Source
ServiceBuilder.ts typescript
class ServiceBuilder<S>

This class is used to build a service.

ServiceClass

Interfaces

Source
ServiceClass.ts typescript
interface ServiceClass<S>

The ServiceClass interface

ServiceConstructorInput

Types

Source
ServiceConstructorInput.ts typescript
type ServiceConstructorInput = void

Store

18 entries

ConfigStoreBaseClass

Classes

Source
ConfigStoreBaseClass.ts typescript
class ConfigStoreBaseClass<ConfigStoreConfigType>

Base class for config store adapters.

DefaultConfigStore

Classes

Source
DefaultConfigStore.ts typescript
class DefaultConfigStore

Process-local in-memory config store for development and tests.

DefaultSecretStore

Classes

Source
DefaultSecretStore.ts typescript
class DefaultSecretStore

Process-local in-memory secret store for development and tests.

DefaultStateStore

Classes

Source
DefaultStateStore.ts typescript
class DefaultStateStore

Process-local in-memory state store for development and tests.

SecretStoreBaseClass

Classes

Source
SecretStoreBaseClass.ts typescript
class SecretStoreBaseClass<SecretStoreConfigType>

Base class for secret store adapters.

StateStoreBaseClass

Classes

Source
StateStoreBaseClass.ts typescript
class StateStoreBaseClass<StateStoreConfigType>

Base class for state store implementations.

ConfigStore

Interfaces

Source
ConfigStore.ts typescript
interface ConfigStore

Interface definition for config store adapters

SecretStore

Interfaces

Source
SecretStore.ts typescript
interface SecretStore

Interface definition for a secret store implementation

StateStore

Interfaces

Source
StateStore.ts typescript
interface StateStore

Interface definition for state store implementations

ConfigDeleteFunction

Types

Source
ConfigDeleteFunction.ts typescript
type ConfigDeleteFunction = (configName: string) => Promise<void>

delete a config value from the config store

ConfigGetterFunction

Types

Source
ConfigGetterFunction.ts typescript
type ConfigGetterFunction = (...configNames: ConfigNames) => Promise<ObjectWithKeysFromStringArray<ConfigNames>>

get a config value from the config store

ConfigSetterFunction

Types

Source
ConfigSetterFunction.ts typescript
type ConfigSetterFunction = (configName: string, configValue: unknown) => Promise<void>

set a config value in the config store

SecretDeleteFunction

Types

Source
SecretDeleteFunction.ts typescript
type SecretDeleteFunction = (secretName: string) => Promise<void>

delete a secret from the secret store

SecretGetterFunction

Types

Source
SecretGetterFunction.ts typescript
type SecretGetterFunction = (...secretNames: SecretNames) => Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>

get a secret from the secret store

SecretSetterFunction

Types

Source
SecretSetterFunction.ts typescript
type SecretSetterFunction = (secretName: string, secretValue: string) => Promise<void>

set a secret in the secret store

StateDeleteFunction

Types

Source
StateDeleteFunction.ts typescript
type StateDeleteFunction = (stateName: string) => Promise<void>

delete a state value from the state store

StateGetterFunction

Types

Source
StateGetterFunction.ts typescript
type StateGetterFunction = (...stateNames: StateNames) => Promise<ObjectWithKeysFromStringArray<StateNames>>

get a state value from the state store

StateSetterFunction

Types

Source
StateSetterFunction.ts typescript
type StateSetterFunction = (stateName: string, stateValue: unknown) => Promise<void>

set a state value in the state store

Stream

2 entries

StreamAfterGuardHook

Types

Source
StreamAfterGuardHook.ts typescript
type StreamAfterGuardHook = (this: S, context: StreamFunctionContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>, result: Readonly<FunctionFinalType>, originalPayload: Readonly<FunctionPayloadType>, originalParameter: Readonly<FunctionParamsType>) => Promise<void>

Guard called after a stream completes successfully and the final payload has been validated.

StreamBeforeGuardHook

Types

Source
StreamBeforeGuardHook.ts typescript
type StreamBeforeGuardHook = (this: S, context: StreamFunctionContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>, payload: Readonly<FunctionPayloadType>, parameter: Readonly<FunctionParamsType>) => Promise<void>

Guard called after stream input validation and before the stream handler runs.

Subscription

11 entries

SubscriptionDefinitionBuilder

Classes

Source
SubscriptionDefinitionBuilder.ts typescript
class SubscriptionDefinitionBuilder<S, C>

Subscription definition builder is a helper to create and define a subscriptions for a service. It helps to set all needed filters.

Subscription

Types

Source
Subscription.ts typescript
type Subscription = void

A subscription managed by the event bridge

SubscriptionAfterGuardHook

Types

Source
SubscriptionAfterGuardHook.ts typescript
type SubscriptionAfterGuardHook = (this: ServiceClassType, context: SubscriptionFunctionContext<Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>, result: Readonly<FunctionResultType>, payload: Readonly<FunctionPayloadOutputType>, parameter: Readonly<FunctionParameterType>) => Promise<void>

Definition of after guard hook functions. This guard is called after function successfully returns and after output validation.

SubscriptionBeforeGuardHook

Types

Source
SubscriptionBeforeGuardHook.ts typescript
type SubscriptionBeforeGuardHook = (this: S, context: SubscriptionFunctionContext<Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>, payload: Readonly<FunctionPayloadType>, parameter: Readonly<FunctionParamsType>) => Promise<void>

Guard is called after command function input validation and before executing the command function. The guard is usefull to separate for example auth checks from business logic. It should throw HandledError or return void.

SubscriptionDefinition

Types

Source
SubscriptionDefinition.ts typescript
type SubscriptionDefinition = void

The definition for a subscription provided by some service.

SubscriptionFunction

Types

Source
SubscriptionFunction.ts typescript
type SubscriptionFunction = (this: ServiceClassType, context: SubscriptionFunctionContext<Resources, Invokes, StreamInvokes, EmitList, QueueInvokes, ServiceClassMetrics<ServiceClassType>>, payload: Readonly<FunctionPayloadType>, parameter: Readonly<FunctionParamsType>) => Promise<FunctionOutputType | SubscriptionHandlerResult>

CommandFunction is a function which will be triggered when a matching event bridge message is received by the service

SubscriptionFunctionContext

Types

Source
SubscriptionFunctionContext.ts typescript
type SubscriptionFunctionContext = Prettify<ContextBase<Metrics> & PuristaMetricContextProperty<Metrics> & SubscriptionFunctionContextEnhancements<Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>>

The subscription function context which will be passed into subscription function.

SubscriptionFunctionContextEnhancements

Types

Source
SubscriptionFunctionContextEnhancements.ts typescript
type SubscriptionFunctionContextEnhancements = void

It provides the original command message. Also, the methods:

SubscriptionTransformFunctionContext

Types

Source
SubscriptionTransformFunctionContext.ts typescript
type SubscriptionTransformFunctionContext = Prettify<ContextBase & { message: Readonly<EBMessage>; resources: Resources }>

SubscriptionTransformInputHook

Types

Source
SubscriptionTransformInputHook.ts typescript
type SubscriptionTransformInputHook = (this: S, context: SubscriptionTransformFunctionContext, payload: Readonly<TransformInputPayload>, parameter: Readonly<TransformInputParams>) => Promise<{ parameter: Readonly<FunctionParamsType>; payload: Readonly<FunctionPayloadType> }>

SubscriptionTransformOutputHook

Types

Source
SubscriptionTransformOutputHook.ts typescript
type SubscriptionTransformOutputHook = (this: S, context: SubscriptionTransformFunctionContext, payload: Readonly<FinalFunctionOutputType>, parameter: Readonly<FunctionParamsType>) => Promise<TransformOutputHookOutput>

This transform hook is executed after function output validation and AfterGuardHooks.

Unit test helper

26 entries

CommandContextMockBuilderTypes

Types

Source
CommandContextMockBuilderTypes.ts typescript
type CommandContextMockBuilderTypes = T extends CommandDefinitionBuilder<any, C> ? C : never

Infer the internal builder type configuration from a command builder.

CreateQueueWorkerContextMockInput

Types

Source
CreateQueueWorkerContextMockInput.ts typescript
type CreateQueueWorkerContextMockInput = void

Input for createQueueWorkerContextMock.

InferCommandBuilderConfig

Types

Source
InferCommandBuilderConfig.ts typescript
type InferCommandBuilderConfig = T extends CommandDefinitionBuilder<any, C> ? C : never

Infer the definition config type from a command builder.

InferCommandHarnessServiceBuilderConfig

Types

Source
InferCommandHarnessServiceBuilderConfig.ts typescript
type InferCommandHarnessServiceBuilderConfig = T extends ServiceBuilder<S> ? S : never

Infer the instance config type from a service builder.

InferQueueWorkerHarnessServiceBuilderConfig

Types

Source
InferQueueWorkerHarnessServiceBuilderConfig.ts typescript
type InferQueueWorkerHarnessServiceBuilderConfig = T extends ServiceBuilder<S> ? S : never

Infer the instance config type from a service builder.

InferStreamBuilderConfig

Types

Source
InferStreamBuilderConfig.ts typescript
type InferStreamBuilderConfig = T extends StreamDefinitionBuilder<any, C> ? C : never

Infer the definition config type from a stream builder.

InferStreamHarnessServiceBuilderConfig

Types

Source
InferStreamHarnessServiceBuilderConfig.ts typescript
type InferStreamHarnessServiceBuilderConfig = T extends ServiceBuilder<S> ? S : never

Infer the instance config type from a service builder.

QueueWorkerContextMockResult

Types

Source
QueueWorkerContextMockResult.ts typescript
type QueueWorkerContextMockResult = void

Result returned by createQueueWorkerContextMock.

StreamContextMockBuilderTypes

Types

Source
StreamContextMockBuilderTypes.ts typescript
type StreamContextMockBuilderTypes = T extends StreamDefinitionBuilder<any, C> ? C : never

Infer the internal builder type configuration from a stream builder.

SubscriptionContextMockBuilderTypes

Types

Source
SubscriptionContextMockBuilderTypes.ts typescript
type SubscriptionContextMockBuilderTypes = T extends SubscriptionDefinitionBuilder<any, C> ? C : never

Infer the internal builder type configuration from a subscription builder.

createCommandContextMock

Functions

Source
createCommandContextMock.ts typescript
createCommandContextMock<TBuilder>(builder: TBuilder, input: CreateCommandContextMockInput<TBuilder>): CommandContextMockResult<TBuilder>

createCommandTestHarness

Functions

Source
createCommandTestHarness.ts typescript
createCommandTestHarness<TServiceBuilder, TCommandBuilder>(serviceBuilder: TServiceBuilder, commandBuilder: TCommandBuilder, options: CreateCommandTestHarnessOptions<TServiceBuilder>): Promise<{ destroy: () => Promise<void>; eventBridge: EventBridge; run: (input: { parameter: InferIn<InferCommandBuilderConfig<TCommandBuilder>["ParamsSchema"]>; payload: InferIn<InferCommandBuilderConfig<TCommandBuilder>["PayloadSchema"]> }) => Promise<{ message: unknown; result: unknown }>; service: Service<ServiceClassTypes<EmptyObject, EmptyObject>>; stubs: { eventBridge: Record<unknown, unknown> | undefined } }>

createQueueWorkerContextMock

Functions

Source
createQueueWorkerContextMock.ts typescript
createQueueWorkerContextMock<Payload, Parameter, Resources>(_builder: QueueWorkerBuilder, input: CreateQueueWorkerContextMockInput<Payload, Parameter, Resources>): QueueWorkerContextMockResult<Payload, Parameter, Resources>

createQueueWorkerTestHarness

Functions

Source
createQueueWorkerTestHarness.ts typescript
createQueueWorkerTestHarness<TServiceBuilder>(serviceBuilder: TServiceBuilder, workerBuilder: QueueWorkerBuilder, options: mapped & { eventBridge: EventBridge; queueBridge: QueueBridge }): Promise<{ destroy: () => Promise<void>; eventBridge: EventBridge; queueBridge: QueueBridge; run: (message: QueueMessage<Payload, Parameter>) => Promise<{ ackCalls: unknown; deadLetterCalls: unknown; extendLeaseCalls: unknown; nackCalls: unknown }>; service: Service<ServiceClassTypes<EmptyObject, EmptyObject>>; stubs: { eventBridge: Record<unknown, unknown> | undefined; queueBridge: Record<unknown, unknown> | undefined } }>

createStreamContextMock

Functions

Source
createStreamContextMock.ts typescript
createStreamContextMock<TBuilder>(builder: TBuilder, input: CreateStreamContextMockInput<TBuilder>): StreamContextMockResult<TBuilder>

createStreamTestHarness

Functions

Source
createStreamTestHarness.ts typescript
createStreamTestHarness<TServiceBuilder, TStreamBuilder>(serviceBuilder: TServiceBuilder, streamBuilder: TStreamBuilder, options: mapped & { eventBridge: EventBridge }): Promise<{ destroy: () => Promise<void>; eventBridge: EventBridge; run: (input: { parameter: InferIn<InferStreamBuilderConfig<TStreamBuilder>["ParamsSchema"]>; payload: InferIn<InferStreamBuilderConfig<TStreamBuilder>["PayloadSchema"]> }) => Promise<{ chunks: unknown; final: unknown; frames: unknown }>; service: Service<ServiceClassTypes<EmptyObject, EmptyObject>>; stubs: { eventBridge: Record<unknown, unknown> | undefined } }>

createSubscriptionContextMock

Functions

Source
createSubscriptionContextMock.ts typescript
createSubscriptionContextMock<TBuilder>(builder: TBuilder, input: CreateSubscriptionContextMockInput<TBuilder>): SubscriptionContextMockResult<TBuilder>

getCommandErrorMessageMock

Functions

Source
getCommandErrorMessageMock.ts typescript
getCommandErrorMessageMock(error?: HandledError | UnhandledError, input?: Partial<{ contentEncoding: "utf-8"; contentType: "application/json"; correlationId: string; eventName: string; id: string; isHandledError: boolean; ... }>, commandMessage?: { contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: Command; ... }): Readonly<CommandErrorResponse>

getCommandMessageMock

Functions

Source
getCommandMessageMock.ts typescript
getCommandMessageMock<Payload, Parameter>(input?: Partial<{ contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: Command; ... }> & { payload: { parameter: Parameter; payload: Payload } }): Readonly<Command<Payload, Parameter>>

getCommandSuccessMessageMock

Functions

Source
getCommandSuccessMessageMock.ts typescript
getCommandSuccessMessageMock<PayloadType>(payload: PayloadType, input?: Partial<{ contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: CommandSuccessResponse; ... }>, commandMessage?: { contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: Command; ... }): Readonly<CommandSuccessResponse<PayloadType>>

getCommandTransformContextMock

Functions

Source
getCommandTransformContextMock.ts typescript
getCommandTransformContextMock<MessagePayloadType, MessageParamsType, Resources>(input: { parameter: MessageParamsType; payload: MessagePayloadType; resources: Partial<Resources>; sandbox: SinonSandbox }): { mock: { configs: { getConfig: ConfigGetterFunction; removeConfig: ConfigDeleteFunction; setConfig: ConfigSetterFunction }; logger: Logger; message: Readonly<Command<PayloadType, ParameterType>>; metrics: PuristaMetricContext<Metrics>; queue: QueueContext; resources: Resources; ... }; stubs: { enqueue: SinonStub<any[], any>; getConfig: SinonStub<any[], any>; getSecret: SinonStub<any[], any>; getState: SinonStub<any[], any>; logger: { debug: SinonStub<unknown[], any>; error: SinonStub<unknown[], any>; fatal: SinonStub<unknown[], any>; info: SinonStub<unknown[], any>; trace: SinonStub<unknown[], any>; warn: SinonStub<unknown[], any> }; removeConfig: SinonStub<any[], any>; ... } }

getCustomMessageMessageMock

Functions

Source
getCustomMessageMessageMock.ts typescript
getCustomMessageMessageMock<PayloadType>(eventName: string, payload: PayloadType, input?: Partial<{ contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: CustomMessage; ... }>): Readonly<CustomMessage<PayloadType>>

getEventBridgeMock

Functions

Source
getEventBridgeMock.ts typescript
getEventBridgeMock(sandboxOrOptions?: SinonSandbox | { capabilities: EventBridgeCapabilityOverrides; sandbox: SinonSandbox }): { mock: EventBridge; stubs: Record<string, SinonStub> }

getLoggerMock

Functions

Source
getLoggerMock.ts typescript
getLoggerMock(sandbox?: SinonSandbox): { mock: Logger; stubs: { debug: SinonStub<any[], any>; error: SinonStub<any[], any>; fatal: SinonStub<any[], any>; info: SinonStub<any[], any>; trace: SinonStub<any[], any>; warn: SinonStub<any[], any> } }

getQueueBridgeMock

Functions

Source
getQueueBridgeMock.ts typescript
getQueueBridgeMock(sandboxOrOptions?: SinonSandbox | { capabilities: Partial<QueueBridgeCapabilities>; sandbox: SinonSandbox }): { mock: QueueBridge; stubs: Record<string, SinonStub> }

getSubscriptionTransformContextMock

Functions

Source
getSubscriptionTransformContextMock.ts typescript
getSubscriptionTransformContextMock<Resources>(input: { message: EBMessage; resources: Partial<Resources>; sandbox: SinonSandbox }): { mock: { configs: { getConfig: ConfigGetterFunction; removeConfig: ConfigDeleteFunction; setConfig: ConfigSetterFunction }; logger: Logger; message: Readonly<EBMessage>; metrics: PuristaMetricContext<Metrics>; queue: QueueContext; resources: EmptyObject; ... }; stubs: { enqueue: SinonStub<any[], any>; getConfig: SinonStub<any[], any>; getSecret: SinonStub<any[], any>; getState: SinonStub<any[], any>; logger: { debug: SinonStub<unknown[], any>; error: SinonStub<unknown[], any>; fatal: SinonStub<unknown[], any>; info: SinonStub<unknown[], any>; trace: SinonStub<unknown[], any>; warn: SinonStub<unknown[], any> }; removeConfig: SinonStub<any[], any>; ... } }