Packages · @purista/core
@purista/core
This is the main package of PURISTA.
Signature
@purista/coreEnumerations
5 entries
EBMessageType
Enums
enum EBMessageTypeType of event bridge message
PuristaSpanName
Enums
enum PuristaSpanNameOpentelemetry span names used by PURISTA framework
PuristaSpanTag
Enums
enum PuristaSpanTagOpentelemetry tags set by PURISTA framework
StatusCode
Enums
enum StatusCodeMessage and error status codes. The codes are based on HTTP status codes
StoreType
Enums
enum StoreTypeClasses
15 entries
AgentQueueBuilder
Classes
class AgentQueueBuilder<S>Builds an attached PURISTA agent from normal core queue, worker, command, stream definitions, and a provider-neutral agent manifest.
AgentRunError
Classes
class AgentRunErrorError raised when a harness run terminates with a serialized error.
ClientBuilder
Classes
class ClientBuilderClientBuilder to generate clients, based on service definitions.
DefaultLogger
Classes
class DefaultLoggerGenericEventEmitter
Classes
class GenericEventEmitter<T>HandledError
Classes
class HandledErrorA 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
class HttpClient<CustomConfig>HTTP client with JSON helpers, timeout handling, tracing, metrics, and normalized errors.
Logger
Classes
class LoggerPuristaMetricsRecorder
Classes
class PuristaMetricsRecorderOpenTelemetry API backed PURISTA metrics recorder.
QueueDefinitionBuilder
Classes
class QueueDefinitionBuilderBuilds a durable queue contract for background work.
QueueWorkerBuilder
Classes
class QueueWorkerBuilder<S>Builds a queue worker definition for one queue.
ScheduleDefinitionBuilder
Classes
class ScheduleDefinitionBuilderBuilds a schedule contract for an external scheduler.
StreamDefinitionBuilder
Classes
class StreamDefinitionBuilder<S, C>Builds a stream definition for incremental output or aggregate stream results.
SubscriptionConsumerControlError
Classes
class SubscriptionConsumerControlErrorUnhandledError
Classes
class UnhandledErrorA 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
interface GlobalContextContext passed to all submodules
IEmitter
Interfaces
interface IEmitter<T>ILogger
Interfaces
interface ILoggerMemoryMetricRecord
Interfaces
interface MemoryMetricRecordDeterministic metric record captured by the memory recorder.
PuristaMetricDefinition
Interfaces
interface PuristaMetricDefinition<AttributesSchema>Declares one framework or application metric.
PuristaMetricsRecorderInterface
Interfaces
interface PuristaMetricsRecorderInterfaceA provider-neutral recorder used by framework code and metric contexts.
PuristaMetricsRuntimeOptions
Interfaces
interface PuristaMetricsRuntimeOptionsRuntime metrics options consumed by PURISTA recorders.
RestClient
Interfaces
interface RestClientREST API client abstraction for JSON-oriented HTTP calls.
StreamHandle
Interfaces
interface StreamHandle<Chunk, Final>StreamWriter
Interfaces
interface StreamWriter<Chunk, Final>TransformSchemaObjectOptions
Interfaces
interface TransformSchemaObjectOptionsType Aliases
247 entries
addPrefixToObject
Types
type addPrefixToObject = mappedHelper for better typescript type. All keys of given object must start with the given prefix. Otherwise Typescript will complain.
AgentDefinition
Types
type AgentDefinition = voidAttached agent definition before expansion into service definitions.
AgentDurableWorkspaceStore
Types
type AgentDurableWorkspaceStore = voidStructural durable workspace store accepted until the harness package version is bumped.
AgentDurableWorkspaceStorePolicy
Types
type AgentDurableWorkspaceStorePolicy = voidAdapter-neutral durable workspace policy mirrored from `@purista/harness`.
AgentExecutionDefinition
Types
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
type AgentExecutionKind = "harnessAgent" | "harnessWorkflow" | "runFunction"Execution implementation kind used by an attached agent definition.
AgentExecutionPolicy
Types
type AgentExecutionPolicy = voidQueue execution policy applied to the generated agent worker and queue.
AgentHandler
Types
type AgentHandler = (context: AgentHandlerContext<Payload, Parameter, Resources, Models, CommandTools, AgentTools, Metrics>) => Promise<Output>Run function shape accepted by `AgentQueueBuilder.setRunFunction(...)`.
AgentHandlerContext
Types
type AgentHandlerContext = voidContext passed to an attached agent run function.
AgentHandlerModelBindings
Types
type AgentHandlerModelBindings = mappedTyped model handles exposed to an agent run function.
AgentHarnessWorkflowOptions
Types
type AgentHarnessWorkflowOptions = voidHarness-local agents registered together with a wrapped harness workflow.
AgentHttpExposure
Types
type AgentHttpExposure = voidHTTP projection metadata for the generated agent command or stream.
AgentInvokeMap
Types
type AgentInvokeMap = mappedTyped child-agent invocation map exposed at `context.invoke.agents`.
AgentManifest
Types
type AgentManifest = voidProvider-neutral manifest describing an attached PURISTA agent.
AgentModelBinding
Types
type AgentModelBinding = voidDeclares a model alias required by an attached PURISTA agent.
AgentModelCapability
Types
type AgentModelCapability = ModelCapabilityModel capability names supported by `@purista/harness` model bindings.
AgentQueueBuilderTypes
Types
type AgentQueueBuilderTypes = voidType accumulator used by `AgentQueueBuilder` to preserve typed schemas, tools, models, and metrics.
AgentQueueResultPolicy
Types
type AgentQueueResultPolicy = voidControls how generated queues persist and/or emit agent worker completion metadata.
AgentQueueResultPolicyMode
Types
type AgentQueueResultPolicyMode = "none" | "event" | "state" | "state-and-event"Storage or event side effect used for queued agent run results.
AgentResponseMode
Types
type AgentResponseMode = "accepted" | "status" | "stream" | "event"Public response contract exposed by the generated agent command or stream.
AgentResponseModeOptions
Types
type AgentResponseModeOptions = voidOptions for long-running agent response contracts.
AgentRunEvent
Types
type AgentRunEvent = voidHarness run event decorated with PURISTA agent identity metadata.
AgentRunIdentity
Types
type AgentRunIdentity = voidStable run identity propagated through attached agent execution events and results.
AgentRunResult
Types
type AgentRunResult = voidAggregate result returned by an attached agent runtime.
AgentRuntimeInvocationInput
Types
type AgentRuntimeInvocationInput = voidAggregate invocation input passed from generated PURISTA definitions into the agent runtime.
AgentRuntimeModelBinding
Types
type AgentRuntimeModelBinding = { capabilities: typeOperator; defaults: ModelDefaults; model: string; provider: ModelProvider; providerOptions: Record<string, unknown> } & Partial<Pick<Binding, "model">>AgentRuntimeModelBindings
Types
type AgentRuntimeModelBindings = mappedRuntime model bindings keyed by every model alias declared on an agent builder.
AgentRuntimeOptions
Types
type AgentRuntimeOptions = voidRuntime options required to initialize attached agents for a service instance.
AgentRuntimeRef
Types
type AgentRuntimeRef = voidMutable runtime reference bound when the owning service instance is created.
AgentRuntimeStreamInvocationInput
Types
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
type AgentSandboxPolicy = voidOptional sandbox adapter configuration passed through to the agent runtime.
AgentSessionPolicy
Types
type AgentSessionPolicy = { mode: "ephemeral" } | { mode: "conversation"; payloadPath: typeOperator }Session behavior used by the harness runtime for each agent run.
AgentSkillCatalogEntry
Types
type AgentSkillCatalogEntry = voidMetadata-only skill catalog entry exposed to attached agent handlers.
AgentSkillContext
Types
type AgentSkillContext = voidHandler helper for resolving declared skill metadata without exposing skill bodies.
AgentSkillDiscoveryOptions
Types
type AgentSkillDiscoveryOptions = voidOptional local skill discovery settings for attached agent runtime startup.
AgentSkillResolver
Types
type AgentSkillResolver = (input: { agentName: string; name: string; resourceName: string; serviceName: string; serviceVersion: string }) => Promise<{ directory: unknown } | undefined> | { directory: string } | undefinedResolves a declared agent skill name to a runtime skill directory.
AgentSkillRuntimeBinding
Types
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
type AgentSkillRuntimeOptions = voidRuntime skill bindings supplied through `ServiceBuilder.getInstance(..., { ai: { skills } })`.
AgentWorkspaceCapabilityRequirement
Types
type AgentWorkspaceCapabilityRequirement = stringCapability required by a durable attached-agent workspace policy.
AgentWorkspacePolicy
Types
type AgentWorkspacePolicy = voidDurable workspace behavior declared by an attached agent manifest.
AllowedAgentDefinition
Types
type AllowedAgentDefinition = voidDeclares one attached agent that this attached agent may call.
AllowedCommandToolDefinition
Types
type AllowedCommandToolDefinition = voidDeclares one service command that an attached agent may call as a typed tool.
AnyAgentQueueBuilderTypes
Types
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
type AnyQueueWorkerDefinition = QueueWorkerDefinition<any, any, any, any, any, any, any, any, any>AttachedAgentDefinition
Types
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
type AttachedCoreDefinition = objectCore definition metadata attached to generated queue, worker, command, and stream artifacts.
AuthCredentials
Types
type AuthCredentials = voidHTTP authentication information kept in memory by HttpClient.
BrokerHeaderCommandMsg
Types
type BrokerHeaderCommandMsg = Prettify<BrokerHeaderCustomMsg & { receiverInstanceId: InstanceId; receiverServiceName: string; receiverServiceTarget: string; receiverServiceVersion: string }>BrokerHeaderCommandResponseMsg
Types
type BrokerHeaderCommandResponseMsg = Prettify<BrokerHeaderCommandMsg & { receiverInstanceId: InstanceId }>BrokerHeaderCustomMsg
Types
type BrokerHeaderCustomMsg = voidClientBuilderConfig
Types
type ClientBuilderConfig = z.infer<typeof httpClientConfigSchema>ClientBuilderEvents
Types
type ClientBuilderEvents = voidCloudEvent
Types
type CloudEvent = voidCommand
Types
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
type CommandContextMockResult = voidCommandContextMockServiceClass
Types
type CommandContextMockServiceClass = T extends CommandDefinitionBuilder<S, any> ? S : ServiceClassCommandDefinitionBuilderTypes
Types
type CommandDefinitionBuilderTypes = voidType accumulator used by `CommandDefinitionBuilder` for schemas, hooks, invocations, events, and queues.
CommandDefinitionList
Types
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
type CommandDefinitionListResolved = CommandDefinition<S, any, any, any, any, any, any, any, any, any, any, any, any, any, CommandDefinitionMetadataBase, any>[]CommandDefinitionMetadataBase
Types
type CommandDefinitionMetadataBase = voidCommandToolInvokeMap
Types
type CommandToolInvokeMap = mappedTyped command tool call map exposed at `context.invoke.tools`.
Complete
Types
type Complete = mappedA helper which forces to provide all object keys, even if they are optional.
CompressionMethod
Types
type CompressionMethod = "gzip" | "deflat" | "br" | undefinedConfig
Types
type Config = z.infer<typeof configSchema>ConfigFull
Types
type ConfigFull = z.infer<typeof configFullSchema>ConfigStoreCacheMap
Types
type ConfigStoreCacheMap = Map<string, { createdAt: number; value: string }>Constructor
Types
type Constructor = (...args: A) => TGeneric constructor type that preserves argument tuple inference.
ContentType
Types
type ContentType = "application/json" | "application/javascript" | "text/csv" | "text/css" | "text/html" | "text/javascript" | "text/markdown" | "text/plain" | "text/xml" | stringList 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
type ContextBase = voidThe 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
type CorrelationId = stringthe correlation id links the command invocation message with the command response message
CreateCommandContextMockInput
Types
type CreateCommandContextMockInput = voidCreateCommandTestHarnessOptions
Types
type CreateCommandTestHarnessOptions = InstanceConfigType<InferCommandHarnessServiceBuilderConfig<TServiceBuilder>> & { eventBridge: EventBridge; queueBridge: QueueBridge }CreateStreamContextMockInput
Types
type CreateStreamContextMockInput = voidCreateSubscriptionContextMockInput
Types
type CreateSubscriptionContextMockInput = voidCustomMessage
Types
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
type DefaultConfigStoreConfig = Record<string, unknown>DefaultEventBridgeConfig
Types
type DefaultEventBridgeConfig = voidThe configuration for the DefaultEventBridge.
DefaultSecretStoreConfig
Types
type DefaultSecretStoreConfig = Record<string, unknown>DefaultStateStoreConfig
Types
type DefaultStateStoreConfig = Record<string, unknown>EBMessage
Types
type EBMessage = Command | CommandResponse | InfoMessage | CustomMessage | StreamMessageEBMessage is some message which is handled by the event bridge.
EBMessageAddress
Types
type EBMessageAddress = voidA event bridge message address describes the sender or receiver of a message.
EBMessageBase
Types
type EBMessageBase = voidDefault fields which are part of any purista message
EBMessageId
Types
type EBMessageId = stringUnique id of the event bridge message
EBMessageSenderAddress
Types
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
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
type EmitSchemaList = mappedEmptyObject
Types
type EmptyObject = objectErrorResponsePayload
Types
type ErrorResponsePayload = voidError message payload
EventBridgeCapabilityOverrides
Types
type EventBridgeCapabilityOverrides = Partial<Omit<EventBridgeCapabilities, "consumerFailureHandling">> & { consumerFailureHandling: Partial<EventBridgeCapabilities["consumerFailureHandling"]> }Capability overrides accepted by `getEventBridgeMock` for strict reliability tests.
EventBridgeConfig
Types
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
type EventKey = string & typeOperatorEventMap
Types
type EventMap = Record<string, unknown>Event payload map where key is the event name and value is the payload type.
EventReceiver
Types
type EventReceiver = (parameter: T) => voidExportAsyncApiOptions
Types
type ExportAsyncApiOptions = voidExportKubernetesCronJobsOptions
Types
type ExportKubernetesCronJobsOptions = voidExportRuntimeCapabilitiesOptions
Types
type ExportRuntimeCapabilitiesOptions = voidExportScheduleManifestOptions
Types
type ExportScheduleManifestOptions = voidFromCloudEventOptions
Types
type FromCloudEventOptions = voidFromEmitToOtherType
Types
type FromEmitToOtherType = mappedChanges the canEmit proxy type to given type
FromInvokeToOtherType
Types
type FromInvokeToOtherType = mappedChanges the canInvoke proxy type to given type
FullDefinition
Types
type FullDefinition = voidFullServiceDefinition
Types
type FullServiceDefinition = objectGetMessageParamsType
Types
type GetMessageParamsType = TransformInputParamsSchema extends Schema ? InferIn<TransformInputParamsSchema> : ParamsSchema extends Schema ? InferIn<ParamsSchema> : unknownGetMessagePayloadType
Types
type GetMessagePayloadType = TransformInputPayloadSchema extends Schema ? InferIn<TransformInputPayloadSchema> : PayloadSchema extends Schema ? InferIn<PayloadSchema> : unknownHttpClientConfig
Types
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
type HttpClientRequestOptions = voidOptions for a single HTTP request.
HttpExposedServiceMeta
Types
type HttpExposedServiceMeta = Prettify<CommandDefinitionMetadataBase & { expose: { http: { method: unknown; mode: unknown; openApi: unknown; path: unknown; stream: unknown } } }>HttpExposureOptions
Types
type HttpExposureOptions = voidInfer
Types
type Infer = StandardSchemaV1.InferOutput<TSchema>Infers output type from a schema.
InferIn
Types
type InferIn = StandardSchemaV1.InferInput<TSchema>Infers input type from a schema.
InferMetricAttributes
Types
type InferMetricAttributes = Definition extends PuristaMetricDefinition<AttributesSchema> ? AttributesSchema extends Schema ? InferIn<AttributesSchema> : undefined : neverInfers the attribute input type for a metric definition.
InferOptionalInput
Types
type InferOptionalInput = [NonNullable<T>] extends [never] ? unknown : NonNullable<T> extends Schema ? InferIn<NonNullable<T>> : unknownInfers an agent tool input schema when one is declared, otherwise falls back to `unknown`.
InferOptionalOutput
Types
type InferOptionalOutput = [NonNullable<T>] extends [never] ? unknown : NonNullable<T> extends Schema ? Infer<NonNullable<T>> : unknownInfers an agent tool output schema when one is declared, otherwise falls back to `unknown`.
InferParameter
Types
type InferParameter = S extends Schema ? InferIn<S> : unknownInferPayload
Types
type InferPayload = S extends Schema ? InferIn<S> : unknownInferTypeOrEmptyObject
Types
type InferTypeOrEmptyObject = T extends Schema ? Infer<T> extends EmptyObject ? Infer<T> : EmptyObject : EmptyObjectInFlightDiagnostics
Types
type InFlightDiagnostics = voidInFlightExecutionCounts
Types
type InFlightExecutionCounts = Record<"command" | "subscription" | "stream" | "generic", number>InfoInvokeTimeout
Types
type InfoInvokeTimeout = { messageType: EBMessageType.InfoInvokeTimeout } & InfoServiceBaseInfoInvokeTimeoutPayload
Types
type InfoInvokeTimeoutPayload = voidInfoMessage
Types
type InfoMessage = InfoServiceDrain | InfoServiceFunctionAdded | InfoServiceInit | InfoServiceNotReady | InfoServiceReady | InfoServiceShutdown | InfoInvokeTimeout | InfoSubscriptionErrorInfoMessageType
Types
type InfoMessageType = EBMessageType.InfoServiceDrain | EBMessageType.InfoServiceFunctionAdded | EBMessageType.InfoServiceInit | EBMessageType.InfoServiceNotReady | EBMessageType.InfoServiceReady | EBMessageType.InfoServiceShutdown | EBMessageType.InfoInvokeTimeout | EBMessageType.InfoSubscriptionErrorInfoServiceBase
Types
type InfoServiceBase = Prettify<{ contentEncoding: "utf-8"; contentType: "application/json"; payload: unknown } & EBMessageBase>InfoServiceDrain
Types
type InfoServiceDrain = Prettify<{ messageType: EBMessageType.InfoServiceDrain } & InfoServiceBase>InfoServiceFunctionAdded
Types
type InfoServiceFunctionAdded = Prettify<{ messageType: EBMessageType.InfoServiceFunctionAdded } & InfoServiceBase>InfoServiceInit
Types
type InfoServiceInit = Prettify<{ messageType: EBMessageType.InfoServiceInit } & InfoServiceBase>InfoServiceNotReady
Types
type InfoServiceNotReady = Prettify<{ messageType: EBMessageType.InfoServiceNotReady } & InfoServiceBase>InfoServiceReady
Types
type InfoServiceReady = Prettify<{ messageType: EBMessageType.InfoServiceReady } & InfoServiceBase>InfoServiceShutdown
Types
type InfoServiceShutdown = Prettify<{ messageType: EBMessageType.InfoServiceShutdown } & InfoServiceBase>InfoSubscriptionError
Types
type InfoSubscriptionError = Prettify<{ messageType: EBMessageType.InfoSubscriptionError } & InfoServiceBase>InstanceConfigType
Types
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
type InstanceId = stringthe instance id of the event bridge
InstanceOrType
Types
type InstanceOrType = T extends Constructor ? InstanceType<T> : TInvokeFunction
Types
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
type InvokeList = Record<string, Record<string, Record<string, { outputSchema: Schema; parameterSchema: Schema; payloadSchema: Schema }>>>InvokeValidationMap
Types
type InvokeValidationMap = objectIsConstructor
Types
type IsConstructor = T extends Constructor ? true : falseJsonRecord
Types
type JsonRecord = Record<string, unknown>JSON object shape used by provider export helpers for provider-native manifest fragments.
JsonSchemaOptions
Types
type JsonSchemaOptions = voidKubernetesCronJobManifest
Types
type KubernetesCronJobManifest = voidKubernetesCronJobScheduleInput
Types
type KubernetesCronJobScheduleInput = voidKubernetesCronJobTriggerTemplate
Types
type KubernetesCronJobTriggerTemplate = voidLogFnParamType
Types
type LogFnParamType = [unknown, optional, rest] | [string, rest]LoggerOptions
Types
type LoggerOptions = voidLoggerStubs
Types
type LoggerStubs = voidLogLevelName
Types
type LogLevelName = "info" | "error" | "warn" | "debug" | "trace" | "fatal"MetricAttributeArgs
Types
type MetricAttributeArgs = [Attributes] extends [undefined] ? [] : [attributes]Method argument tuple for metric attributes.
NeverObject
Types
type NeverObject = Record<string, never>Newable
Types
type Newable = (config: ServiceConstructorInput<S>) => TConstructor type accepted by `ServiceBuilder.setCustomClass(...)`.
NonEmptyString
Types
type NonEmptyString = "" extends T ? never : TObjectWithKeysFromStringArray
Types
type ObjectWithKeysFromStringArray = mappedType helper which can create a typed record, based on given string array type.
OpenStreamFunction
Types
type OpenStreamFunction = (address: EBMessageAddress, payload: PayloadType, parameter: ParameterType) => Promise<StreamHandle<Chunk, Final>>PausedQueueWorkerState
Types
type PausedQueueWorkerState = voidPausedSubscriptionConsumerHealthState
Types
type PausedSubscriptionConsumerHealthState = PausedSubscriptionConsumerState & { registrationKey: string }PausedSubscriptionConsumersByRegistrationKey
Types
type PausedSubscriptionConsumersByRegistrationKey = Record<string, PausedSubscriptionConsumerState>PausedSubscriptionConsumerState
Types
type PausedSubscriptionConsumerState = voidPendigInvocation
Types
type PendigInvocation = voidPrettify
Types
type Prettify = mapped & objectPrincipalId
Types
type PrincipalId = stringthe principal id
PuristaMetricAttributes
Types
type PuristaMetricAttributes = Record<string, PuristaMetricAttributeValue>Attribute map accepted by PURISTA metrics after low-cardinality policy checks.
PuristaMetricAttributeValue
Types
type PuristaMetricAttributeValue = string | number | booleanScalar metric attribute value accepted by PURISTA.
PuristaMetricContext
Types
type PuristaMetricContext = mappedTyped metric context exposed to handlers.
PuristaMetricContextProperty
Types
type PuristaMetricContextProperty = voidAdds the typed PURISTA metric context to a handler context type.
PuristaMetricDefinitions
Types
type PuristaMetricDefinitions = Record<string, PuristaMetricDefinition<any>>Named metric definitions keyed by their metric name.
PuristaMetricHandle
Types
type PuristaMetricHandle = Definition extends { kind: "histogram" } ? { record: void } : { add: void }Handler-facing metric handle. Counters use `add`; histograms use `record`.
PuristaMetricKind
Types
type PuristaMetricKind = "counter" | "upDownCounter" | "histogram"Supported PURISTA metric instrument kinds.
PuristaMetricRecord
Types
type PuristaMetricRecord = MemoryMetricRecordQueryParameter
Types
type QueryParameter = voidQueueContext
Types
type QueueContext = voidQueueDefinitionList
Types
type QueueDefinitionList = Promise<QueueDefinition>[]QueueDefinitionListResolved
Types
type QueueDefinitionListResolved = QueueDefinition[]QueueHealthState
Types
type QueueHealthState = voidQueueHealthStatus
Types
type QueueHealthStatus = "ok" | "warn" | "error"QueueInvokeClientMap
Types
type QueueInvokeClientMap = mappedQueueInvokeFunction
Types
type QueueInvokeFunction = (queueName: string, payload: Payload, parameter?: Params, options?: Omit<QueueEnqueueOptions<Payload, Params>, "queueName" | "payload" | "parameter">) => Promise<QueueEnqueueResult>QueueInvokeList
Types
type QueueInvokeList = Record<string, { parameterSchema: Schema; payloadSchema: Schema }>QueueJobStatusRecord
Types
type QueueJobStatusRecord = voidQueueJobStore
Types
type QueueJobStore = voidQueueLease
Types
type QueueLease = voidQueueResultPolicyDelivery
Types
type QueueResultPolicyDelivery = "required" | "best-effort"Delivery requirement for queue result publication.
QueueResultStatus
Types
type QueueResultStatus = "success" | "failed" | "cancelled" | "dead-lettered" | "progress"Canonical queue result status values.
QueueScheduleFunction
Types
type QueueScheduleFunction = (queueName: string, runAt: Date | number, payload: Payload, parameter?: Params, options?: Omit<QueueEnqueueOptions<Payload, Params>, "queueName" | "payload" | "parameter" | "delayMs">) => Promise<QueueEnqueueResult>QueueScheduleProxy
Types
type QueueScheduleProxy = mappedQueueWorkerAfterGuardHook
Types
type QueueWorkerAfterGuardHook = (this: S, context: QueueJobContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes>, result: Readonly<QueueHandlerResult | undefined>, message: Readonly<QueueMessage<MessagePayloadType, MessageParamsType>>) => Promise<void>QueueWorkerBeforeGuardHook
Types
type QueueWorkerBeforeGuardHook = (this: S, context: QueueJobContext<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes>, message: Readonly<QueueMessage<MessagePayloadType, MessageParamsType>>) => Promise<void>QueueWorkerBuilderTypes
Types
type QueueWorkerBuilderTypes = voidType accumulator used by `QueueWorkerBuilder` for handler capabilities.
QueueWorkerContextMockBuilderTypes
Types
type QueueWorkerContextMockBuilderTypes = T extends QueueWorkerBuilder<C> ? C : QueueWorkerBuilderTypesInfer the internal builder type configuration from a queue worker builder.
QueueWorkerDefinitionList
Types
type QueueWorkerDefinitionList = Promise<AnyQueueWorkerDefinition>[]QueueWorkerDefinitionListResolved
Types
type QueueWorkerDefinitionListResolved = AnyQueueWorkerDefinition[]QueueWorkerPauseHealthState
Types
type QueueWorkerPauseHealthState = PausedQueueWorkerState & { queueName: string }QueueWorkerPauseStateByQueue
Types
type QueueWorkerPauseStateByQueue = Record<string, PausedQueueWorkerState>RuntimeBridgeCapabilities
Types
type RuntimeBridgeCapabilities = voidRuntimeCapabilityReportMode
Types
type RuntimeCapabilityReportMode = "definition-only" | "runtime-inspect"ScheduleConcurrencyPolicy
Types
type ScheduleConcurrencyPolicy = "allow" | "forbid" | "replace"ScheduleDefinition
Types
type ScheduleDefinition = voidProvider-neutral schedule metadata exported from PURISTA definitions.
ScheduleExpression
Types
type ScheduleExpression = { kind: "cron"; timezone: string; value: string } | { everyMs: number; kind: "interval" } | { kind: "oneShot"; runAt: string | number | Date }ScheduleManifest
Types
type ScheduleManifest = voidScheduleMissedRunPolicy
Types
type ScheduleMissedRunPolicy = "skip" | "runOnce" | "backfill"ScheduleOptions
Types
type ScheduleOptions = voidScheduleTargetKind
Types
type ScheduleTargetKind = "event" | "queue" | "command"Schema
Types
type Schema = StandardSchemaV1Common Standard Schema abstraction used across PURISTA boundaries.
SecretStoreCacheMap
Types
type SecretStoreCacheMap = Map<string, { createdAt: number; value: string }>ServiceBuilderTypes
Types
type ServiceBuilderTypes = voidServiceClassMetrics
Types
type ServiceClassMetrics = S extends { __serviceClassTypes: Types } ? Types extends ServiceClassTypes<any, any, Metrics> ? Metrics extends PuristaMetricDefinitions ? Metrics : EmptyObject : EmptyObject : EmptyObjectServiceClassTypes
Types
type ServiceClassTypes = voidServiceContractInput
Types
type ServiceContractInput = FullDefinition | FullServiceDefinitionServiceDefinitions
Types
type ServiceDefinitions = voidServiceHealthState
Types
type ServiceHealthState = voidServiceHealthStatus
Types
type ServiceHealthStatus = "ok" | "warn" | "error"ServiceInfoType
Types
type ServiceInfoType = voidGeneral service information
SetNewTypeValue
Types
type SetNewTypeValue = mappedSetNewTypeValues
Types
type SetNewTypeValues = mappedShutdownEntry
Types
type ShutdownEntry = voidEntry of thing you like to shutdown gracefully
StoreBaseConfig
Types
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
type StreamContextMockResult = voidStreamContextMockServiceClass
Types
type StreamContextMockServiceClass = T extends StreamDefinitionBuilder<S, any> ? S : ServiceClassStreamControl
Types
type StreamControl = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.Stream; payload: StreamControlPayload; receiver: EBMessageAddress & Required<unknown> } & EBMessageBase>StreamControlPayload
Types
type StreamControlPayload = voidStreamDefinition
Types
type StreamDefinition = voidStreamDefinitionBuilderTypes
Types
type StreamDefinitionBuilderTypes = voidType accumulator used by `StreamDefinitionBuilder` for schemas, invocations, events, and queue access.
StreamDefinitionList
Types
type StreamDefinitionList = Promise<StreamDefinition<S, any, any, any, any, any, any, any, any, any, any, StreamDefinitionMetadataBase, any>>[]StreamDefinitionListResolved
Types
type StreamDefinitionListResolved = StreamDefinition<S, any, any, any, any, any, any, any, any, any, any, StreamDefinitionMetadataBase, any>[]StreamDefinitionMetadataBase
Types
type StreamDefinitionMetadataBase = voidStreamErrorPayload
Types
type StreamErrorPayload = voidStreamFrame
Types
type StreamFrame = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.Stream; payload: StreamFramePayload<Chunk, Final>; receiver: EBMessageSenderAddress } & EBMessageBase>StreamFramePayload
Types
type StreamFramePayload = voidStreamFrameType
Types
type StreamFrameType = "open" | "start" | "chunk" | "complete" | "error" | "cancel" | "heartbeat"StreamFunction
Types
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
type StreamFunctionContext = Prettify<ContextBase<Metrics> & PuristaMetricContextProperty<Metrics> & StreamFunctionContextEnhancements<MessagePayloadType, MessageParamsType, Resources, Invokes, StreamInvokes, EmitList, QueueInvokes>>StreamFunctionContextEnhancements
Types
type StreamFunctionContextEnhancements = voidStreamInvokeList
Types
type StreamInvokeList = Record<string, Record<string, Record<string, { chunkSchema: Schema; finalSchema: Schema; parameterSchema: Schema; payloadSchema: Schema; validateChunk: boolean; validateFinal: boolean }>>>StreamMessage
Types
type StreamMessage = StreamOpenRequest | StreamControl | StreamFrame<Chunk, Final>StreamOpenRequest
Types
type StreamOpenRequest = Prettify<{ correlationId: CorrelationId; messageType: EBMessageType.Stream; payload: StreamOpenRequestPayload<PayloadType, ParameterType>; receiver: EBMessageAddress } & EBMessageBase>StreamOpenRequestPayload
Types
type StreamOpenRequestPayload = voidSubscriptionContextMockResult
Types
type SubscriptionContextMockResult = voidSubscriptionContextMockServiceClass
Types
type SubscriptionContextMockServiceClass = T extends SubscriptionDefinitionBuilder<S, any> ? S : ServiceClassSubscriptionDefinitionBuilderTypes
Types
type SubscriptionDefinitionBuilderTypes = voidType accumulator used by `SubscriptionDefinitionBuilder` for schemas, hooks, invocations, events, and queues.
SubscriptionDefinitionList
Types
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
type SubscriptionDefinitionListResolved = SubscriptionDefinition<ServiceClassType, any, any, any, any, any, any, any, any, any, any, any, SubscriptionDefinitionMetadataBase, any>[]SubscriptionDefinitionMetadataBase
Types
type SubscriptionDefinitionMetadataBase = voidSubscriptionHandlerControlResult
Types
type SubscriptionHandlerControlResult = Exclude<SubscriptionHandlerResult, { status: "ack" }>SubscriptionHandlerResult
Types
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
type SubscriptionStorageEntry = voidSupportedHttpMethod
Types
type SupportedHttpMethod = "GET" | "POST" | "PATCH" | "PUT" | "DELETE"Supported HTTP-Methods for defining endpoints
TenantId
Types
type TenantId = stringthe tenant id
TraceId
Types
type TraceId = stringThe trace id which will be passed through all commands, invocations and subscriptions
ValidationResult
Types
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
const CONFIG_FILE_NAME: "purista.client.json"configFullSchema
Variables
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
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
const defaultQueueLifecycleConfig: QueueLifecycleConfigOpinionated defaults for queues so builders can omit lifecycle overrides yet still get resilient behaviour.
eventBridgeClientConfigSchema
Variables
const eventBridgeClientConfigSchema: ZodObject<{ clientName: ZodDefault<ZodString> }, $strip>frameworkMetricDefinitions
Variables
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
const httpClientConfigSchema: ZodObject<{ clientName: ZodDefault<ZodString> }, $strip>infoMessageTypes
Variables
const infoMessageTypes: EBMessageType[]MIN_CONTENT_SIZE_FOR_COMPRESSION
Variables
const MIN_CONTENT_SIZE_FOR_COMPRESSION: 1024puristaVersion
Variables
const puristaVersion: "3.2.3"ServiceInfoValidator
Variables
const ServiceInfoValidator: { set: void }Functions
54 entries
assertNonArrowFunction
Functions
assertNonArrowFunction(fn: (...args: never[]) => unknown, label: string): voidconvertEmitValidationsToSchema
Functions
convertEmitValidationsToSchema<T>(emits: T): Promise<FromEmitToOtherType<T, SchemaObject>>convertInvokeValidationsToSchema
Functions
convertInvokeValidationsToSchema<T>(invokes: T): Promise<FromInvokeToOtherType<T, { outputSchema: SchemaObject; parameterSchema: SchemaObject; payloadSchema: SchemaObject }>>createInvokeFunctionProxy
Functions
createInvokeFunctionProxy<TFaux>(invokeOg: InvokeFunction, address?: EBMessageAddress, lvl: number): TFauxcreateMemoryMetricsRecorder
Functions
createMemoryMetricsRecorder(options: PuristaMetricsRuntimeOptions): PuristaMetricsRecorder & { records: MemoryMetricRecord[]; clear: void }createMetricContext
Functions
createMetricContext<Definitions>(definitions: Definitions, recorder: PuristaMetricsRecorder): PuristaMetricContext<Definitions>createNoopMetricsRecorder
Functions
createNoopMetricsRecorder(): PuristaMetricsRecordercreateOpenStreamFunctionProxy
Functions
createOpenStreamFunctionProxy<TFaux>(openStreamOg: OpenStreamFunction, address?: EBMessageAddress, lvl: number): TFauxcreateQueueEnqueueProxy
Functions
createQueueEnqueueProxy<TQueues>(enqueueFn: QueueInvokeFunction, queues?: TQueues): QueueInvokeFunction & QueueInvokeClientMap<TQueues>createQueueScheduleProxy
Functions
createQueueScheduleProxy<TQueues>(scheduleFn: QueueScheduleFunction, queues?: TQueues): QueueScheduleFunction & QueueScheduleProxy<QueueInvokeClientMap<TQueues>>createStateStoreQueueJobStore
Functions
createStateStoreQueueJobStore(stateStore: StateStore, prefix: string): QueueJobStoreexportAsyncApi
Functions
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
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
exportKubernetesCronJobs(options: ExportKubernetesCronJobsOptions): Promise<KubernetesCronJobManifest[]>exportRuntimeCapabilities
Functions
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
exportScheduleManifest(options: ExportScheduleManifestOptions): Promise<ScheduleManifest>exportServiceDefinitions
Functions
exportServiceDefinitions(serviceBuilders: ServiceBuilder<ServiceBuilderTypes>[]): Promise<FullDefinition>fromCloudEvent
Functions
fromCloudEvent<Payload>(cloudEvent: JsonRecord | CloudEvent, options: FromCloudEventOptions): { contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: CustomMessage; ... }getCommandFunctionWithValidation
Functions
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
getDefaultEventBridgeConfig(): Complete<DefaultEventBridgeConfig>getDefaultLogLevel
Functions
getDefaultLogLevel(): LogLevelNamegetFrameworkMetricDefinition
Functions
getFrameworkMetricDefinition(name: string): PuristaMetricDefinition<undefined> | undefinedgetNewSubscriptionStorageEntry
Functions
getNewSubscriptionStorageEntry(subscription: Subscription, cb: (message: EBMessage) => Promise<Omit<{ contentEncoding: unknown; contentType: unknown; correlationId: unknown; eventName: unknown; id: unknown; messageType: unknown; ... }, unknown | unknown> | undefined>): SubscriptionStorageEntrygetSubscriptionFunctionWithValidation
Functions
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
getTimeoutPromise<T>(fn: Promise<T>, ttl: number): Promise<T>initDefaultConfigStore
Functions
initDefaultConfigStore(options: { logger: Logger }): DefaultConfigStoreinitDefaultSecretStore
Functions
initDefaultSecretStore(options: { logger: Logger }): DefaultSecretStoreinitDefaultStateStore
Functions
initDefaultStateStore(options: { logger: Logger }): DefaultStateStoreinitLogger
Functions
initLogger(level: LogLevelName, opt?: LoggerOptions<never, boolean>): LoggerisAllowedMetricAttributeKey
Functions
isAllowedMetricAttributeKey(key: string): booleanisCustomMessage
Functions
isCustomMessage(message: EBMessage): messageisHttpExposedServiceMeta
Functions
isHttpExposedServiceMeta(input?: unknown): inputisInfoMessage
Functions
isInfoMessage(message: EBMessage): messageisInfoServiceFunctionAdded
Functions
isInfoServiceFunctionAdded(message: EBMessage): messageisMessageMatchingSubscription
Functions
isMessageMatchingSubscription(_log: Logger, message: EBMessage, subscription: SubscriptionStorageEntry): booleanisStreamControl
Functions
isStreamControl(message: StreamMessage): messageisStreamFrame
Functions
isStreamFrame<Chunk, Final>(message: StreamMessage<Chunk, Final>): messageisStreamMessage
Functions
isStreamMessage(message: EBMessage): messageisStreamOpenRequest
Functions
isStreamOpenRequest(message: StreamMessage): messageisSubscriptionConsumerControlError
Functions
isSubscriptionConsumerControlError(value: unknown): valueisSubscriptionHandlerControlResult
Functions
isSubscriptionHandlerControlResult(value: unknown): valueisSubscriptionHandlerResult
Functions
isSubscriptionHandlerResult(value: unknown): valuemergeMetricAttributes
Functions
mergeMetricAttributes(defaultAttributes?: PuristaMetricAttributes, attributes?: PuristaMetricAttributes): { attributes: PuristaMetricAttributes; droppedAttributeKeys: string[] }mergeServiceDefinition
Functions
mergeServiceDefinition<T>(existing: FullServiceDefinition, definitionToAdd: ServiceDefinitions): TsafeBind
Functions
safeBind<ThisType, Args, ReturnType>(fn: (this: ThisType, ...args: Args) => ReturnType, thisArg: ThisType): (...args: Args) => ReturnTypeschemaObjectToTsType
Functions
schemaObjectToTsType(schemaObject: SchemaObject | ReferenceObject, options?: Partial<GlobalContext>): stringthrowIfNotValidMessage
Functions
throwIfNotValidMessage(input: unknown): voidtoCloudEvent
Functions
toCloudEvent<Payload>(message: { contentEncoding: string; contentType: string; correlationId: string; eventName: string; id: string; messageType: CustomMessage; ... }): CloudEventtoJSONSchema
Functions
toJSONSchema(schema: Schema, options?: JsonSchemaOptions): Promise<SchemaObject>transformSchemaObject
Functions
transformSchemaObject(schemaObject: SchemaObject | ReferenceObject, ctx: GlobalContext, path: string): stringvalidate
Functions
validate<TSchema>(schema: TSchema, value: unknown): Promise<ValidationResult<Infer<TSchema>>>validateMetricAttributes
Functions
validateMetricAttributes(attributes?: Record<string, unknown>): { attributes: PuristaMetricAttributes; droppedAttributeKeys: string[] }validateMetricDefinition
Functions
validateMetricDefinition(name: string, definition: PuristaMetricDefinition<any>, knownMetricNames: Iterable<string>): Promise<void>validateMetricDefinitions
Functions
validateMetricDefinitions(definitions: Record<string, PuristaMetricDefinition<any>>): Promise<void>Command
17 entries
CommandDefinitionBuilder
Classes
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
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
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
type CommandDefinition = voidThe definition for a command provided by some service.
CommandErrorResponse
Types
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
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
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
type CommandFunctionContextEnhancements = voidIt provides the original command message with types for payload and parameter. Also, the methods:
CommandResponse
Types
type CommandResponse = CommandSuccessResponse<T> | CommandErrorResponseCommandResponse is a response to a specific previously received command which can be either a success or failure
CommandSuccessResponse
Types
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
type CommandTransformFunctionContext = Prettify<ContextBase & { message: Readonly<Command<unknown, unknown>>; resources: Resources }>CommandTransformInputHook
Types
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
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
isCommand(message: EBMessage): messageisCommandErrorResponse
Functions
isCommandErrorResponse(message: unknown): messageisCommandResponse
Functions
isCommandResponse(message: EBMessage): messageisCommandSuccessResponse
Functions
isCommandSuccessResponse(message: EBMessage): messageEvent bridge
23 entries
EventBridgeCommandTransport
Enums
enum EventBridgeCommandTransportCommand request/response transport strategy used by an event bridge.
EventBridgeLateResponseHandling
Enums
enum EventBridgeLateResponseHandlingPolicy for command responses that arrive after invocation timeout.
EventBridgeResponseConfirmationLevel
Enums
enum EventBridgeResponseConfirmationLevelConfirmation level available for command responses.
EventBridgeStreamLateFrameHandling
Enums
enum EventBridgeStreamLateFrameHandlingPolicy for stream frames that arrive after stream timeout.
DefaultEventBridge
Classes
class DefaultEventBridgeProcess-local in-memory event bridge for development and tests.
EventBridgeBaseClass
Classes
class EventBridgeBaseClass<ConfigType>The base class to be extended by event bridge implementations
InFlightExecutionTracker
Classes
class InFlightExecutionTrackerTracks active event bridge handler promises for drain and health reporting.
PendingInvocationRegistry
Classes
class PendingInvocationRegistry<T>Registry for command invocations awaiting correlated responses.
PendingStreamRegistry
Classes
class PendingStreamRegistry<Chunk, Final>Registry for stream invocations awaiting correlated frames.
EventBridge
Interfaces
interface EventBridgeEvent transport adapter contract used by PURISTA services.
DefinitionEventBridgeConfig
Types
type DefinitionEventBridgeConfig = voidEvent bridge delivery requirements requested by command, stream, or subscription definitions.
DefinitionEventBridgeConsumerFailureHandling
Types
type DefinitionEventBridgeConsumerFailureHandling = voidAdvisory failure handling for broker-backed consumers such as subscriptions.
DefinitionEventBridgeConsumerFailureMode
Types
type DefinitionEventBridgeConsumerFailureMode = "strict" | "best-effort"Startup behavior when requested consumer failure semantics are unsupported.
EventBridgeCapabilities
Types
type EventBridgeCapabilities = voidCapability matrix reported by an EventBridge.
EventBridgeCommandCapabilities
Types
type EventBridgeCommandCapabilities = voidCommand reliability capabilities for an event bridge.
EventBridgeConsumerFailureCapabilities
Types
type EventBridgeConsumerFailureCapabilities = voidSubscription consumer failure capabilities for an event bridge.
EventBridgeInFlightExecutionCounts
Types
type EventBridgeInFlightExecutionCounts = Record<InFlightExecutionKind, number>In-flight execution counts grouped by work kind.
EventBridgeStreamCapabilities
Types
type EventBridgeStreamCapabilities = voidStream transport capabilities for an event bridge.
InFlightExecutionKind
Types
type InFlightExecutionKind = "command" | "subscription" | "stream" | "generic"Work kind tracked during event bridge drain and diagnostics.
PendingInvocation
Types
type PendingInvocation = voidInternal pending command invocation callbacks and timeout handle.
PendingStreamSession
Types
type PendingStreamSession = voidMutable stream session stored for one pending stream invocation.
PushResult
Types
type PushResult = "accepted" | "late" | "missing"Result of routing a stream frame or error to a pending stream session.
getCommandQueueName
Functions
getCommandQueueName(address: EBMessageAddress): stringHelper
19 entries
convertToCamelCase
Functions
convertToCamelCase(str: string): stringconvertToKebabCase
Functions
convertToKebabCase(str: string): stringconvertToPascalCase
Functions
convertToPascalCase(str: string): stringconvertToSnakeCase
Functions
convertToSnakeCase(str: string): stringcreateErrorResponse
Functions
createErrorResponse(instanceId: string, originalEBMessage: Readonly<Command>, statusCode: StatusCode, error?: unknown): Readonly<Omit<CommandErrorResponse, "instanceId">>createInfoMessage
Functions
createInfoMessage(messageType: InfoMessageType, sender: { instanceId: string; serviceName: string; serviceTarget: string; serviceVersion: string }, additional?: Partial<InfoMessage>): InfoMessagecreateSuccessResponse
Functions
createSuccessResponse<T>(instanceId: string, originalEBMessage: Readonly<Command>, payload: T, eventName?: string, contentType: string, contentEncoding: string): Readonly<CommandSuccessResponse<T>>deserializeOtp
Functions
deserializeOtp(logger: Logger, otp?: string): Context | undefinedgetCleanedMessage
Functions
getCleanedMessage(message: Readonly<EBMessage>, stripeOutContent: boolean): Record<string, unknown>getErrorMessageForCode
Functions
getErrorMessageForCode(code: StatusCode): stringgetNewCorrelationId
Functions
getNewCorrelationId(): stringgetNewEBMessageId
Functions
getNewEBMessageId(): stringgetNewInstanceId
Functions
getNewInstanceId(): stringgetNewTraceId
Functions
getNewTraceId(): stringgetSubscriptionQueueName
Functions
getSubscriptionQueueName(address: EBMessageAddress): stringgetUniqueId
Functions
getUniqueId(): stringgracefulShutdown
Functions
gracefulShutdown(logger: Logger, list: ShutdownEntry[], timeoutMs: number): voidisDevelop
Functions
isDevelop(): booleanserializeOtp
Functions
serializeOtp(): stringQueue
25 entries
DefinitionQueueBridgeConfig
Types
type DefinitionQueueBridgeConfig = voidQueue bridge delivery requirements requested by the service definition.
EventToQueueBindingDefinition
Types
type EventToQueueBindingDefinition = voidBinds an emitted event to a queue enqueue operation.
EventToQueueIdempotencyMode
Types
type EventToQueueIdempotencyMode = "advisory" | "strict"Idempotency requirement for event-to-queue bindings.
EventToQueueIdempotencyStrategy
Types
type EventToQueueIdempotencyStrategy = "messageId" | "correlationId" | "eventField" | "none" | (event: any) => string | undefinedStrategy used to derive an idempotency key from the source event.
QueueDefinition
Types
type QueueDefinition = voidPublic definition of a queue contract attached to a PURISTA service.
QueueEnqueueOptions
Types
type QueueEnqueueOptions = voidOptions passed to a queue bridge when enqueueing work.
QueueExecutionProfileName
Types
type QueueExecutionProfileName = "longRunning"Named execution profile for queue workers.
QueueHandlerResult
Types
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
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
type QueueJobControls = voidRuntime controls available to a queue worker for the currently leased job.
QueueLifecycleConfig
Types
type QueueLifecycleConfig = voidQueue retry, leasing, heartbeat, and poison-message policy.
QueueLongRunningExecutionProfile
Types
type QueueLongRunningExecutionProfile = voidRuntime policy for work that may exceed a normal lease interval.
QueueMessage
Types
type QueueMessage = voidProvider-neutral queue message shape used by bridges and workers.
QueueMetrics
Types
type QueueMetrics = voidQueue operational metrics returned by a bridge.
QueueOrderingGuarantee
Types
type QueueOrderingGuarantee = "none" | "fifo" | "partition"Ordering guarantee requested by a queue definition.
QueueResultEventIdStrategy
Types
type QueueResultEventIdStrategy = "jobIdAndStatus" | (input: { attempt: number; jobId: string; queueName: string; status: QueueResultStatus }) => stringStrategy used to generate result event ids.
QueueResultEventPayload
Types
type QueueResultEventPayload = voidPayload emitted for queue result events.
QueueResultPolicy
Types
type QueueResultPolicy = voidControls how queue worker outcomes are persisted or emitted.
QueueResultPolicyMode
Types
type QueueResultPolicyMode = "none" | "event" | "state" | "state-and-event"Queue result publication mode.
QueueRetryStrategy
Types
type QueueRetryStrategy = voidExponential backoff settings for queue retries.
QueueTransformContext
Types
type QueueTransformContext = ContextBase & { resources: Resources }Context passed to queue transform hooks.
QueueTransformHook
Types
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
type QueueWorkerDefinition = voidPublic definition of a worker attached to a queue.
QueueWorkerHandler
Types
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
type QueueWorkerMode = "continuous" | "interval" | "sequential"Queue worker polling mode.
Queue bridge
10 entries
DefaultQueueBridge
Classes
class DefaultQueueBridgeIn-memory queue bridge for development and unit tests.
QueueBridge
Interfaces
interface QueueBridgeQueue transport adapter contract used by PURISTA services and queue workers.
DefaultQueueBridgeOptions
Types
type DefaultQueueBridgeOptions = voidConfiguration for the process-local DefaultQueueBridge.
QueueBridgeCapabilities
Types
type QueueBridgeCapabilities = voidCapability matrix reported by a QueueBridge.
QueueDeadLetterListOptions
Types
type QueueDeadLetterListOptions = voidPagination options for dead-letter and lease inspection APIs.
QueueDeadLetterRedriveOptions
Types
type QueueDeadLetterRedriveOptions = voidOptions for moving dead-letter messages back to the live queue.
QueueEnqueueResult
Types
type QueueEnqueueResult = voidMetadata returned after a message has been accepted for queue delivery.
QueueLeaseInspectionRecord
Types
type QueueLeaseInspectionRecord = voidDiagnostic view of an active queue lease.
QueueLeaseOptions
Types
type QueueLeaseOptions = voidOptions used when leasing work from a queue.
QueueRetryRequest
Types
type QueueRetryRequest = voidRetry request returned to a queue bridge when work should run again.
Schema
3 entries
OpenApiZodAny
Types
type OpenApiZodAny = ZodType & { metaOpenApi: SchemaObject | SchemaObject[] }Zod schema augmented with PURISTA OpenAPI metadata.
extendApi
Functions
extendApi<TSchema>(schema: TSchema, meta: SchemaObject | SchemaObject[]): TSchemavalidationToSchema
Functions
validationToSchema<T>(schema?: T): Promise<SchemaObject | undefined>Service
4 entries
Service
Classes
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
class ServiceBuilder<S>This class is used to build a service.
ServiceClass
Interfaces
interface ServiceClass<S>The ServiceClass interface
ServiceConstructorInput
Types
type ServiceConstructorInput = voidStore
18 entries
ConfigStoreBaseClass
Classes
class ConfigStoreBaseClass<ConfigStoreConfigType>Base class for config store adapters.
DefaultConfigStore
Classes
class DefaultConfigStoreProcess-local in-memory config store for development and tests.
DefaultSecretStore
Classes
class DefaultSecretStoreProcess-local in-memory secret store for development and tests.
DefaultStateStore
Classes
class DefaultStateStoreProcess-local in-memory state store for development and tests.
SecretStoreBaseClass
Classes
class SecretStoreBaseClass<SecretStoreConfigType>Base class for secret store adapters.
StateStoreBaseClass
Classes
class StateStoreBaseClass<StateStoreConfigType>Base class for state store implementations.
ConfigStore
Interfaces
interface ConfigStoreInterface definition for config store adapters
SecretStore
Interfaces
interface SecretStoreInterface definition for a secret store implementation
StateStore
Interfaces
interface StateStoreInterface definition for state store implementations
ConfigDeleteFunction
Types
type ConfigDeleteFunction = (configName: string) => Promise<void>delete a config value from the config store
ConfigGetterFunction
Types
type ConfigGetterFunction = (...configNames: ConfigNames) => Promise<ObjectWithKeysFromStringArray<ConfigNames>>get a config value from the config store
ConfigSetterFunction
Types
type ConfigSetterFunction = (configName: string, configValue: unknown) => Promise<void>set a config value in the config store
SecretDeleteFunction
Types
type SecretDeleteFunction = (secretName: string) => Promise<void>delete a secret from the secret store
SecretGetterFunction
Types
type SecretGetterFunction = (...secretNames: SecretNames) => Promise<ObjectWithKeysFromStringArray<SecretNames, string | undefined>>get a secret from the secret store
SecretSetterFunction
Types
type SecretSetterFunction = (secretName: string, secretValue: string) => Promise<void>set a secret in the secret store
StateDeleteFunction
Types
type StateDeleteFunction = (stateName: string) => Promise<void>delete a state value from the state store
StateGetterFunction
Types
type StateGetterFunction = (...stateNames: StateNames) => Promise<ObjectWithKeysFromStringArray<StateNames>>get a state value from the state store
StateSetterFunction
Types
type StateSetterFunction = (stateName: string, stateValue: unknown) => Promise<void>set a state value in the state store
Stream
2 entries
StreamAfterGuardHook
Types
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
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
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
type Subscription = voidA subscription managed by the event bridge
SubscriptionAfterGuardHook
Types
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
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
type SubscriptionDefinition = voidThe definition for a subscription provided by some service.
SubscriptionFunction
Types
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
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
type SubscriptionFunctionContextEnhancements = voidIt provides the original command message. Also, the methods:
SubscriptionTransformFunctionContext
Types
type SubscriptionTransformFunctionContext = Prettify<ContextBase & { message: Readonly<EBMessage>; resources: Resources }>SubscriptionTransformInputHook
Types
type SubscriptionTransformInputHook = (this: S, context: SubscriptionTransformFunctionContext, payload: Readonly<TransformInputPayload>, parameter: Readonly<TransformInputParams>) => Promise<{ parameter: Readonly<FunctionParamsType>; payload: Readonly<FunctionPayloadType> }>SubscriptionTransformOutputHook
Types
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
type CommandContextMockBuilderTypes = T extends CommandDefinitionBuilder<any, C> ? C : neverInfer the internal builder type configuration from a command builder.
CreateQueueWorkerContextMockInput
Types
type CreateQueueWorkerContextMockInput = voidInput for createQueueWorkerContextMock.
InferCommandBuilderConfig
Types
type InferCommandBuilderConfig = T extends CommandDefinitionBuilder<any, C> ? C : neverInfer the definition config type from a command builder.
InferCommandHarnessServiceBuilderConfig
Types
type InferCommandHarnessServiceBuilderConfig = T extends ServiceBuilder<S> ? S : neverInfer the instance config type from a service builder.
InferQueueWorkerHarnessServiceBuilderConfig
Types
type InferQueueWorkerHarnessServiceBuilderConfig = T extends ServiceBuilder<S> ? S : neverInfer the instance config type from a service builder.
InferStreamBuilderConfig
Types
type InferStreamBuilderConfig = T extends StreamDefinitionBuilder<any, C> ? C : neverInfer the definition config type from a stream builder.
InferStreamHarnessServiceBuilderConfig
Types
type InferStreamHarnessServiceBuilderConfig = T extends ServiceBuilder<S> ? S : neverInfer the instance config type from a service builder.
QueueWorkerContextMockResult
Types
type QueueWorkerContextMockResult = voidResult returned by createQueueWorkerContextMock.
StreamContextMockBuilderTypes
Types
type StreamContextMockBuilderTypes = T extends StreamDefinitionBuilder<any, C> ? C : neverInfer the internal builder type configuration from a stream builder.
SubscriptionContextMockBuilderTypes
Types
type SubscriptionContextMockBuilderTypes = T extends SubscriptionDefinitionBuilder<any, C> ? C : neverInfer the internal builder type configuration from a subscription builder.
createCommandContextMock
Functions
createCommandContextMock<TBuilder>(builder: TBuilder, input: CreateCommandContextMockInput<TBuilder>): CommandContextMockResult<TBuilder>createCommandTestHarness
Functions
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
createQueueWorkerContextMock<Payload, Parameter, Resources, TBuilder>(builder: TBuilder, input: CreateQueueWorkerContextMockInput<Payload, Parameter, Resources>): QueueWorkerContextMockResult<Payload, Parameter, Resources, TBuilder>createQueueWorkerTestHarness
Functions
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
createStreamContextMock<TBuilder>(builder: TBuilder, input: CreateStreamContextMockInput<TBuilder>): StreamContextMockResult<TBuilder>createStreamTestHarness
Functions
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
createSubscriptionContextMock<TBuilder>(builder: TBuilder, input: CreateSubscriptionContextMockInput<TBuilder>): SubscriptionContextMockResult<TBuilder>getCommandErrorMessageMock
Functions
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
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
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
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
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
getEventBridgeMock(sandboxOrOptions?: SinonSandbox | { capabilities: EventBridgeCapabilityOverrides; sandbox: SinonSandbox }): { mock: EventBridge; stubs: Record<string, SinonStub> }getLoggerMock
Functions
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
getQueueBridgeMock(sandboxOrOptions?: SinonSandbox | { capabilities: Partial<QueueBridgeCapabilities>; sandbox: SinonSandbox }): { mock: QueueBridge; stubs: Record<string, SinonStub> }getSubscriptionTransformContextMock
Functions
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>; ... } }