Create a Resource Type
Install from a Preset
The quickest way — presets bundle related types:
# List available presets
weos resource-type preset list
# Install one
weos resource-type preset install website
Available presets: core, ecommerce, tasks, website, events, knowledge, meal-planning. See Preset Catalog.
To update existing types when re-installing:
weos resource-type preset install website --update
Create via CLI
weos resource-type create \
--name "Menu" \
--slug "menu" \
--description "A restaurant menu" \
--context '{"@vocab": "https://schema.org/", "@type": "Menu"}' \
--schema '{
"type": "object",
"properties": {
"name": {"type": "string"},
"description": {"type": "string"}
},
"required": ["name"]
}'
Create via API
curl -X POST http://localhost:8080/api/resource-types \
-H "Content-Type: application/json" \
-d '{
"name": "Menu",
"slug": "menu",
"context": {"@vocab": "https://schema.org/", "@type": "Menu"},
"description": "A restaurant menu"
}'
What Happens
- A
ResourceType.Createdevent is recorded - If a JSON Schema is provided, the ProjectionManager creates a dedicated SQL table:
- Table name: slug with hyphens→underscores, pluralized (
menu→menus) - Typed columns from schema properties (
name TEXT,description TEXT) - Standard columns:
id,type_slug,status,created_by,account_id,sequence_no,created_at,updated_at
- Table name: slug with hyphens→underscores, pluralized (
- The type appears in the admin UI sidebar
Verify
weos resource-type list
Create a Custom Preset
For reusable type bundles, create a preset package. See Creating a Preset.