Portal Adapter
Component Detail
Infrastructure
high complexity
backend
0
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
Infrastructure adapter implementing the abstract portal interface for the HLF Dynamics platform. Handles HTTP protocol translation, authentication token management with the external API, error normalization into standard Meander error types, and webhook listener registration for event-driven sync. Falls back to scheduled polling when webhooks are unavailable. Designed with the adapter pattern so future external portals can be added without modifying core sync logic.
portal-adapter
Responsibilities
- Translate between Meander internal API calls and Dynamics REST API protocol
- Manage external API authentication tokens with automatic refresh
- Normalize external API errors into standard Meander error types for consistent handling
- Register and process webhook events for real-time sync, with polling fallback
- Implement rate limiting and request throttling to respect external API constraints
Interfaces
connect(credentials)
disconnect()
fetchEntities(entityType, filters)
pushEntities(entityType, data)
registerWebhook(eventType, callbackUrl)
unregisterWebhook(webhookId)
processWebhookEvent(event)
pollForChanges(entityType, since)
refreshAuthToken()
getApiHealthStatus()
normalizeError(externalError)
getRateLimitStatus()