Packages · @purista/dapr-sdk
@purista/dapr-sdk
SDK and helper to run PURISTA services with Dapr.
Signature
@purista/dapr-sdkExamples
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 DaprPubSubStatusEnumStatus values returned to Dapr Pub/Sub callbacks.
Classes
4 entries
DaprClient
Classes
class DaprClientHTTP client for Dapr sidecar APIs used by the Dapr event bridge.
DaprConfigStore
Classes
class DaprConfigStoreConfig store adapter backed by Dapr configuration components.
DaprSecretStore
Classes
class DaprSecretStoreSecret store adapter backed by a Dapr secret component.
DaprStateStore
Classes
class DaprStateStoreState store adapter backed by a Dapr state component.
Type Aliases
29 entries
BulkSubscribeConfig
Types
type BulkSubscribeConfig = voidBulkSubscribeConfig defines the configuration for a bulk subscription
BulkSubscribeOptions
Types
type BulkSubscribeOptions = voidBulkSubscribeOptions enlists the options for bulk subscribe
BulkSubscribeResponse
Types
type BulkSubscribeResponse = voidBulkSubscribeResponse is the response for a bulk subscribe request
BulkSubscribeResponseEntry
Types
type BulkSubscribeResponseEntry = voidBulkSubscribeResponseEntry is the response entry for a bulk subscribe request
DaprClientConfig
Types
type DaprClientConfig = voidConfiguration for clients that call the local Dapr sidecar.
DaprConfigStoreConfig
Types
type DaprConfigStoreConfig = voidConfiguration for DaprConfigStore.
DaprEventBridgeConfig
Types
type DaprEventBridgeConfig = Prettify<HttpEventBridgeConfig & { clientConfig: DaprClientConfig }>Configuration for DaprEventBridge.
DaprPubSubRouteType
Types
type DaprPubSubRouteType = voidRule-based Dapr Pub/Sub route configuration.
DaprPubSubRuleType
Types
type DaprPubSubRuleType = voidDaprPubSubRuleType defines a rule set
DaprPubSubType
Types
type DaprPubSubType = voidDaprPubSubType is the Type used by the Dapr API to interface with its PubSub component
DaprSecretStoreConfig
Types
type DaprSecretStoreConfig = voidConfiguration for DaprSecretStore.
DaprStateStoreConfig
Types
type DaprStateStoreConfig = voidConfiguration for DaprStateStore.
KeyValueType
Types
type KeyValueType = objectDapr metadata key-value map.
PubSubBulkPublishApiResponse
Types
type PubSubBulkPublishApiResponse = voidResponse from a bulk publish API request.
PubSubBulkPublishApiResponseStatus
Types
type PubSubBulkPublishApiResponseStatus = voidFailed entry reported by Dapr's bulk publish API response.
PubSubBulkPublishEntry
Types
type PubSubBulkPublishEntry = voidPubSubBulkPublishEntry defines an entry in a bulk publish request.
PubSubBulkPublishMessage
Types
type PubSubBulkPublishMessage = PubSubBulkPublishMessageExplicit | object | stringPubSubBulkPublishMessage is a message in a bulk publish request.
PubSubBulkPublishMessageExplicit
Types
type PubSubBulkPublishMessageExplicit = voidExplicit Dapr bulk publish message with per-entry metadata.
PubSubBulkPublishResponse
Types
type PubSubBulkPublishResponse = voidPubSubBulkPublishResponse defines the response from a bulk publish request.
PubSubBulkPublishResponseFailedEntry
Types
type PubSubBulkPublishResponseFailedEntry = voidFailed entry collected while preparing or sending a bulk publish request.
PubSubPublishOptions
Types
type PubSubPublishOptions = voidOptions forwarded to Dapr Pub/Sub publish operations.
PubSubPublishResponseType
Types
type PubSubPublishResponseType = voidPubSubPublishResponseType defines the response from a publish.
PubSubSubscriptionOptionsType
Types
type PubSubSubscriptionOptionsType = voidPubSubSubscriptionOptionsType defines the options we can pass while subscribing
PubSubSubscriptionsType
Types
type PubSubSubscriptionsType = objectThis defines the entire object containing pubsubNames
PubSubSubscriptionTopicRoutesType
Types
type PubSubSubscriptionTopicRoutesType = objectThis defines the routes object
PubSubSubscriptionTopicRouteType
Types
type PubSubSubscriptionTopicRouteType = voidThis defines the routeName object
PubSubSubscriptionTopicType
Types
type PubSubSubscriptionTopicType = voidThis defines the topicName object
PubSubSubscriptionType
Types
type PubSubSubscriptionType = objectThis 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: RouterFunctionDapr 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.2.3"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 DaprEventBridgeEvent bridge that connects PURISTA services to the local Dapr sidecar.