(workos: EmulatorClient, slug: string)
| 177 | /** Every vault object this connection owns. The object name embeds the logical |
| 178 | * item id, so the connection's own objects are the ones carrying its slug. */ |
| 179 | const vaultObjectsFor = (workos: EmulatorClient, slug: string): Effect.Effect<VaultObject[]> => |
| 180 | Effect.promise(async () => { |
| 181 | const snapshot = await workos.state(); |
| 182 | const items = snapshot.collections["workos.vault_objects"]?.items ?? []; |
| 183 | return items |
| 184 | .map((item) => readVaultObject({ ...item })) |
| 185 | .filter((object): object is VaultObject => object !== null && object.name.includes(slug)); |
| 186 | }); |
| 187 | |
| 188 | /** Arm a fault on the shared emulator and take it back down with the scope, by |
| 189 | * id — a blanket `faults.clear()` would also disarm a neighbouring scenario's. */ |
no test coverage detected