{
    "sources": {
        "herbs": {
            "pattern": "content/herbs/*.md",
            "type": "markdown",
            "schema": {
                "type": "object",
                "required": ["name", "tagSlugs", "overview"],
                "properties": {
                    "name": { "type": "string" },
                    "compoundSlugs": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "tagSlugs": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "overview": { "type": "string" },
                    "efficacy": { "type": "string" }
                }
            },
            "relations": {
                "compounds": {
                    "to": "compounds",
                    "localKey": "compoundSlugs",
                    "foreignKey": "slug",
                    "type": "hasMany"
                },
                "tags": {
                    "to": "tags",
                    "localKey": "tagSlugs",
                    "foreignKey": "slug",
                    "type": "hasMany"
                },
                "recipes": {
                    "to": "recipes",
                    "through": "recipeGroups",
                    "sourceLocalKey": "slug",
                    "throughForeignKey": "combinedHerbs.slug",
                    "throughLocalKey": "slug",
                    "targetForeignKey": "recipeGroupSlug",
                    "type": "hasManyThrough"
                }
            },
            "index": {
                "name": {},
                "compoundSlugs": {},
                "tagSlugs": {},
                "recipes.recipeGroupSlug": {}
            }
        },
        "tags": {
            "type": "yaml",
            "pattern": "content/tags.yaml",
            "schema": {
                "type": "object",
                "required": ["slug", "name"],
                "properties": {
                    "slug": { "type": "string" },
                    "name": { "type": "string" }
                }
            }
        },
        "compounds": {
            "type": "yaml",
            "pattern": "content/compounds.yaml",
            "schema": {
                "type": "object",
                "required": ["slug", "name"],
                "properties": {
                    "slug": { "type": "string" },
                    "name": { "type": "string" }
                }
            }
        },
        "recipes": {
            "pattern": "content/recipes/**/*.md",
            "type": "markdown",
            "schema": {
                "type": "object",
                "required": ["recipeGroupSlug", "recipe"],
                "properties": {
                    "recipeGroupSlug": { "type": "string" },
                    "summary": { "type": "string" },
                    "processSlug": { "type": "string" },
                    "recipe": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "relations": {
                "herbs": {
                    "to": "herbs",
                    "through": "recipeGroups",
                    "sourceLocalKey": "recipeGroupSlug",
                    "throughForeignKey": "slug",
                    "throughLocalKey": "combinedHerbs.slug",
                    "targetForeignKey": "slug",
                    "type": "hasManyThrough"
                },
                "process": {
                    "to": "processes",
                    "through": "recipeGroups",
                    "sourceLocalKey": "recipeGroupSlug",
                    "throughForeignKey": "slug",
                    "throughLocalKey": "processSlug",
                    "targetForeignKey": "slug",
                    "type": "hasOneThrough"
                }
            },
            "index": { "herbs.slug": {} }
        },
        "recipeGroups": {
            "type": "yaml",
            "pattern": "content/recipeGroups.yaml",
            "schema": {
                "type": "object",
                "required": ["slug", "processSlug", "combinedHerbs"],
                "properties": {
                    "slug": { "type": "string" },
                    "processSlug": { "type": "string" },
                    "combinedHerbs": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": ["slug", "herbStateSlug", "herbPartSlug"],
                            "properties": {
                                "slug": { "type": "string" },
                                "herbStateSlug": { "type": "string" },
                                "herbPartSlug": { "type": "string" }
                            }
                        }
                    }
                }
            }
        },
        "herbParts": {
            "type": "yaml",
            "pattern": "content/processes.yaml",
            "schema": {
                "type": "object",
                "required": ["slug", "name"],
                "properties": {
                    "slug": { "type": "string" },
                    "name": { "type": "string" }
                }
            }
        },
        "herbStates": {
            "type": "yaml",
            "pattern": "content/herbStates.yaml",
            "schema": {
                "type": "object",
                "required": ["slug", "name"],
                "properties": {
                    "slug": { "type": "string" },
                    "name": { "type": "string" }
                }
            }
        },
        "processes": {
            "type": "yaml",
            "pattern": "content/processes.yaml",
            "schema": {
                "type": "object",
                "required": ["slug", "name"],
                "properties": {
                    "slug": { "type": "string" },
                    "name": { "type": "string" }
                }
            }
        }
    }
}
