@eac-arch/infrastructure-http
v1.0.6
Published
Angular infrastructure library for HTTP transport contracts and cross-cutting error handling.
Readme
@eac-arch/infrastructure-http
Angular infrastructure library for HTTP transport contracts and cross-cutting error handling.
Purpose
@eac-arch/infrastructure-http provides reusable transport primitives aligned with server contracts and ready-to-wire error handling infrastructure.
Main Capabilities
PagedList<T>: Client mirror of server paged list metadata and navigation flags.- JSON:API error models
: Typed
ErrorResponse/ErrorObjectfor API error payloads. httpErrorInterceptor: Centralized HTTP error normalization and delegation.GlobalErrorHandler+provideErrorHandling(): Captures non-HTTP runtime errors and routes them to a notification service.ErrorNotificationServicecontract : Injection-token based bridge so UI layers decide how to display errors.- JSON Patch helpers
:
JsonPatchOperation,UpdatePartialDelta, and conversion from shared-kernel patch operations.
Public API
export { PagedList };
export * from './errors';
export type { JsonPatchOperation, UpdatePartialDelta, UpdatePartialOperation };
export { toJsonPatchOperations };Usage
Register global error handler:
import { provideErrorHandling } from '@eac-arch/infrastructure-http';
providers: [provideErrorHandling()]Provide notification bridge in UI module:
{ provide: ERROR_NOTIFICATION_SERVICE, useExisting: MyNotificationService }Dependencies
@eac-arch/shared-kernel- Angular core/common
tslib
Development
From eac-arch-infrastructure-http:
npm install
npm run build
npm testCreated By
Erick Arostegui Cunza
Enterprise Solutions Architect
Professional Profile:
- LinkedIn: https://www.linkedin.com/in/erick-arostegui-cunza/
Articles:
- Medium: https://medium.com/@scorpius86
Channels and Media:
- Facebook: https://www.facebook.com/Erick.Arostegui.Cunza
- TikTok: https://www.tiktok.com/@erick_arostegui_cunza
- Instagram: https://www.instagram.com/erickarosteguicunza/
- Spotify: https://open.spotify.com/show/2JQxlxcRg7k7cJ1hB52Ge5
Created by Erick Arostegui Cunza.
