Skip to content

Latest commit

 

History

History
91 lines (58 loc) · 2.83 KB

File metadata and controls

91 lines (58 loc) · 2.83 KB
title Plugin Validator
description Plugin Validator protocol schemas

{/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs live in the module folders under content/docs/. */}

Plugin Validator Protocol

Zod schemas for plugin validation data structures.

These schemas align with the IPluginValidator contract interface.

Following ObjectStack "Zod First" principle - all data structures

must have Zod schemas for runtime validation and JSON Schema generation.

**Source:** `packages/spec/src/kernel/plugin-validator.zod.ts`

TypeScript Usage

import { PluginMetadata, ValidationError, ValidationResult, ValidationWarning } from '@objectstack/spec/kernel';
import type { PluginMetadata, ValidationError, ValidationResult, ValidationWarning } from '@objectstack/spec/kernel';

// Validate data
const result = PluginMetadata.parse(data);

PluginMetadata

Plugin metadata for validation

Properties

Property Type Required Description
name string Unique plugin identifier
version string optional Semantic version (e.g., 1.0.0)
dependencies string[] optional Array of plugin names this plugin depends on (hard — a missing name fails the boot)
optionalDependencies string[] optional Plugin names hoisted ahead when composed, skipped when absent (order-if-present, ADR-0116)
requiresServices string[] optional Service names the plugin resolves synchronously during init(); validated by the kernel before Phase 1 (ADR-0116)
providesServices string[] optional Service names the plugin's init() unconditionally registers (ADR-0116)
signature string optional Cryptographic signature for plugin verification

ValidationError

Properties

Property Type Required Description
field string Field name that failed validation
message string Human-readable error message
code string optional Machine-readable error code

ValidationResult

Properties

Property Type Required Description
valid boolean Whether the plugin passed validation
errors { field: string; message: string; code?: string }[] optional Validation errors
warnings { field: string; message: string; code?: string }[] optional Validation warnings

ValidationWarning

Properties

Property Type Required Description
field string Field name with warning
message string Human-readable warning message
code string optional Machine-readable warning code