( directory: AdminUserDirectory, email: string, options: AdminUsersListOptions, read: (externalId: string) => Effect.Effect<T | null, AdminUsersError>, )
| 279 | * "absent" the single-user path reports, not a storage fault. |
| 280 | */ |
| 281 | const selectByEmail = <T>( |
| 282 | directory: AdminUserDirectory, |
| 283 | email: string, |
| 284 | options: AdminUsersListOptions, |
| 285 | read: (externalId: string) => Effect.Effect<T | null, AdminUsersError>, |
| 286 | ): Effect.Effect<readonly T[], AdminUsersError> => |
| 287 | Effect.gen(function* () { |
| 288 | // An email no directory can resolve matches nothing, and costs no read. |
| 289 | const wanted = yield* resolveEmailFilter(directory, email); |
| 290 | if (wanted === null) return []; |
| 291 | const row = yield* read(wanted); |
| 292 | return row === null ? [] : pageOf([row], options); |
| 293 | }); |
| 294 | |
| 295 | export const listUsers = ( |
| 296 | admin: ExecutorAdmin, |
no test coverage detected