Packages · @purista/dapr-sdk
@purista/dapr-sdk
SDK and helper to run PURISTA services with Dapr.
Signature
@purista/dapr-sdk Examples
import { DaprConfigStore, DaprEventBridge, DaprSecretStore, DaprStateStore } from '@purista/dapr-sdk'
const eventBridge = new DaprEventBridge({
spanProcessor,
logger,
serve,
})
const secretStore = new DaprSecretStore({ logger, secretStoreName: 'local-secret-store' })
const stateStore = new DaprStateStore({ logger, stateStoreName: 'local-state-store' })
const configStore = new DaprConfigStore({ logger, configStoreName: 'local-config-store' })
// start the services ...
await eventBridge.start() Enumerations
1 entry
DaprPubSubStatusEnum
Enums
enum DaprPubSubStatusEnum Status values returned to Dapr Pub/Sub callbacks.
Classes
4 entries
DaprClient
Classes
class DaprClient HTTP client for Dapr sidecar APIs used by the Dapr event bridge.
DaprConfigStore
Classes
class DaprConfigStore Config store adapter backed by Dapr configuration components.
DaprSecretStore
Classes
class DaprSecretStore Secret store adapter backed by a Dapr secret component.
DaprStateStore
Classes
class DaprStateStore State store adapter backed by a Dapr state component.
Type Aliases
29 entries
BulkSubscribeConfig
Types
type BulkSubscribeConfig = void BulkSubscribeConfig defines the configuration for a bulk subscription
BulkSubscribeOptions
Types
type BulkSubscribeOptions = void BulkSubscribeOptions enlists the options for bulk subscribe
BulkSubscribeResponse
Types
type BulkSubscribeResponse = void BulkSubscribeResponse is the response for a bulk subscribe request
BulkSubscribeResponseEntry
Types
type BulkSubscribeResponseEntry = void BulkSubscribeResponseEntry is the response entry for a bulk subscribe request
DaprClientConfig
Types
type DaprClientConfig = void Configuration for clients that call the local Dapr sidecar.
DaprConfigStoreConfig
Types
type DaprConfigStoreConfig = void Configuration for DaprConfigStore.
DaprEventBridgeConfig
Types
type DaprEventBridgeConfig = Prettify<HttpEventBridgeConfig & { clientConfig: DaprClientConfig }> Configuration for DaprEventBridge.
DaprPubSubRouteType
Types
type DaprPubSubRouteType = void Rule-based Dapr Pub/Sub route configuration.
DaprPubSubRuleType
Types
type DaprPubSubRuleType = void DaprPubSubRuleType defines a rule set
DaprPubSubType
Types
type DaprPubSubType = void DaprPubSubType is the Type used by the Dapr API to interface with its PubSub component
DaprSecretStoreConfig
Types
type DaprSecretStoreConfig = void Configuration for DaprSecretStore.
DaprStateStoreConfig
Types
type DaprStateStoreConfig = void Configuration for DaprStateStore.
KeyValueType
Types
type KeyValueType = object Dapr metadata key-value map.
PubSubBulkPublishApiResponse
Types
type PubSubBulkPublishApiResponse = void Response from a bulk publish API request.
PubSubBulkPublishApiResponseStatus
Types
type PubSubBulkPublishApiResponseStatus = void Failed entry reported by Dapr's bulk publish API response.
PubSubBulkPublishEntry
Types
type PubSubBulkPublishEntry = void PubSubBulkPublishEntry defines an entry in a bulk publish request.
PubSubBulkPublishMessage
Types
type PubSubBulkPublishMessage = PubSubBulkPublishMessageExplicit | object | string PubSubBulkPublishMessage is a message in a bulk publish request.
PubSubBulkPublishMessageExplicit
Types
type PubSubBulkPublishMessageExplicit = void Explicit Dapr bulk publish message with per-entry metadata.
PubSubBulkPublishResponse
Types
type PubSubBulkPublishResponse = void PubSubBulkPublishResponse defines the response from a bulk publish request.
PubSubBulkPublishResponseFailedEntry
Types
type PubSubBulkPublishResponseFailedEntry = void Failed entry collected while preparing or sending a bulk publish request.
PubSubPublishOptions
Types
type PubSubPublishOptions = void Options forwarded to Dapr Pub/Sub publish operations.
PubSubPublishResponseType
Types
type PubSubPublishResponseType = void PubSubPublishResponseType defines the response from a publish.
PubSubSubscriptionOptionsType
Types
type PubSubSubscriptionOptionsType = void PubSubSubscriptionOptionsType defines the options we can pass while subscribing
PubSubSubscriptionsType
Types
type PubSubSubscriptionsType = object This defines the entire object containing pubsubNames
PubSubSubscriptionTopicRoutesType
Types
type PubSubSubscriptionTopicRoutesType = object This defines the routes object
PubSubSubscriptionTopicRouteType
Types
type PubSubSubscriptionTopicRouteType = void This defines the routeName object
PubSubSubscriptionTopicType
Types
type PubSubSubscriptionTopicType = void This defines the topicName object
PubSubSubscriptionType
Types
type PubSubSubscriptionType = object This defines the pubsubName object
TypeDaprPubSubCallback
Types
type TypeDaprPubSubCallback = (data: unknown, headers: Record<string, string>) => Promise<unknown | undefined> Callback invoked for Dapr Pub/Sub message delivery.
Variables
5 entries
configRoute
Variables
const configRoute: RouterFunction Dapr actor configuration endpoint.
DAPR_API_VERSION
Variables
const DAPR_API_VERSION: "v1.0" Default Dapr HTTP API version used by sidecar requests.
DEFAULT_DAPR_HOST
Variables
const DEFAULT_DAPR_HOST: "http://127.0.0.1" Default HTTP host of a local Dapr sidecar.
DEFAULT_DAPR_PORT
Variables
const DEFAULT_DAPR_PORT: "3500" Default HTTP port of a local Dapr sidecar.
puristaVersion
Variables
const puristaVersion: "3.0.1" The PURISTA package version embedded in the published runtime build.
Functions
2 entries
getDefaultClientConfig
Functions
getDefaultClientConfig(): { appPrefix: string; daprApiToken: undefined; daprApiVersion: string; daprHost: string; daprPort: string; isKeepAlive: boolean; ... } getDefaultConfig
Functions
getDefaultConfig(): { apiPrefix: string; clientConfig: { appPrefix: string; daprApiToken: undefined; daprApiVersion: string; daprHost: string; daprPort: string; isKeepAlive: boolean; ... }; commandPayloadAsCloudEvent: boolean; enableRestApiExpose: boolean; name: string; pathPrefix: string; ... } Event bridge
1 entry
DaprEventBridge
Classes
class DaprEventBridge Event bridge that connects PURISTA services to the local Dapr sidecar.