/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { CollectionDefinition } from '../@types/index.js'; /** * Field names that cannot be declared in a collection schema because they * collide with system-managed attributes on `documentVersions`. Exported * so storage-layer reconstruction can skip orphan rows that may exist in * store tables from installations whose schemas declared these names as * user fields before they were promoted to system attributes. */ export declare const RESERVED_FIELD_NAMES: ReadonlySet; /** * Validate every collection in a configuration. * * Enforced rules: * - No field (at any nesting depth) may be named `path`. The `path` * column on `documentVersions` is system-managed; collections opt * into derived paths via `useAsPath`. * - When `useAsPath` is set, the referenced field must exist at the * top level of the collection and be of a type the slugifier can * sensibly consume (text-like, date-like, or a numeric identity * field — `integer` / `counter`). * - No field may be named `availableLocales`; collections opt into the * editorial available-locales control via `advertiseLocales: true`. * - When `advertiseLocales` is `true`, the collection must have at least * one `localized` field — advertising content locales is meaningless * otherwise. * - A collection may not set both `tree: true` and `orderable: true`. A * document-tree owns ordering per-parent on the tree edge, so * `byline_documents.order_key` is inert for it. * - Each `listSearch` entry must name an existing top-level field whose * type is persisted to the text store (the admin list-view search box * is an `ILIKE` over `store_text`), and the field may not be virtual. * - `virtual` fields must satisfy the constraints in * {@link validateVirtualFields} (optional-or-default, no counters, no * upload fields, not referenced by useAsTitle / useAsPath / search). * * Throws a plain `Error` (not a `BylineError`) because configuration * validation runs at startup, before the logger and error registry are * necessarily wired up. */ export declare function validateCollections(collections: readonly CollectionDefinition[]): void;