From 768d3d08f7e598fd4d617f01c877d75518a6482e Mon Sep 17 00:00:00 2001 From: Michael Beckemeyer Date: Mon, 18 Dec 2023 17:13:03 +0100 Subject: [PATCH] Mark API as experimental --- .changeset/young-wolves-clap.md | 4 +++- src/packages/http/README.md | 2 ++ src/packages/http/api.ts | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.changeset/young-wolves-clap.md b/.changeset/young-wolves-clap.md index 3216edc2..2cbf211c 100644 --- a/.changeset/young-wolves-clap.md +++ b/.changeset/young-wolves-clap.md @@ -2,8 +2,10 @@ "@open-pioneer/http": minor --- -New feature: request interceptors. +New **experimental** feature: request interceptors. Request interceptors can be registered with the `HttpService` to modify requests before they are sent to a server. Request interceptors are called automatically by the `HttpService` when they are present as part of the normal request processing. Example use case: adding an access token (query parameter or header) to requests for a certain resource. + +Note that the request interceptor API is experimental: it may change with a new minor release as a response to feedback. diff --git a/src/packages/http/README.md b/src/packages/http/README.md index bdb8040e..2e4f83cc 100644 --- a/src/packages/http/README.md +++ b/src/packages/http/README.md @@ -45,6 +45,8 @@ However, the `HttpService`'s method should always be preferred to take advantage ## Request interceptors +> Note that the request interceptor API is experimental: it may change with a new minor release as a response to feedback. + The `HttpService` supports extension via _request interceptors_. Request interceptors can modify requests (query parameters, headers, etc.) before they are sent to the server. diff --git a/src/packages/http/api.ts b/src/packages/http/api.ts index d56a1c7a..93c1d9dc 100644 --- a/src/packages/http/api.ts +++ b/src/packages/http/api.ts @@ -78,6 +78,8 @@ export type ContextData = Record; * or to manipulate a backend response. * * Use the interface name `http.Interceptor` to provide an implementation of this interface. + * + * > Note that the request interceptor API is experimental: it may change with a new minor release as a response to feedback. */ export interface Interceptor extends DeclaredService<"http.Interceptor"> { beforeRequest?(params: BeforeRequestParams): void | Promise;