V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { kbxTestScenarioCatalog } from '@kbx/contracts'
|
||||
|
||||
export function requireKbxScenario(id: keyof typeof kbxTestScenarioCatalog) {
|
||||
const scenario = kbxTestScenarioCatalog[id]
|
||||
if (!scenario) throw new Error(`Unknown KBX scenario: ${String(id)}`)
|
||||
return scenario
|
||||
}
|
||||
|
||||
export function scenarioTitle(id: keyof typeof kbxTestScenarioCatalog) {
|
||||
const s = requireKbxScenario(id)
|
||||
return `[${s.id}] ${s.title}`
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { createHash, randomUUID } from 'node:crypto'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
|
||||
export type KbxScenarioEvidenceArtifact = {
|
||||
type: string
|
||||
path: string
|
||||
sha256?: string
|
||||
}
|
||||
|
||||
export async function sha256File(path: string) {
|
||||
const bytes = await readFile(path)
|
||||
return createHash('sha256').update(bytes).digest('hex')
|
||||
}
|
||||
|
||||
export function createScenarioRunId() {
|
||||
return `kbx-scenario-${randomUUID()}`
|
||||
}
|
||||
Reference in New Issue
Block a user