Packages · @purista/core

@purista/core

This is the main package of PURISTA.

Signature

@purista/core.tstypescript
@purista/core

Enumerations

5 entries

EBMessageType

Enums

Source
EBMessageType.tstypescript
enum EBMessageType

Type of event bridge message

PuristaSpanName

Enums

Source
PuristaSpanName.tstypescript
enum PuristaSpanName

Opentelemetry span names used by PURISTA framework

PuristaSpanTag

Enums

Source
PuristaSpanTag.tstypescript
enum PuristaSpanTag

Opentelemetry tags set by PURISTA framework

StatusCode

Enums

Source
StatusCode.tstypescript
enum StatusCode

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

StoreType

Enums

Source
StoreType.tstypescript
enum StoreType

Classes

15 entries

AgentQueueBuilder

Classes

Source
AgentQueueBuilder.tstypescript
class AgentQueueBuilder<S>

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

AgentRunError

Classes

Source
AgentRunError.tstypescript
class AgentRunError

Error raised when a harness run terminates with a serialized error.

ClientBuilder

Classes

Source
ClientBuilder.tstypescript
class ClientBuilder

ClientBuilder to generate clients, based on service definitions.

DefaultLogger

Classes

Source
DefaultLogger.tstypescript
class DefaultLogger

GenericEventEmitter

Classes

Source
GenericEventEmitter.tstypescript
class GenericEventEmitter<T>

HandledError

Classes

Source
HandledError.tstypescript
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.tstypescript
class HttpClient<CustomConfig>

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

Logger

Classes

Source
Logger.tstypescript
class Logger

PuristaMetricsRecorder

Classes

Source
PuristaMetricsRecorder.tstypescript
class PuristaMetricsRecorder

OpenTelemetry API backed PURISTA metrics recorder.

QueueDefinitionBuilder

Classes

Source
QueueDefinitionBuilder.tstypescript
class QueueDefinitionBuilder

Builds a durable queue contract for background work.

QueueWorkerBuilder

Classes

Source
QueueWorkerBuilder.tstypescript
class QueueWorkerBuilder<S>

Builds a queue worker definition for one queue.

ScheduleDefinitionBuilder

Classes

Source
ScheduleDefinitionBuilder.tstypescript
class ScheduleDefinitionBuilder

Builds a schedule contract for an external scheduler.

StreamDefinitionBuilder

Classes

Source
StreamDefinitionBuilder.tstypescript
class StreamDefinitionBuilder<S, C>

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

SubscriptionConsumerControlError

Classes

Source
SubscriptionConsumerControlError.tstypescript
class SubscriptionConsumerControlError

UnhandledError

Classes

Source
UnhandledError.tstypescript
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.tstypescript
interface GlobalContext

Context passed to all submodules

IEmitter

Interfaces

Source
IEmitter.tstypescript
interface IEmitter<T>

ILogger

Interfaces

Source
ILogger.tstypescript
interface ILogger

MemoryMetricRecord

Interfaces

Source
MemoryMetricRecord.tstypescript
interface MemoryMetricRecord

Deterministic metric record captured by the memory recorder.

PuristaMetricDefinition

Interfaces

Source
PuristaMetricDefinition.tstypescript
interface PuristaMetricDefinition<AttributesSchema>

Declares one framework or application metric.

PuristaMetricsRecorderInterface

Interfaces

Source
PuristaMetricsRecorderInterface.tstypescript
interface PuristaMetricsRecorderInterface

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

PuristaMetricsRuntimeOptions

Interfaces

Source
PuristaMetricsRuntimeOptions.tstypescript
interface PuristaMetricsRuntimeOptions

Runtime metrics options consumed by PURISTA recorders.

RestClient

Interfaces

Source
RestClient.tstypescript
interface RestClient

REST API client abstraction for JSON-oriented HTTP calls.

StreamHandle

Interfaces

Source
StreamHandle.tstypescript
interface StreamHandle<Chunk, Final>

StreamWriter

Interfaces

Source
StreamWriter.tstypescript
interface StreamWriter<Chunk, Final>

TransformSchemaObjectOptions

Interfaces

Source
TransformSchemaObjectOptions.tstypescript
interface TransformSchemaObjectOptions

Type Aliases

247 entries

addPrefixToObject

Types

Source
addPrefixToObject.tstypescript
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.tstypescript
type AgentDefinition = void

Attached agent definition before expansion into service definitions.

AgentDurableWorkspaceStore

Types

Source
AgentDurableWorkspaceStore.tstypescript
type AgentDurableWorkspaceStore = void

Structural durable workspace store accepted until the harness package version is bumped.

AgentDurableWorkspaceStorePolicy

Types

Source
AgentDurableWorkspaceStorePolicy.tstypescript
type AgentDurableWorkspaceStorePolicy = void

Adapter-neutral durable workspace policy mirrored from `@purista/harness`.

AgentExecutionDefinition

Types

Source
AgentExecutionDefinition.tstypescript
type AgentExecutionDefinition = { definition: HarnessAgentDefinition<any, any, any>; kind: "harnessAgent" } | { agents: Record<string, HarnessAgentDefinition<any, any, any>>; 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.tstypescript
type AgentExecutionKind = "harnessAgent" | "harnessWorkflow" | "runFunction"

Execution implementation kind used by an attached agent definition.

AgentExecutionPolicy

Types

Source
AgentExecutionPolicy.tstypescript
type AgentExecutionPolicy = void

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

AgentHandler

Types

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

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

AgentHandlerContext

Types

Source
AgentHandlerContext.tstypescript
type AgentHandlerContext = void

Context passed to an attached agent run function.

AgentHandlerModelBindings

Types

Source
AgentHandlerModelBindings.tstypescript
type AgentHandlerModelBindings = mapped

Typed model handles exposed to an agent run function.

AgentHarnessWorkflowOptions

Types

Source
AgentHarnessWorkflowOptions.tstypescript
type AgentHarnessWorkflowOptions = void

Harness-local agents registered together with a wrapped harness workflow.

AgentHttpExposure

Types

Source
AgentHttpExposure.tstypescript
type AgentHttpExposure = void

HTTP projection metadata for the generated agent command or stream.

AgentInvokeMap

Types

Source
AgentInvokeMap.tstypescript
type AgentInvokeMap = mapped

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

AgentManifest

Types

Source
AgentManifest.tstypescript
type AgentManifest = void

Provider-neutral manifest describing an attached PURISTA agent.

AgentModelBinding

Types

Source
AgentModelBinding.tstypescript
type AgentModelBinding = void

Declares a model alias required by an attached PURISTA agent.

AgentModelCapability

Types

Source
AgentModelCapability.tstypescript
type AgentModelCapability = ModelCapability

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

AgentQueueBuilderTypes

Types

Source
AgentQueueBuilderTypes.tstypescript
type AgentQueueBuilderTypes = void

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

AgentQueueResultPolicy

Types

Source
AgentQueueResultPolicy.tstypescript
type AgentQueueResultPolicy = void

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

AgentQueueResultPolicyMode

Types

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

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

AgentResponseMode

Types

Source
AgentResponseMode.tstypescript
type AgentResponseMode = "accepted" | "status" | "stream" | "event"

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

AgentResponseModeOptions

Types

Source
AgentResponseModeOptions.tstypescript
type AgentResponseModeOptions = void

Options for long-running agent response contracts.

AgentRunEvent

Types

Source
AgentRunEvent.tstypescript
type AgentRunEvent = void

Harness run event decorated with PURISTA agent identity metadata.

AgentRunIdentity

Types

Source
AgentRunIdentity.tstypescript
type AgentRunIdentity = void

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

AgentRunResult

Types

Source
AgentRunResult.tstypescript
type AgentRunResult = void

Aggregate result returned by an attached agent runtime.

AgentRuntimeInvocationInput

Types

Source
AgentRuntimeInvocationInput.tstypescript
type AgentRuntimeInvocationInput = void

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

AgentRuntimeModelBinding

Types

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

AgentRuntimeModelBindings

Types

Source
AgentRuntimeModelBindings.tstypescript
type AgentRuntimeModelBindings = mapped

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

AgentRuntimeOptions

Types

Source
AgentRuntimeOptions.tstypescript
type AgentRuntimeOptions = void

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

AgentRuntimeRef

Types

Source
AgentRuntimeRef.tstypescript
type AgentRuntimeRef = void

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

AgentRuntimeStreamInvocationInput

Types

Source
AgentRuntimeStreamInvocationInput.tstypescript
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.tstypescript
type AgentSandboxPolicy = void

Optional sandbox adapter configuration passed through to the agent runtime.

AgentSessionPolicy

Types

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

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

AgentSkillCatalogEntry

Types

Source
AgentSkillCatalogEntry.tstypescript
type AgentSkillCatalogEntry = void

Metadata-only skill catalog entry exposed to attached agent handlers.

AgentSkillContext

Types

Source
AgentSkillContext.tstypescript
type AgentSkillContext = void

Handler helper for resolving declared skill metadata without exposing skill bodies.

AgentSkillDiscoveryOptions

Types

Source
AgentSkillDiscoveryOptions.tstypescript
type AgentSkillDiscoveryOptions = void

Optional local skill discovery settings for attached agent runtime startup.

AgentSkillResolver

Types

Source
AgentSkillResolver.tstypescript
type AgentSkillResolver = (input: { agentName: string; name: string; resourceName: string; serviceName: string; serviceVersion: string }) => Promise<{ directory: unknown } | undefined> | { directory: string } | undefined

Resolves a declared agent skill name to a runtime skill directory.

AgentSkillRuntimeBinding

Types

Source
AgentSkillRuntimeBinding.tstypescript
type AgentSkillRuntimeBinding = { directory: string; source: string; trust: "trusted" | "project" | "user" } | { resolver: AgentSkillResolver; source: string; trust: "trusted" | "project" | "user" }

Runtime binding for a skill declared with `AgentQueueBuilder.useSkills(...)`.

AgentSkillRuntimeOptions

Types

Source
AgentSkillRuntimeOptions.tstypescript
type AgentSkillRuntimeOptions = void

Runtime skill bindings supplied through `ServiceBuilder.getInstance(..., { ai: { skills } })`.

AgentWorkspaceCapabilityRequirement

Types

Source
AgentWorkspaceCapabilityRequirement.tstypescript
type AgentWorkspaceCapabilityRequirement = string

Capability required by a durable attached-agent workspace policy.

AgentWorkspacePolicy

Types

Source
AgentWorkspacePolicy.tstypescript
type AgentWorkspacePolicy = void

Durable workspace behavior declared by an attached agent manifest.

AllowedAgentDefinition

Types

Source
AllowedAgentDefinition.tstypescript
type AllowedAgentDefinition = void

Declares one attached agent that this attached agent may call.

AllowedCommandToolDefinition

Types

Source
AllowedCommandToolDefinition.tstypescript
type AllowedCommandToolDefinition = void

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

AnyAgentQueueBuilderTypes

Types

Source
AnyAgentQueueBuilderTypes.tstypescript
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.

AnyQueueWorkerDefinition

Types

Source
AnyQueueWorkerDefinition.tstypescript
type AnyQueueWorkerDefinition = QueueWorkerDefinition<any, any, any, any, any, any, any, any, any>

AttachedAgentDefinition

Types

Source
AttachedAgentDefinition.tstypescript
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.tstypescript
type AttachedCoreDefinition = object

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

AuthCredentials

Types

Source
AuthCredentials.tstypescript
type AuthCredentials = void

HTTP authentication information kept in memory by HttpClient.

BrokerHeaderCommandMsg

Types

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

BrokerHeaderCommandResponseMsg

Types

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

BrokerHeaderCustomMsg

Types

Source
BrokerHeaderCustomMsg.tstypescript
type BrokerHeaderCustomMsg = void

ClientBuilderConfig

Types

Source
ClientBuilderConfig.tstypescript
type ClientBuilderConfig = z.infer<typeof httpClientConfigSchema>

ClientBuilderEvents

Types

Source
ClientBuilderEvents.tstypescript
type ClientBuilderEvents = void

CloudEvent

Types

Source
CloudEvent.tstypescript
type CloudEvent = void

Command

Types

Source
Command.tstypescript
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.tstypescript
type CommandContextMockResult = void

CommandContextMockServiceClass

Types

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

CommandDefinitionBuilderTypes

Types

Source
CommandDefinitionBuilderTypes.tstypescript
type CommandDefinitionBuilderTypes = void

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

CommandDefinitionList

Types

Source
CommandDefinitionList.tstypescript
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.tstypescript
type CommandDefinitionListResolved = CommandDefinition<S, any, any, any, any, any, any, any, any, any, any, any, any, any, CommandDefinitionMetadataBase, any>[]

CommandDefinitionMetadataBase

Types

Source
CommandDefinitionMetadataBase.tstypescript
type CommandDefinitionMetadataBase = void

CommandToolInvokeMap

Types

Source
CommandToolInvokeMap.tstypescript
type CommandToolInvokeMap = mapped

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

Complete

Types

Source
Complete.tstypescript
type Complete = mapped

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

CompressionMethod

Types

Source
CompressionMethod.tstypescript
type CompressionMethod = "gzip" | "deflat" | "br" | undefined

Config

Types

Source
Config.tstypescript
type Config = z.infer<typeof configSchema>

ConfigFull

Types

Source
ConfigFull.tstypescript
type ConfigFull = z.infer<typeof configFullSchema>

ConfigStoreCacheMap

Types

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

Constructor

Types

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

Generic constructor type that preserves argument tuple inference.

ContentType

Types

Source
ContentType.tstypescript
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.tstypescript
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.tstypescript
type CorrelationId = string

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

CreateCommandContextMockInput

Types

Source
CreateCommandContextMockInput.tstypescript
type CreateCommandContextMockInput = void

CreateCommandTestHarnessOptions

Types

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

CreateStreamContextMockInput

Types

Source
CreateStreamContextMockInput.tstypescript
type CreateStreamContextMockInput = void

CreateSubscriptionContextMockInput

Types

Source
CreateSubscriptionContextMockInput.tstypescript
type CreateSubscriptionContextMockInput = void

CustomMessage

Types

Source
CustomMessage.tstypescript
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.tstypescript
type DefaultConfigStoreConfig = Record<string, unknown>

DefaultEventBridgeConfig

Types

Source
DefaultEventBridgeConfig.tstypescript
type DefaultEventBridgeConfig = void

The configuration for the DefaultEventBridge.

DefaultSecretStoreConfig

Types

Source
DefaultSecretStoreConfig.tstypescript
type DefaultSecretStoreConfig = Record<string, unknown>

DefaultStateStoreConfig

Types

Source
DefaultStateStoreConfig.tstypescript
type DefaultStateStoreConfig = Record<string, unknown>

EBMessage

Types

Source
EBMessage.tstypescript
type EBMessage = Command | CommandResponse | InfoMessage | CustomMessage | StreamMessage

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

EBMessageAddress

Types

Source
EBMessageAddress.tstypescript
type EBMessageAddress = void

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

EBMessageBase

Types

Source
EBMessageBase.tstypescript
type EBMessageBase = void

Default fields which are part of any purista message

EBMessageId

Types

Source
EBMessageId.tstypescript
type EBMessageId = string

Unique id of the event bridge message

EBMessageSenderAddress

Types

Source
EBMessageSenderAddress.tstypescript
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.tstypescript
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.tstypescript
type EmitSchemaList = mapped

EmptyObject

Types

Source
EmptyObject.tstypescript
type EmptyObject = object

ErrorResponsePayload

Types

Source
ErrorResponsePayload.tstypescript
type ErrorResponsePayload = void

Error message payload

EventBridgeCapabilityOverrides

Types

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

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

EventBridgeConfig

Types

Source
EventBridgeConfig.tstypescript
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.tstypescript
type EventKey = string & typeOperator

EventMap

Types

Source
EventMap.tstypescript
type EventMap = Record<string, unknown>

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

EventReceiver

Types

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

ExportAsyncApiOptions

Types

Source
ExportAsyncApiOptions.tstypescript
type ExportAsyncApiOptions = void

ExportKubernetesCronJobsOptions

Types

Source
ExportKubernetesCronJobsOptions.tstypescript
type ExportKubernetesCronJobsOptions = void

ExportRuntimeCapabilitiesOptions

Types

Source
ExportRuntimeCapabilitiesOptions.tstypescript
type ExportRuntimeCapabilitiesOptions = void

ExportScheduleManifestOptions

Types

Source
ExportScheduleManifestOptions.tstypescript
type ExportScheduleManifestOptions = void

FromCloudEventOptions

Types

Source
FromCloudEventOptions.tstypescript
type FromCloudEventOptions = void

FromEmitToOtherType

Types

Source
FromEmitToOtherType.tstypescript
type FromEmitToOtherType = mapped

Changes the canEmit proxy type to given type

FromInvokeToOtherType

Types

Source
FromInvokeToOtherType.tstypescript
type FromInvokeToOtherType = mapped

Changes the canInvoke proxy type to given type

FullDefinition

Types

Source
FullDefinition.tstypescript
type FullDefinition = void

FullServiceDefinition

Types

Source
FullServiceDefinition.tstypescript
type FullServiceDefinition = object

GetMessageParamsType

Types

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

GetMessagePayloadType

Types

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

HttpClientConfig

Types

Source
HttpClientConfig.tstypescript
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.tstypescript
type HttpClientRequestOptions = void

Options for a single HTTP request.

HttpExposedServiceMeta

Types

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

HttpExposureOptions

Types

Source
HttpExposureOptions.tstypescript
type HttpExposureOptions = void

Infer

Types

Source
Infer.tstypescript
type Infer = StandardSchemaV1.InferOutput<TSchema>

Infers output type from a schema.

InferIn

Types

Source
InferIn.tstypescript
type InferIn = StandardSchemaV1.InferInput<TSchema>

Infers input type from a schema.

InferMetricAttributes

Types

Source
InferMetricAttributes.tstypescript
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.tstypescript
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.tstypescript
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.tstypescript
type InferParameter = S extends Schema ? InferIn<S> : unknown

InferPayload

Types

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

InferTypeOrEmptyObject

Types

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

InFlightDiagnostics

Types

Source
InFlightDiagnostics.tstypescript
type InFlightDiagnostics = void

InFlightExecutionCounts

Types

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

InfoInvokeTimeout

Types

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

InfoInvokeTimeoutPayload

Types

Source
InfoInvokeTimeoutPayload.tstypescript
type InfoInvokeTimeoutPayload = void

InfoMessage

Types

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

InfoMessageType

Types

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

InfoServiceBase

Types

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

InfoServiceDrain

Types

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

InfoServiceFunctionAdded

Types

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

InfoServiceInit

Types

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

InfoServiceNotReady

Types

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

InfoServiceReady

Types

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

InfoServiceShutdown

Types

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

InfoSubscriptionError

Types

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

InstanceConfigType

Types

Source
InstanceConfigType.tstypescript
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.tstypescript
type InstanceId = string

the instance id of the event bridge

InstanceOrType

Types

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

InvokeFunction

Types

Source
InvokeFunction.tstypescript
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.tstypescript
type InvokeList = Record<string, Record<string, Record<string, { outputSchema: Schema; parameterSchema: Schema; payloadSchema: Schema }>>>

InvokeValidationMap

Types

Source
InvokeValidationMap.tstypescript
type InvokeValidationMap = object

IsConstructor

Types

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

JsonRecord

Types

Source
JsonRecord.tstypescript
type JsonRecord = Record<string, unknown>

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

JsonSchemaOptions

Types

Source
JsonSchemaOptions.tstypescript
type JsonSchemaOptions = void

KubernetesCronJobManifest

Types

Source
KubernetesCronJobManifest.tstypescript
type KubernetesCronJobManifest = void

KubernetesCronJobScheduleInput

Types

Source
KubernetesCronJobScheduleInput.tstypescript
type KubernetesCronJobScheduleInput = void

KubernetesCronJobTriggerTemplate

Types

Source
KubernetesCronJobTriggerTemplate.tstypescript
type KubernetesCronJobTriggerTemplate = void

LogFnParamType

Types

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

LoggerOptions

Types

Source
LoggerOptions.tstypescript
type LoggerOptions = void

LoggerStubs

Types

Source
LoggerStubs.tstypescript
type LoggerStubs = void

LogLevelName

Types

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

MetricAttributeArgs

Types

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

Method argument tuple for metric attributes.

NeverObject

Types

Source
NeverObject.tstypescript
type NeverObject = Record<string, never>

Newable

Types

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

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

NonEmptyString

Types

Source
NonEmptyString.tstypescript
type NonEmptyString = "" extends T ? never : T

ObjectWithKeysFromStringArray

Types

Source
ObjectWithKeysFromStringArray.tstypescript
type ObjectWithKeysFromStringArray = mapped

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

OpenStreamFunction

Types

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

PausedQueueWorkerState

Types

Source
PausedQueueWorkerState.tstypescript
type PausedQueueWorkerState = void

PausedSubscriptionConsumerHealthState

Types

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

PausedSubscriptionConsumersByRegistrationKey

Types

Source
PausedSubscriptionConsumersByRegistrationKey.tstypescript
type PausedSubscriptionConsumersByRegistrationKey = Record<string, PausedSubscriptionConsumerState>

PausedSubscriptionConsumerState

Types

Source
PausedSubscriptionConsumerState.tstypescript
type PausedSubscriptionConsumerState = void

PendigInvocation

Types

Source
PendigInvocation.tstypescript
type PendigInvocation = void

Prettify

Types

Source
Prettify.tstypescript
type Prettify = mapped & object

PrincipalId

Types

Source
PrincipalId.tstypescript
type PrincipalId = string

the principal id

PuristaMetricAttributes

Types

Source
PuristaMetricAttributes.tstypescript
type PuristaMetricAttributes = Record<string, PuristaMetricAttributeValue>

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

PuristaMetricAttributeValue

Types

Source
PuristaMetricAttributeValue.tstypescript
type PuristaMetricAttributeValue = string | number | boolean

Scalar metric attribute value accepted by PURISTA.

PuristaMetricContext

Types

Source
PuristaMetricContext.tstypescript
type PuristaMetricContext = mapped

Typed metric context exposed to handlers.

PuristaMetricContextProperty

Types

Source
PuristaMetricContextProperty.tstypescript
type PuristaMetricContextProperty = void

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

PuristaMetricDefinitions

Types

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

Named metric definitions keyed by their metric name.

PuristaMetricHandle

Types

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

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

PuristaMetricKind

Types

Source
PuristaMetricKind.tstypescript
type PuristaMetricKind = "counter" | "upDownCounter" | "histogram"

Supported PURISTA metric instrument kinds.

PuristaMetricRecord

Types

Source
PuristaMetricRecord.tstypescript
type PuristaMetricRecord = MemoryMetricRecord

QueryParameter

Types

Source
QueryParameter.tstypescript
type QueryParameter = void

QueueContext

Types

Source
QueueContext.tstypescript
type QueueContext = void

QueueDefinitionList

Types

Source
QueueDefinitionList.tstypescript
type QueueDefinitionList = Promise<QueueDefinition>[]

QueueDefinitionListResolved

Types

Source
QueueDefinitionListResolved.tstypescript
type QueueDefinitionListResolved = QueueDefinition[]

QueueHealthState

Types

Source
QueueHealthState.tstypescript
type QueueHealthState = void

QueueHealthStatus

Types

Source
QueueHealthStatus.tstypescript
type QueueHealthStatus = "ok" | "warn" | "error"

QueueInvokeClientMap

Types

Source
QueueInvokeClientMap.tstypescript
type QueueInvokeClientMap = mapped

QueueInvokeFunction

Types

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

QueueInvokeList

Types

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

QueueJobStatusRecord

Types

Source
QueueJobStatusRecord.tstypescript
type QueueJobStatusRecord = void

QueueJobStore

Types

Source
QueueJobStore.tstypescript
type QueueJobStore = void

QueueLease

Types

Source
QueueLease.tstypescript
type QueueLease = void

QueueResultPolicyDelivery

Types

Source
QueueResultPolicyDelivery.tstypescript
type QueueResultPolicyDelivery = "required" | "best-effort"

Delivery requirement for queue result publication.

QueueResultStatus

Types

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

Canonical queue result status values.

QueueScheduleFunction

Types

Source
QueueScheduleFunction.tstypescript
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.tstypescript
type QueueScheduleProxy = mapped

QueueWorkerAfterGuardHook

Types

Source
QueueWorkerAfterGuardHook.tstypescript
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.tstypescript
type QueueWorkerBeforeGuardHook = (this: S, context: QueueJobContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes>, message: Readonly<QueueMessage<MessagePayloadType, MessageParamsType>>) => Promise<void>

QueueWorkerBuilderTypes

Types

Source
QueueWorkerBuilderTypes.tstypescript
type QueueWorkerBuilderTypes = void

Type accumulator used by `QueueWorkerBuilder` for handler capabilities.

QueueWorkerContextMockBuilderTypes

Types

Source
QueueWorkerContextMockBuilderTypes.tstypescript
type QueueWorkerContextMockBuilderTypes = T extends QueueWorkerBuilder<C> ? C : QueueWorkerBuilderTypes

Infer the internal builder type configuration from a queue worker builder.

QueueWorkerDefinitionList

Types

Source
QueueWorkerDefinitionList.tstypescript
type QueueWorkerDefinitionList = Promise<AnyQueueWorkerDefinition>[]

QueueWorkerDefinitionListResolved

Types

Source
QueueWorkerDefinitionListResolved.tstypescript
type QueueWorkerDefinitionListResolved = AnyQueueWorkerDefinition[]

QueueWorkerPauseHealthState

Types

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

QueueWorkerPauseStateByQueue

Types

Source
QueueWorkerPauseStateByQueue.tstypescript
type QueueWorkerPauseStateByQueue = Record<string, PausedQueueWorkerState>

RuntimeBridgeCapabilities

Types

Source
RuntimeBridgeCapabilities.tstypescript
type RuntimeBridgeCapabilities = void

RuntimeCapabilityReportMode

Types

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

ScheduleConcurrencyPolicy

Types

Source
ScheduleConcurrencyPolicy.tstypescript
type ScheduleConcurrencyPolicy = "allow" | "forbid" | "replace"

ScheduleDefinition

Types

Source
ScheduleDefinition.tstypescript
type ScheduleDefinition = void

Provider-neutral schedule metadata exported from PURISTA definitions.

ScheduleExpression

Types

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

ScheduleManifest

Types

Source
ScheduleManifest.tstypescript
type ScheduleManifest = void

ScheduleMissedRunPolicy

Types

Source
ScheduleMissedRunPolicy.tstypescript
type ScheduleMissedRunPolicy = "skip" | "runOnce" | "backfill"

ScheduleOptions

Types

Source
ScheduleOptions.tstypescript
type ScheduleOptions = void

ScheduleTargetKind

Types

Source
ScheduleTargetKind.tstypescript
type ScheduleTargetKind = "event" | "queue" | "command"

Schema

Types

Source
Schema.tstypescript
type Schema = StandardSchemaV1

Common Standard Schema abstraction used across PURISTA boundaries.

SecretStoreCacheMap

Types

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

ServiceBuilderTypes

Types

Source
ServiceBuilderTypes.tstypescript
type ServiceBuilderTypes = void

ServiceClassMetrics

Types

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

ServiceClassTypes

Types

Source
ServiceClassTypes.tstypescript
type ServiceClassTypes = void

ServiceContractInput

Types

Source
ServiceContractInput.tstypescript
type ServiceContractInput = FullDefinition | FullServiceDefinition

ServiceDefinitions

Types

Source
ServiceDefinitions.tstypescript
type ServiceDefinitions = void

ServiceHealthState

Types

Source
ServiceHealthState.tstypescript
type ServiceHealthState = void

ServiceHealthStatus

Types

Source
ServiceHealthStatus.tstypescript
type ServiceHealthStatus = "ok" | "warn" | "error"

ServiceInfoType

Types

Source
ServiceInfoType.tstypescript
type ServiceInfoType = void

General service information

SetNewTypeValue

Types

Source
SetNewTypeValue.tstypescript
type SetNewTypeValue = mapped

SetNewTypeValues

Types

Source
SetNewTypeValues.tstypescript
type SetNewTypeValues = mapped

ShutdownEntry

Types

Source
ShutdownEntry.tstypescript
type ShutdownEntry = void

Entry of thing you like to shutdown gracefully

StoreBaseConfig

Types

Source
StoreBaseConfig.tstypescript
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.tstypescript
type StreamContextMockResult = void

StreamContextMockServiceClass

Types

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

StreamControl

Types

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

StreamControlPayload

Types

Source
StreamControlPayload.tstypescript
type StreamControlPayload = void

StreamDefinition

Types

Source
StreamDefinition.tstypescript
type StreamDefinition = void

StreamDefinitionBuilderTypes

Types

Source
StreamDefinitionBuilderTypes.tstypescript
type StreamDefinitionBuilderTypes = void

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

StreamDefinitionList

Types

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

StreamDefinitionListResolved

Types

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

StreamDefinitionMetadataBase

Types

Source
StreamDefinitionMetadataBase.tstypescript
type StreamDefinitionMetadataBase = void

StreamErrorPayload

Types

Source
StreamErrorPayload.tstypescript
type StreamErrorPayload = void

StreamFrame

Types

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

StreamFramePayload

Types

Source
StreamFramePayload.tstypescript
type StreamFramePayload = void

StreamFrameType

Types

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

StreamFunction

Types

Source
StreamFunction.tstypescript
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.tstypescript
type StreamFunctionContext = Prettify<ContextBase<Metrics> & PuristaMetricContextProperty<Metrics> & StreamFunctionContextEnhancements<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>>

StreamFunctionContextEnhancements

Types

Source
StreamFunctionContextEnhancements.tstypescript
type StreamFunctionContextEnhancements = void

StreamInvokeList

Types

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

StreamMessage

Types

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

StreamOpenRequest

Types

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

StreamOpenRequestPayload

Types

Source
StreamOpenRequestPayload.tstypescript
type StreamOpenRequestPayload = void

SubscriptionContextMockResult

Types

Source
SubscriptionContextMockResult.tstypescript
type SubscriptionContextMockResult = void

SubscriptionContextMockServiceClass

Types

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

SubscriptionDefinitionBuilderTypes

Types

Source
SubscriptionDefinitionBuilderTypes.tstypescript
type SubscriptionDefinitionBuilderTypes = void

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

SubscriptionDefinitionList

Types

Source
SubscriptionDefinitionList.tstypescript
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.tstypescript
type SubscriptionDefinitionListResolved = SubscriptionDefinition<ServiceClassType, any, any, any, any, any, any, any, any, any, any, any, SubscriptionDefinitionMetadataBase, any>[]

SubscriptionDefinitionMetadataBase

Types

Source
SubscriptionDefinitionMetadataBase.tstypescript
type SubscriptionDefinitionMetadataBase = void

SubscriptionHandlerControlResult

Types

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

SubscriptionHandlerResult

Types

Source
SubscriptionHandlerResult.tstypescript
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.tstypescript
type SubscriptionStorageEntry = void

SupportedHttpMethod

Types

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

Supported HTTP-Methods for defining endpoints

TenantId

Types

Source
TenantId.tstypescript
type TenantId = string

the tenant id

TraceId

Types

Source
TraceId.tstypescript
type TraceId = string

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

ValidationResult

Types

Source
ValidationResult.tstypescript
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.tstypescript
const CONFIG_FILE_NAME: "purista.client.json"

configFullSchema

Variables

Source
configFullSchema.tstypescript
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.tstypescript
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.tstypescript
const defaultQueueLifecycleConfig: QueueLifecycleConfig

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

eventBridgeClientConfigSchema

Variables

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

frameworkMetricDefinitions

Variables

Source
frameworkMetricDefinitions.tstypescript
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.tstypescript
const httpClientConfigSchema: ZodObject<{ clientName: ZodDefault<ZodString> }, $strip>

infoMessageTypes

Variables

Source
infoMessageTypes.tstypescript
const infoMessageTypes: EBMessageType[]

MIN_CONTENT_SIZE_FOR_COMPRESSION

Variables

Source
MIN_CONTENT_SIZE_FOR_COMPRESSION.tstypescript
const MIN_CONTENT_SIZE_FOR_COMPRESSION: 1024

puristaVersion

Variables

Source
puristaVersion.tstypescript
const puristaVersion: "3.2.3"

ServiceInfoValidator

Variables

Source
ServiceInfoValidator.tstypescript
const ServiceInfoValidator: { set: void }

Functions

54 entries

assertNonArrowFunction

Functions

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

convertEmitValidationsToSchema

Functions

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

convertInvokeValidationsToSchema

Functions

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

createInvokeFunctionProxy

Functions

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

createMemoryMetricsRecorder

Functions

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

createMetricContext

Functions

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

createNoopMetricsRecorder

Functions

Source
createNoopMetricsRecorder.tstypescript
createNoopMetricsRecorder(): PuristaMetricsRecorder

createOpenStreamFunctionProxy

Functions

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

createQueueEnqueueProxy

Functions

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

createQueueScheduleProxy

Functions

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

createStateStoreQueueJobStore

Functions

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

exportAsyncApi

Functions

Source
exportAsyncApi.tstypescript
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.tstypescript
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.tstypescript
exportKubernetesCronJobs(options: ExportKubernetesCronJobsOptions): Promise<KubernetesCronJobManifest[]>

exportRuntimeCapabilities

Functions

Source
exportRuntimeCapabilities.tstypescript
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.tstypescript
exportScheduleManifest(options: ExportScheduleManifestOptions): Promise<ScheduleManifest>

exportServiceDefinitions

Functions

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

fromCloudEvent

Functions

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

getCommandFunctionWithValidation

Functions

Source
getCommandFunctionWithValidation.tstypescript
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.tstypescript
getDefaultEventBridgeConfig(): Complete<DefaultEventBridgeConfig>

getDefaultLogLevel

Functions

Source
getDefaultLogLevel.tstypescript
getDefaultLogLevel(): LogLevelName

getFrameworkMetricDefinition

Functions

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

getNewSubscriptionStorageEntry

Functions

Source
getNewSubscriptionStorageEntry.tstypescript
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.tstypescript
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.tstypescript
getTimeoutPromise<T>(fn: Promise<T>, ttl: number): Promise<T>

initDefaultConfigStore

Functions

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

initDefaultSecretStore

Functions

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

initDefaultStateStore

Functions

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

initLogger

Functions

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

isAllowedMetricAttributeKey

Functions

Source
isAllowedMetricAttributeKey.tstypescript
isAllowedMetricAttributeKey(key: string): boolean

isCustomMessage

Functions

Source
isCustomMessage.tstypescript
isCustomMessage(message: EBMessage): message

isHttpExposedServiceMeta

Functions

Source
isHttpExposedServiceMeta.tstypescript
isHttpExposedServiceMeta(input?: unknown): input

isInfoMessage

Functions

Source
isInfoMessage.tstypescript
isInfoMessage(message: EBMessage): message

isInfoServiceFunctionAdded

Functions

Source
isInfoServiceFunctionAdded.tstypescript
isInfoServiceFunctionAdded(message: EBMessage): message

isMessageMatchingSubscription

Functions

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

isStreamControl

Functions

Source
isStreamControl.tstypescript
isStreamControl(message: StreamMessage): message

isStreamFrame

Functions

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

isStreamMessage

Functions

Source
isStreamMessage.tstypescript
isStreamMessage(message: EBMessage): message

isStreamOpenRequest

Functions

Source
isStreamOpenRequest.tstypescript
isStreamOpenRequest(message: StreamMessage): message

isSubscriptionConsumerControlError

Functions

Source
isSubscriptionConsumerControlError.tstypescript
isSubscriptionConsumerControlError(value: unknown): value

isSubscriptionHandlerControlResult

Functions

Source
isSubscriptionHandlerControlResult.tstypescript
isSubscriptionHandlerControlResult(value: unknown): value

isSubscriptionHandlerResult

Functions

Source
isSubscriptionHandlerResult.tstypescript
isSubscriptionHandlerResult(value: unknown): value

mergeMetricAttributes

Functions

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

mergeServiceDefinition

Functions

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

safeBind

Functions

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

schemaObjectToTsType

Functions

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

throwIfNotValidMessage

Functions

Source
throwIfNotValidMessage.tstypescript
throwIfNotValidMessage(input: unknown): void

toCloudEvent

Functions

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

toJSONSchema

Functions

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

transformSchemaObject

Functions

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

validate

Functions

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

validateMetricAttributes

Functions

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

validateMetricDefinition

Functions

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

validateMetricDefinitions

Functions

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

Command

17 entries

CommandDefinitionBuilder

Classes

Source
CommandDefinitionBuilder.tstypescript
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.tstypescript
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.tstypescript
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.tstypescript
type CommandDefinition = void

The definition for a command provided by some service.

CommandErrorResponse

Types

Source
CommandErrorResponse.tstypescript
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.tstypescript
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.tstypescript
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.tstypescript
type CommandFunctionContextEnhancements = void

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

CommandResponse

Types

Source
CommandResponse.tstypescript
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.tstypescript
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.tstypescript
type CommandTransformFunctionContext = Prettify<ContextBase & { message: Readonly<Command<unknown, unknown>>; resources: Resources }>

CommandTransformInputHook

Types

Source
CommandTransformInputHook.tstypescript
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.tstypescript
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.tstypescript
isCommand(message: EBMessage): message

isCommandErrorResponse

Functions

Source
isCommandErrorResponse.tstypescript
isCommandErrorResponse(message: unknown): message

isCommandResponse

Functions

Source
isCommandResponse.tstypescript
isCommandResponse(message: EBMessage): message

isCommandSuccessResponse

Functions

Source
isCommandSuccessResponse.tstypescript
isCommandSuccessResponse(message: EBMessage): message

Event bridge

23 entries

EventBridgeCommandTransport

Enums

Source
EventBridgeCommandTransport.tstypescript
enum EventBridgeCommandTransport

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

EventBridgeLateResponseHandling

Enums

Source
EventBridgeLateResponseHandling.tstypescript
enum EventBridgeLateResponseHandling

Policy for command responses that arrive after invocation timeout.

EventBridgeResponseConfirmationLevel

Enums

Source
EventBridgeResponseConfirmationLevel.tstypescript
enum EventBridgeResponseConfirmationLevel

Confirmation level available for command responses.

EventBridgeStreamLateFrameHandling

Enums

Source
EventBridgeStreamLateFrameHandling.tstypescript
enum EventBridgeStreamLateFrameHandling

Policy for stream frames that arrive after stream timeout.

DefaultEventBridge

Classes

Source
DefaultEventBridge.tstypescript
class DefaultEventBridge

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

EventBridgeBaseClass

Classes

Source
EventBridgeBaseClass.tstypescript
class EventBridgeBaseClass<ConfigType>

The base class to be extended by event bridge implementations

InFlightExecutionTracker

Classes

Source
InFlightExecutionTracker.tstypescript
class InFlightExecutionTracker

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

PendingInvocationRegistry

Classes

Source
PendingInvocationRegistry.tstypescript
class PendingInvocationRegistry<T>

Registry for command invocations awaiting correlated responses.

PendingStreamRegistry

Classes

Source
PendingStreamRegistry.tstypescript
class PendingStreamRegistry<Chunk, Final>

Registry for stream invocations awaiting correlated frames.

EventBridge

Interfaces

Source
EventBridge.tstypescript
interface EventBridge

Event transport adapter contract used by PURISTA services.

DefinitionEventBridgeConfig

Types

Source
DefinitionEventBridgeConfig.tstypescript
type DefinitionEventBridgeConfig = void

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

DefinitionEventBridgeConsumerFailureHandling

Types

Source
DefinitionEventBridgeConsumerFailureHandling.tstypescript
type DefinitionEventBridgeConsumerFailureHandling = void

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

DefinitionEventBridgeConsumerFailureMode

Types

Source
DefinitionEventBridgeConsumerFailureMode.tstypescript
type DefinitionEventBridgeConsumerFailureMode = "strict" | "best-effort"

Startup behavior when requested consumer failure semantics are unsupported.

EventBridgeCapabilities

Types

Source
EventBridgeCapabilities.tstypescript
type EventBridgeCapabilities = void

Capability matrix reported by an EventBridge.

EventBridgeCommandCapabilities

Types

Source
EventBridgeCommandCapabilities.tstypescript
type EventBridgeCommandCapabilities = void

Command reliability capabilities for an event bridge.

EventBridgeConsumerFailureCapabilities

Types

Source
EventBridgeConsumerFailureCapabilities.tstypescript
type EventBridgeConsumerFailureCapabilities = void

Subscription consumer failure capabilities for an event bridge.

EventBridgeInFlightExecutionCounts

Types

Source
EventBridgeInFlightExecutionCounts.tstypescript
type EventBridgeInFlightExecutionCounts = Record<InFlightExecutionKind, number>

In-flight execution counts grouped by work kind.

EventBridgeStreamCapabilities

Types

Source
EventBridgeStreamCapabilities.tstypescript
type EventBridgeStreamCapabilities = void

Stream transport capabilities for an event bridge.

InFlightExecutionKind

Types

Source
InFlightExecutionKind.tstypescript
type InFlightExecutionKind = "command" | "subscription" | "stream" | "generic"

Work kind tracked during event bridge drain and diagnostics.

PendingInvocation

Types

Source
PendingInvocation.tstypescript
type PendingInvocation = void

Internal pending command invocation callbacks and timeout handle.

PendingStreamSession

Types

Source
PendingStreamSession.tstypescript
type PendingStreamSession = void

Mutable stream session stored for one pending stream invocation.

PushResult

Types

Source
PushResult.tstypescript
type PushResult = "accepted" | "late" | "missing"

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

getCommandQueueName

Functions

Source
getCommandQueueName.tstypescript
getCommandQueueName(address: EBMessageAddress): string

Helper

19 entries

convertToCamelCase

Functions

Source
convertToCamelCase.tstypescript
convertToCamelCase(str: string): string

convertToKebabCase

Functions

Source
convertToKebabCase.tstypescript
convertToKebabCase(str: string): string

convertToPascalCase

Functions

Source
convertToPascalCase.tstypescript
convertToPascalCase(str: string): string

convertToSnakeCase

Functions

Source
convertToSnakeCase.tstypescript
convertToSnakeCase(str: string): string

createErrorResponse

Functions

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

createInfoMessage

Functions

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

createSuccessResponse

Functions

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

deserializeOtp

Functions

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

getCleanedMessage

Functions

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

getErrorMessageForCode

Functions

Source
getErrorMessageForCode.tstypescript
getErrorMessageForCode(code: StatusCode): string

getNewCorrelationId

Functions

Source
getNewCorrelationId.tstypescript
getNewCorrelationId(): string

getNewEBMessageId

Functions

Source
getNewEBMessageId.tstypescript
getNewEBMessageId(): string

getNewInstanceId

Functions

Source
getNewInstanceId.tstypescript
getNewInstanceId(): string

getNewTraceId

Functions

Source
getNewTraceId.tstypescript
getNewTraceId(): string

getSubscriptionQueueName

Functions

Source
getSubscriptionQueueName.tstypescript
getSubscriptionQueueName(address: EBMessageAddress): string

getUniqueId

Functions

Source
getUniqueId.tstypescript
getUniqueId(): string

gracefulShutdown

Functions

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

isDevelop

Functions

Source
isDevelop.tstypescript
isDevelop(): boolean

serializeOtp

Functions

Source
serializeOtp.tstypescript
serializeOtp(): string

Queue

25 entries

DefinitionQueueBridgeConfig

Types

Source
DefinitionQueueBridgeConfig.tstypescript
type DefinitionQueueBridgeConfig = void

Queue bridge delivery requirements requested by the service definition.

EventToQueueBindingDefinition

Types

Source
EventToQueueBindingDefinition.tstypescript
type EventToQueueBindingDefinition = void

Binds an emitted event to a queue enqueue operation.

EventToQueueIdempotencyMode

Types

Source
EventToQueueIdempotencyMode.tstypescript
type EventToQueueIdempotencyMode = "advisory" | "strict"

Idempotency requirement for event-to-queue bindings.

EventToQueueIdempotencyStrategy

Types

Source
EventToQueueIdempotencyStrategy.tstypescript
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.tstypescript
type QueueDefinition = void

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

QueueEnqueueOptions

Types

Source
QueueEnqueueOptions.tstypescript
type QueueEnqueueOptions = void

Options passed to a queue bridge when enqueueing work.

QueueExecutionProfileName

Types

Source
QueueExecutionProfileName.tstypescript
type QueueExecutionProfileName = "longRunning"

Named execution profile for queue workers.

QueueHandlerResult

Types

Source
QueueHandlerResult.tstypescript
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.tstypescript
type QueueJobContext = ContextBase<Metrics> & PuristaMetricContextProperty<Metrics> & { agent: AgentInvokeMap<AgentInvokes>; emit: EmitCustomMessageFunction<EmitList>; job: QueueJobControls; message: Readonly<QueueMessage<MessagePayloadType, MessageParamsType>>; queue: QueueContext<QueueInvokes>; resources: Resources; ... }

Context object passed to queue worker handlers.

QueueJobControls

Types

Source
QueueJobControls.tstypescript
type QueueJobControls = void

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

QueueLifecycleConfig

Types

Source
QueueLifecycleConfig.tstypescript
type QueueLifecycleConfig = void

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

QueueLongRunningExecutionProfile

Types

Source
QueueLongRunningExecutionProfile.tstypescript
type QueueLongRunningExecutionProfile = void

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

QueueMessage

Types

Source
QueueMessage.tstypescript
type QueueMessage = void

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

QueueMetrics

Types

Source
QueueMetrics.tstypescript
type QueueMetrics = void

Queue operational metrics returned by a bridge.

QueueOrderingGuarantee

Types

Source
QueueOrderingGuarantee.tstypescript
type QueueOrderingGuarantee = "none" | "fifo" | "partition"

Ordering guarantee requested by a queue definition.

QueueResultEventIdStrategy

Types

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

Strategy used to generate result event ids.

QueueResultEventPayload

Types

Source
QueueResultEventPayload.tstypescript
type QueueResultEventPayload = void

Payload emitted for queue result events.

QueueResultPolicy

Types

Source
QueueResultPolicy.tstypescript
type QueueResultPolicy = void

Controls how queue worker outcomes are persisted or emitted.

QueueResultPolicyMode

Types

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

Queue result publication mode.

QueueRetryStrategy

Types

Source
QueueRetryStrategy.tstypescript
type QueueRetryStrategy = void

Exponential backoff settings for queue retries.

QueueTransformContext

Types

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

Context passed to queue transform hooks.

QueueTransformHook

Types

Source
QueueTransformHook.tstypescript
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.tstypescript
type QueueWorkerDefinition = void

Public definition of a worker attached to a queue.

QueueWorkerHandler

Types

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

Function that processes one leased queue message.

QueueWorkerMode

Types

Source
QueueWorkerMode.tstypescript
type QueueWorkerMode = "continuous" | "interval" | "sequential"

Queue worker polling mode.

Queue bridge

10 entries

DefaultQueueBridge

Classes

Source
DefaultQueueBridge.tstypescript
class DefaultQueueBridge

In-memory queue bridge for development and unit tests.

QueueBridge

Interfaces

Source
QueueBridge.tstypescript
interface QueueBridge

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

DefaultQueueBridgeOptions

Types

Source
DefaultQueueBridgeOptions.tstypescript
type DefaultQueueBridgeOptions = void

Configuration for the process-local DefaultQueueBridge.

QueueBridgeCapabilities

Types

Source
QueueBridgeCapabilities.tstypescript
type QueueBridgeCapabilities = void

Capability matrix reported by a QueueBridge.

QueueDeadLetterListOptions

Types

Source
QueueDeadLetterListOptions.tstypescript
type QueueDeadLetterListOptions = void

Pagination options for dead-letter and lease inspection APIs.

QueueDeadLetterRedriveOptions

Types

Source
QueueDeadLetterRedriveOptions.tstypescript
type QueueDeadLetterRedriveOptions = void

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

QueueEnqueueResult

Types

Source
QueueEnqueueResult.tstypescript
type QueueEnqueueResult = void

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

QueueLeaseInspectionRecord

Types

Source
QueueLeaseInspectionRecord.tstypescript
type QueueLeaseInspectionRecord = void

Diagnostic view of an active queue lease.

QueueLeaseOptions

Types

Source
QueueLeaseOptions.tstypescript
type QueueLeaseOptions = void

Options used when leasing work from a queue.

QueueRetryRequest

Types

Source
QueueRetryRequest.tstypescript
type QueueRetryRequest = void

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

Schema

3 entries

OpenApiZodAny

Types

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

Zod schema augmented with PURISTA OpenAPI metadata.

extendApi

Functions

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

validationToSchema

Functions

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

Service

4 entries

Service

Classes

Source
Service.tstypescript
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.tstypescript
class ServiceBuilder<S>

This class is used to build a service.

ServiceClass

Interfaces

Source
ServiceClass.tstypescript
interface ServiceClass<S>

The ServiceClass interface

ServiceConstructorInput

Types

Source
ServiceConstructorInput.tstypescript
type ServiceConstructorInput = void

Store

18 entries

ConfigStoreBaseClass

Classes

Source
ConfigStoreBaseClass.tstypescript
class ConfigStoreBaseClass<ConfigStoreConfigType>

Base class for config store adapters.

DefaultConfigStore

Classes

Source
DefaultConfigStore.tstypescript
class DefaultConfigStore

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

DefaultSecretStore

Classes

Source
DefaultSecretStore.tstypescript
class DefaultSecretStore

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

DefaultStateStore

Classes

Source
DefaultStateStore.tstypescript
class DefaultStateStore

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

SecretStoreBaseClass

Classes

Source
SecretStoreBaseClass.tstypescript
class SecretStoreBaseClass<SecretStoreConfigType>

Base class for secret store adapters.

StateStoreBaseClass

Classes

Source
StateStoreBaseClass.tstypescript
class StateStoreBaseClass<StateStoreConfigType>

Base class for state store implementations.

ConfigStore

Interfaces

Source
ConfigStore.tstypescript
interface ConfigStore

Interface definition for config store adapters

SecretStore

Interfaces

Source
SecretStore.tstypescript
interface SecretStore

Interface definition for a secret store implementation

StateStore

Interfaces

Source
StateStore.tstypescript
interface StateStore

Interface definition for state store implementations

ConfigDeleteFunction

Types

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

delete a config value from the config store

ConfigGetterFunction

Types

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

get a config value from the config store

ConfigSetterFunction

Types

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

set a config value in the config store

SecretDeleteFunction

Types

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

delete a secret from the secret store

SecretGetterFunction

Types

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

get a secret from the secret store

SecretSetterFunction

Types

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

set a secret in the secret store

StateDeleteFunction

Types

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

delete a state value from the state store

StateGetterFunction

Types

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

get a state value from the state store

StateSetterFunction

Types

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

set a state value in the state store

Stream

2 entries

StreamAfterGuardHook

Types

Source
StreamAfterGuardHook.tstypescript
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.tstypescript
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.tstypescript
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.tstypescript
type Subscription = void

A subscription managed by the event bridge

SubscriptionAfterGuardHook

Types

Source
SubscriptionAfterGuardHook.tstypescript
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.tstypescript
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.tstypescript
type SubscriptionDefinition = void

The definition for a subscription provided by some service.

SubscriptionFunction

Types

Source
SubscriptionFunction.tstypescript
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.tstypescript
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.tstypescript
type SubscriptionFunctionContextEnhancements = void

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

SubscriptionTransformFunctionContext

Types

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

SubscriptionTransformInputHook

Types

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

SubscriptionTransformOutputHook

Types

Source
SubscriptionTransformOutputHook.tstypescript
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.tstypescript
type CommandContextMockBuilderTypes = T extends CommandDefinitionBuilder<any, C> ? C : never

Infer the internal builder type configuration from a command builder.

CreateQueueWorkerContextMockInput

Types

Source
CreateQueueWorkerContextMockInput.tstypescript
type CreateQueueWorkerContextMockInput = void

Input for createQueueWorkerContextMock.

InferCommandBuilderConfig

Types

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

Infer the definition config type from a command builder.

InferCommandHarnessServiceBuilderConfig

Types

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

Infer the instance config type from a service builder.

InferQueueWorkerHarnessServiceBuilderConfig

Types

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

Infer the instance config type from a service builder.

InferStreamBuilderConfig

Types

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

Infer the definition config type from a stream builder.

InferStreamHarnessServiceBuilderConfig

Types

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

Infer the instance config type from a service builder.

QueueWorkerContextMockResult

Types

Source
QueueWorkerContextMockResult.tstypescript
type QueueWorkerContextMockResult = void

Result returned by createQueueWorkerContextMock.

StreamContextMockBuilderTypes

Types

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

Infer the internal builder type configuration from a stream builder.

SubscriptionContextMockBuilderTypes

Types

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

Infer the internal builder type configuration from a subscription builder.

createCommandContextMock

Functions

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

createCommandTestHarness

Functions

Source
createCommandTestHarness.tstypescript
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.tstypescript
createQueueWorkerContextMock<Payload, Parameter, Resources, TBuilder>(builder: TBuilder, input: CreateQueueWorkerContextMockInput<Payload, Parameter, Resources>): QueueWorkerContextMockResult<Payload, Parameter, Resources, TBuilder>

createQueueWorkerTestHarness

Functions

Source
createQueueWorkerTestHarness.tstypescript
createQueueWorkerTestHarness<TServiceBuilder>(serviceBuilder: TServiceBuilder, workerBuilder: QueueWorkerBuilder<any>, 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.tstypescript
createStreamContextMock<TBuilder>(builder: TBuilder, input: CreateStreamContextMockInput<TBuilder>): StreamContextMockResult<TBuilder>

createStreamTestHarness

Functions

Source
createStreamTestHarness.tstypescript
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.tstypescript
createSubscriptionContextMock<TBuilder>(builder: TBuilder, input: CreateSubscriptionContextMockInput<TBuilder>): SubscriptionContextMockResult<TBuilder>

getCommandErrorMessageMock

Functions

Source
getCommandErrorMessageMock.tstypescript
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.tstypescript
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.tstypescript
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.tstypescript
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.tstypescript
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.tstypescript
getEventBridgeMock(sandboxOrOptions?: SinonSandbox | { capabilities: EventBridgeCapabilityOverrides; sandbox: SinonSandbox }): { mock: EventBridge; stubs: Record<string, SinonStub> }

getLoggerMock

Functions

Source
getLoggerMock.tstypescript
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.tstypescript
getQueueBridgeMock(sandboxOrOptions?: SinonSandbox | { capabilities: Partial<QueueBridgeCapabilities>; sandbox: SinonSandbox }): { mock: QueueBridge; stubs: Record<string, SinonStub> }

getSubscriptionTransformContextMock

Functions

Source
getSubscriptionTransformContextMock.tstypescript
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>; ... } }