(
api: HttpApi.HttpApi<ApiId, Groups>,
groupIdentifier: GroupIdentifier,
endpointIdentifier: EndpointIdentifier,
handler: NoInfer<
HttpApiEndpoint.HandlerWithIdentifier<
HttpApiGroup.Endpoints<HttpApiGroup.WithIdentifier<Groups, GroupIdentifier>>,
EndpointIdentifier,
never,
R
>
>
)
| 433 | * @since 4.0.0 |
| 434 | */ |
| 435 | export const endpoint = < |
| 436 | ApiId extends string, |
| 437 | Groups extends HttpApiGroup.Constraint, |
| 438 | const GroupIdentifier extends HttpApiGroup.Identifier<Groups>, |
| 439 | const EndpointIdentifier extends HttpApiGroup.Endpoints< |
| 440 | HttpApiGroup.WithIdentifier<Groups, GroupIdentifier> |
| 441 | >["identifier"], |
| 442 | R |
| 443 | >( |
| 444 | api: HttpApi.HttpApi<ApiId, Groups>, |
| 445 | groupIdentifier: GroupIdentifier, |
| 446 | endpointIdentifier: EndpointIdentifier, |
| 447 | handler: NoInfer< |
| 448 | HttpApiEndpoint.HandlerWithIdentifier< |
| 449 | HttpApiGroup.Endpoints<HttpApiGroup.WithIdentifier<Groups, GroupIdentifier>>, |
| 450 | EndpointIdentifier, |
| 451 | never, |
| 452 | R |
| 453 | > |
| 454 | > |
| 455 | ): EndpointReturn<Groups, GroupIdentifier, EndpointIdentifier, R> => |
| 456 | Effect.contextWith((context: Context.Context<any>) => { |
| 457 | const group = api.groups[groupIdentifier] as unknown as HttpApiGroup.Top |
| 458 | const endpoint = group.endpoints[endpointIdentifier] |
| 459 | return Effect.succeed(handlerToHttpEffect( |
| 460 | group, |
| 461 | endpoint, |
| 462 | Context.omit(Scope.Scope)(context), |
| 463 | handler as any, |
| 464 | false |
| 465 | )) |
| 466 | }) |
| 467 | |
| 468 | /** |
| 469 | * Decodes credentials for an HTTP API security scheme from the current request, |
nothing calls this directly
no test coverage detected