(
ids: string[],
opts?: { includeKicked: boolean },
)
| 181 | } |
| 182 | |
| 183 | export async function findManyServersById( |
| 184 | ids: string[], |
| 185 | opts?: { includeKicked: boolean }, |
| 186 | ) { |
| 187 | if (ids.length === 0) return []; |
| 188 | const found = await dbReplica.query.dbServers.findMany({ |
| 189 | where: inArray(dbServers.id, ids), |
| 190 | }); |
| 191 | return found.map(addFlagsToServer).filter((x) => { |
| 192 | if (!opts) return true; |
| 193 | if (x.kickedTime && !opts.includeKicked) return false; |
| 194 | return true; |
| 195 | }); |
| 196 | } |
| 197 | |
| 198 | export function upsertServer(input: z.infer<typeof zServerUpsert>) { |
| 199 | return upsert({ |
no outgoing calls
no test coverage detected