(handler: Handler, token: string)
| 31 | |
| 32 | // A FetchHttpClient backed by the in-process handler, carrying the admin bearer. |
| 33 | const clientLayer = (handler: Handler, token: string) => |
| 34 | FetchHttpClient.layer.pipe( |
| 35 | Layer.provide( |
| 36 | Layer.succeed(FetchHttpClient.Fetch)(((input: RequestInfo | URL, init?: RequestInit) => { |
| 37 | const base = input instanceof Request ? input : new Request(input, init); |
| 38 | const request = new Request(base, { |
| 39 | headers: { ...Object.fromEntries(base.headers), authorization: `Bearer ${token}` }, |
| 40 | }); |
| 41 | return handler(request); |
| 42 | }) as typeof globalThis.fetch), |
| 43 | ), |
| 44 | ); |
| 45 | |
| 46 | /** Sign in once and mint each invitation through the authenticated admin API. */ |
| 47 | export const createInviteMinter = async ( |
no test coverage detected