mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
- Simplified structure validation by re-exporting functions from structure_config and validate_structure modules for better maintainability. - Consolidated validation logic in validate.lua, delegating to validate_package module for clearer orchestration. - Introduced new quick guide functionalities including step management (add, remove, update, reset ordering) and media handling (thumbnail and video URL validation). - Added utility functions for URL validation and step creation, enhancing the quick guide's usability. - Established type definitions for steps and media states to improve code clarity and type safety. - Enhanced schema editor with new field and relation definitions, providing a more robust structure for database schema management.
31 lines
1.1 KiB
Lua
31 lines
1.1 KiB
Lua
--- Component JSON schema validation facade
|
|
--- Re-exports component validation functions for backward compatibility
|
|
---@module component_schema
|
|
|
|
local validate_component = require("validate_component")
|
|
local validate_layout = require("validate_layout")
|
|
local validate_components = require("validate_components")
|
|
|
|
---@class ComponentSchema
|
|
local M = {}
|
|
|
|
--- Validate a single component structure
|
|
---@param component Component The component to validate
|
|
---@param index? number Optional component index for error messages
|
|
---@return string[] errors List of validation errors
|
|
M.validate_component = validate_component
|
|
|
|
--- Validate layout structure recursively
|
|
---@param layout ComponentLayout The layout to validate
|
|
---@param path string The current path for error messages
|
|
---@return string[] errors List of validation errors
|
|
M.validate_layout = validate_layout
|
|
|
|
--- Validate components.json (array of components)
|
|
---@param components Component[] Array of component definitions
|
|
---@return boolean valid Whether all components are valid
|
|
---@return string[] errors List of validation errors
|
|
M.validate_components = validate_components
|
|
|
|
return M
|