lemon-devkit
Version:
Lemon Serverless Micro-Service Platform for local development
27 lines (26 loc) • 1.08 kB
TypeScript
import type { FieldRegistryValidationResult } from './types';
export type { FieldRegistryMeta, FieldRegistryValidationIssue, FieldRegistryValidationResult, IssueCode, } from './types';
export interface ValidateInput {
fieldKeys: Record<string, (...args: any[]) => any>;
fieldRegistryMeta: unknown;
}
/**
* generated field registry의 artifact 무결성을 검증한다.
*
* 검증 범위:
* - meta shape 존재 여부 / schemaVersion / kind
* - entry count와 meta.entryCount 일치
* - checksum 재계산 일치
* - 각 entry가 callable하고 string[] 반환 여부
* - concrete registry가 0 entry인 비정상 상태
*
* 검증 범위 외:
* - source와 generated registry 간 drift (CI에서 `gen --check`로 보장)
*/
export declare const validateFieldRegistry: (input: ValidateInput) => FieldRegistryValidationResult;
/**
* 검증 실패 시 모든 issue를 합쳐 `Error`를 throw한다.
*
* 앱 bootstrap에서 한 번만 호출한다 — import side effect가 아님.
*/
export declare const assertFieldRegistry: (input: ValidateInput) => void;