Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript
553 B
Raw Blame
export type SecretIdentity = {
  uid: string
  resourceVersion: string
}

export function requireSecretIdentity(value: unknown, operation: string): SecretIdentity {
  const record = value as { uid?: unknown; resourceVersion?: unknown }
  if (
    typeof record?.uid !== 'string' ||
    !record.uid.trim() ||
    typeof record.resourceVersion !== 'string' ||
    !record.resourceVersion.trim()
  ) {
    throw new Error(`${operation} did not return a complete object identity`)
  }
  return { uid: record.uid, resourceVersion: record.resourceVersion }
}