Skip to main content

Crate qefro_backend_sdk

Crate qefro_backend_sdk 

Source
Expand description

Qefro backend SDK — mirrors @qefro-ai/backend (TypeScript).

Organizations expose one signed webhook (typically POST /qefro). Qefro Runtime calls ping, tools.list, tool.invoke, and tool.resume.

Structs§

AuthBuilder
Helpers matching JS AuthBuilder.
AuthenticationContextPayload
BusinessEventDefinition
BusinessEventField
BusinessFlow
A Business Flow as advertised through capabilities.list. Never executed by the SDK.
BusinessFlowMetadata
Immutable identity + descriptive metadata for a Business Flow.
ChallengePayload
ChallengeSignal
Signal an auth challenge from a tool handler (caught like JS ChallengeSignal).
ConsentContext
ctx.consent — grant/revoke consent purposes.
Conversation
CustomerApi
In-handler customer API (mirrors JS ctx.customer).
CustomerAuthorizeContext
CustomerLookupContext
CustomerState
EmittedBusinessEvent
EventHandlerDefinition
Standalone event / webhook / schedule handler advertised via capabilities.list.
EventOutbox
FlowBuilder
Fluent builder returned by Qefro::flow. Step methods append into the SDK’s flow registry as they are declared and never panic; the first step-id violation is recorded and surfaced by FlowBuilder::complete.
FlowStep
Wire shape of a flow step: { id, type, config }.
ListenHandle
ListenOptions
MarketingAction
MarketingAudience
MarketingAudienceAppQuery
MarketingAudienceCustomerHub
MarketingCapability
Wire shape for capabilities.list.marketing.
MarketingChannel
Channel support. provider is reserved for multi-provider routing later.
MarketingContext
Thin get-own-registration client via platform.marketing. Registry read only.
MarketingDefinition
Input to app.marketing(...).
MarketingLandingPage
MarketingMetadata
MarketingRegistration
Normalized registration nested under capabilities.list.marketing.metadata.
MarketingVariable
MembershipContext
ctx.membership — attach/detach solution membership.
OrganizationAction
OrganizationCapabilities
OrganizationCapability
OrganizationContext
Thin get-own-capabilities client via platform.organization. Registry read only.
OrganizationDefinition
OrganizationEvent
OrganizationMetadata
OrganizationTaskType
PersonContext
PlatformCapabilities
Platform capabilities injected on tool.invoke.
PlatformCustomerBinding
PlatformCustomerContext
Customer Hub gateway context injected on tool.invoke (platform.customer).
PlatformStorageBinding
PlatformStorageContext
Managed storage context (ADR-002) — kept for platform parity; Hub is independent.
Qefro
QefroConfig
QefroRequest
RegisteredTool
StorageContext
TimelineContext
ctx.timeline — append Customer Hub timeline activities.
ToolContext
ToolLookup
Identity attributes the Qefro runtime must resolve before tool.invoke.
ToolMetadata

Enums§

AuthOutcome
BusinessEventError
FlowError
Developer mistakes surfaced as explicit errors — the SDK never panics on a malformed flow declaration.
FlowStepKind
Type-specific settings for a flow step. Serialized as { "type": ..., "config": {...} } so new settings (retry, timeout, permissions, parallel) extend config without changing the wire schema.
FlowTrigger
How a Business Flow is entered (Phase 3). Events are triggers into the Qefro runtime — not a second execution engine.
MarketingError
Error from validate_marketing_definition / Qefro::marketing.
OrganizationError
Error from validate_organization_definition / Qefro::organization.
PersonMutation
QefroResponse
ToolAuthMode

Constants§

PERSON_ACTIVITY_CREATED
PERSON_ASSIGNED
PERSON_CREATED
PERSON_MERGED
PERSON_STATUS_CHANGED
PERSON_TAG_CREATED
PERSON_UPDATED
SDK_NAME
Package name reported to Qefro Runtime (X-Qefro-SDK / protocol payloads).
SDK_VERSION
Package version reported to Qefro Runtime (sdk_version / X-Qefro-Version).

Traits§

CustomerProvider

Functions§

build_marketing_context
build_organization_context
build_storage_context
default_outbox_dir
env_flag_true
hub_call
POST /v1/internal/customer-hub/{op}. Soft-skip or hard-fail per flags.
hub_customer_from_person
Map a Person / Hub JSON object to the canonical HubCustomer projection.
is_business_event_type
is_customer_hub_enabled
Master switch — when false, hub methods soft-skip (never call Hub).
is_customer_hub_optional
When true (default), missing hub config returns None / no-ops.
is_marketing_enabled
is_organization_enabled
normalize_business_event
normalize_emitted_event
normalize_lookup
Normalize lookup.by / lookup.required into a deduped lowercase attribute list.
on_person_created
on_person_merged
on_person_status_changed
on_person_updated
person_event_trigger
pick_identity
read_identity_phone
seed_from_person
Seed hub customer projection from a Person snapshot on tool.invoke.
stable_event_id
Stable id within a source: {event_type}:{entity_id}.
to_marketing_capability
to_organization_capability
Build the capabilities.list.organization wire object.
validate_marketing_definition
Validate and normalize a marketing definition.
validate_organization_definition
Validate and normalize an organization definition.