(
api: HttpApi.HttpApi<ApiId, Groups>,
options: {
readonly group: GroupIdentifier
readonly httpClient: HttpClient.HttpClient.With<E, R>
readonly transformResponse?:
| ((effect: Effect.Effect<unknown, unknown, unknown>) => Effect.Effect<unknown, unknown, unknown>)
| undefined
readonly baseUrl?: URL | string | undefined
}
)
| 544 | * @since 4.0.0 |
| 545 | */ |
| 546 | export const group = < |
| 547 | ApiId extends string, |
| 548 | Groups extends HttpApiGroup.Constraint, |
| 549 | const GroupIdentifier extends HttpApiGroup.Identifier<Groups>, |
| 550 | E, |
| 551 | R |
| 552 | >( |
| 553 | api: HttpApi.HttpApi<ApiId, Groups>, |
| 554 | options: { |
| 555 | readonly group: GroupIdentifier |
| 556 | readonly httpClient: HttpClient.HttpClient.With<E, R> |
| 557 | readonly transformResponse?: |
| 558 | | ((effect: Effect.Effect<unknown, unknown, unknown>) => Effect.Effect<unknown, unknown, unknown>) |
| 559 | | undefined |
| 560 | readonly baseUrl?: URL | string | undefined |
| 561 | } |
| 562 | ): Effect.Effect< |
| 563 | Client.Group<HttpApiGroup.WithIdentifier<Groups, GroupIdentifier>, E, R>, |
| 564 | never, |
| 565 | HttpApiGroup.MiddlewareClient<HttpApiGroup.WithIdentifier<Groups, GroupIdentifier>> |
| 566 | > => { |
| 567 | const client: Record<string, any> = {} |
| 568 | return makeClient(api, { |
| 569 | ...options, |
| 570 | predicate: ({ group }) => group.identifier === options.group, |
| 571 | onEndpoint({ endpoint, endpointFn }) { |
| 572 | InternalRecord.assignProperty(client, endpoint.identifier, endpointFn) |
| 573 | } |
| 574 | }).pipe(Effect.map(() => client)) as any |
| 575 | } |
| 576 | |
| 577 | type EndpointReturn< |
| 578 | Groups extends HttpApiGroup.Constraint, |
nothing calls this directly
no test coverage detected