Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
[Versioned HTTP] Track adoption (elastic#159026)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored and Sloane Perrault committed Jun 6, 2023
1 parent e5e6586 commit 1b094ba
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
10 changes: 10 additions & 0 deletions packages/core/http/core-http-server/src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,34 +43,44 @@ export interface IRouter<Context extends RequestHandlerContextBase = RequestHand
* Register a route handler for `GET` request.
* @param route {@link RouteConfig} - a route configuration.
* @param handler {@link RequestHandler} - a function to call to respond to an incoming request
*
* @track-adoption
*/
get: RouteRegistrar<'get', Context>;

/**
* Register a route handler for `POST` request.
* @param route {@link RouteConfig} - a route configuration.
* @param handler {@link RequestHandler} - a function to call to respond to an incoming request
*
* @track-adoption
*/
post: RouteRegistrar<'post', Context>;

/**
* Register a route handler for `PUT` request.
* @param route {@link RouteConfig} - a route configuration.
* @param handler {@link RequestHandler} - a function to call to respond to an incoming request
*
* @track-adoption
*/
put: RouteRegistrar<'put', Context>;

/**
* Register a route handler for `PATCH` request.
* @param route {@link RouteConfig} - a route configuration.
* @param handler {@link RequestHandler} - a function to call to respond to an incoming request
*
* @track-adoption
*/
patch: RouteRegistrar<'patch', Context>;

/**
* Register a route handler for `DELETE` request.
* @param route {@link RouteConfig} - a route configuration.
* @param handler {@link RequestHandler} - a function to call to respond to an incoming request
*
* @track-adoption
*/
delete: RouteRegistrar<'delete', Context>;

Expand Down
25 changes: 20 additions & 5 deletions packages/core/http/core-http-server/src/versioning/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,30 @@ export type VersionedRouteRegistrar<Method extends RouteMethod, Ctx extends RqCt
* @experimental
*/
export interface VersionedRouter<Ctx extends RqCtx = RqCtx> {
/** @experimental */
/**
* @experimental
* @track-adoption
*/
get: VersionedRouteRegistrar<'get', Ctx>;
/** @experimental */
/**
* @experimental
* @track-adoption
*/
put: VersionedRouteRegistrar<'put', Ctx>;
/** @experimental */
/**
* @experimental
* @track-adoption
*/
post: VersionedRouteRegistrar<'post', Ctx>;
/** @experimental */
/**
* @experimental
* @track-adoption
*/
patch: VersionedRouteRegistrar<'patch', Ctx>;
/** @experimental */
/**
* @experimental
* @track-adoption
*/
delete: VersionedRouteRegistrar<'delete', Ctx>;
}

Expand Down

0 comments on commit 1b094ba

Please sign in to comment.