Skip to content

Integration decisions

Use the least elaborate layer that matches the service you actually have. Move up when it removes repeated work you already maintain, and include its configuration and backend contract in the decision.

Direct, declarative, or generated clients

ChoiceUse whenWhat you ownPoor fit
Direct FetcherA few calls or endpoint-specific behaviorPaths, request options, result selection, boundary validationMany repeated endpoint declarations that drift independently
Decorator serviceStable methods benefit from a shared service declarationMetadata/compiler setup, parameter annotations, endpoint accuracyYou do not want decorator configuration or the API is mostly ad hoc
Generated serviceAn actual OpenAPI document is the maintained contractGeneration command/configuration, review and compilation of output, regeneration on spec changesMissing or inaccurate specification; server semantics absent from the document

These share the runtime request boundary: core implements request/extraction (packages/fetcher/src/fetcher.ts:230), decorator has a metadata runtime dependency (packages/decorator/package.json:56), and generator is a CLI (packages/generator/src/cli.ts:8). OpenAPI exports type definitions (packages/openapi/src/index.ts:21). Neither annotations nor generated types validate response data at runtime or invent missing server semantics.

Start with HTTP requests, then use declarative client or the verified workflow in generated client. Configuration details live in decorator reference and generator reference. Check the peer graph separately from the code you expect to execute.

View, Viewer, or FetcherViewer

Maintenance mode (deprecated)

@ahoo-wang/fetcher-viewer is deprecated and in maintenance mode: existing functionality is maintained, with no new features. Further data-view development belongs to @ahoo-wang/fetcher-view-engine; use View Engine for new projects. This page remains a maintenance reference for existing consumers. The packages use different models and APIs, so migration requires adaptation.

ChoiceData and state contractUse whenCost or mismatch
ViewReceives PagedList; emits interaction changes; optional controlled stateOne table/view with application-owned dataApplication must apply filtering, sorting, and pagination
ViewerAdds saved-view collection and selection; load/save callbacks go to applicationUsers switch/save views over your existing data serviceApplication implements persistence, errors, and success-callback timing
FetcherViewerLoads definitions/views and rows; sends Wow view commands through the defined backend protocolYour service implements that protocol and identity modelRequires compatible endpoints and projection behavior; not a generic REST configuration widget

The first two responsibilities follow packages/viewer/src/view/View.tsx:417 and packages/viewer/src/viewer/Viewer.tsx:140; remote row loading follows packages/viewer/src/fetcherviewer/hooks/useFetchData.ts:53. FetcherViewer creation/update confirmation and deletion have different scopes; review state and resources before promising saved results to users.

For a local table, use local data and implement pagination and sorting in the application. Add saved views when users need persistence. Adopt remote data only with the backend contract. Consult View/Viewer reference and FetcherViewer reference for props.

Service-specific integrations

IntegrationRequired contractResponsibility retained by the service/application
WowCommand results/stages and supported query DSLAuthorization, tenant isolation, idempotency, projection freshness
CoSecToken storage, attribution headers, refresh endpoints/session rulesIdentity lifetime, replay safety, server authorization
SSE / OpenAI streamingCompatible event stream and payload formatPartial-result UX, cancellation, reconnect policy if required

Client-side conditions describe the query sent; they are not access control. Command stages describe protocol progress; they are not a universal consistency guarantee. CoSec's guarded refresh implementation is specific to its authentication exchange (packages/cosec/src/authorizationResponseInterceptor.ts:80), while SSE extraction requires a readable body (packages/eventstream/src/eventStreamResultExtractor.ts:38).

Continue with Wow, CoSec, and streaming. Before sharing these integrations across identities, read runtime support; before adding retries, read the failure model.

Released under the Apache License 2.0.