export declare namespace DataSources { /** * General data sources {{{ * * These types can be used anywhere in the Blueprint schema where a * file or a directory is expected. */ /** * A reference to a HTTP or HTTPS URL. * * The URLs are parsed using the WHATWG URL standard, which means they can * optionally contain usernames and passwords if needed. * * @see https://url.spec.whatwg.org/ * @asType string * @pattern ^[Hh][Tt][Tt][Pp][Ss]?://[^/?#]+ */ export type URLReference = `http://${string}` | `https://${string}`; /** * A reference to a file in the Blueprint Execution Context – see the * main proposal document for more context. * * The path must start with either ./ or / to distinguish it from a * plugin or theme slug. Regardless of the prefix (./ or /), the path * is relative to the Blueprint Execution Context root: * * * Relative paths (./) are relative to the location of blueprint.json file. * * Absolute paths (/) are chrooted at the Blueprint Execution Context root which is * still the directory where blueprint.json is located. * * It is not possible to escape the Blueprint Execution Context via "../" sequences. * * @asType string * @pattern ^(?!.*(?:^|/)\.\.(?:/|$))(?:\./|/).*$ */ export type ExecutionContextPath = `/${string}` | `./${string}`; /** * A file that is inlined within the Blueprint JSON document. * * Example: * * ```json * { * "filename": "index.php", * "content": "" * } * ``` */ export type InlineFile = { /** @pattern ^(?!(?:\.|\.\.)$)[^/]+$ */ filename: string; content: InlineFileContent; }; type InlineFileContent = string; /** * A directory that is inlined within the Blueprint JSON document. * * Example: * * ```json * { * "directoryName": "my-directory", * "files": { * "index.php": "", * "my-sub-directory": { * "files": { * "index.php": "" * } * } * } * } * ``` */ export type InlineDirectory = { /** @pattern ^(?!(?:\.|\.\.)$)[^/]+$ */ directoryName: string; /** @propertyNames { "pattern": "^(?!(?:\\.|\\.\\.)$)[^/]+$" } */ files: Record; }; /** * A child directory inside an inline directory. * * Its directory name comes from the parent `files` record key. */ export type NestedInlineDirectory = { /** @propertyNames { "pattern": "^(?!(?:\\.|\\.\\.)$)[^/]+$" } */ files: Record; }; /** * A reference to a remote git repository. */ export type GitPath = { /** * A HTTP or HTTPS URL of the remote git repository. */ gitRepository: URLReference; /** * A branch name, commit hash, or tag name. * * Defaults to HEAD. */ ref?: string; /** * A path inside the git repository this data reference points to. * * Defaults to the root of the repository. * * @pattern ^(?!.*(?:^|/)\.\.(?:/|$)).*$ */ pathInRepository?: string; }; /** * A union of all general data reference types. */ export type DataReference = URLReference | ExecutionContextPath | InlineFile | InlineDirectory | GitPath; /** * A data reference that must resolve to a single file. */ export type FileDataReference = URLReference | ExecutionContextPath | TargetSitePath | InlineFile; /** * }}} */ /** * Contextual data sources {{{ * * These types are only meaningful in specific, well-known parts of * the Blueprint schema. */ /** Helper types {{{ */ /** * A WordPress.org directory slug. * * Slugs are intentionally treated as opaque strings. Playground should not * reject future WordPress.org slug formats just because they do not match the * directory conventions common today. */ export type Slug = string; /** * @asType string * @pattern ^(?:latest|\d+\.\d+(?:\.\d+)?)$ */ export type SimpleVersionExpression = 'latest' | `${number}.${number}` | `${number}.${number}.${number}`; export type VersionNumberComponent = `${bigint}`; /** * @asType string * @pattern ^\d+\.\d+(?:\.\d+)?$ */ export type ComparableVersionExpression = `${VersionNumberComponent}.${VersionNumberComponent}` | `${VersionNumberComponent}.${VersionNumberComponent}.${VersionNumberComponent}`; export type WordPressVersionSuffix = `beta${VersionNumberComponent}` | `rc${VersionNumberComponent}`; /** * @asType string * @pattern ^\d+\.\d+(?:\.\d+)?(?:-(?:beta\d+|[Rr][Cc]\d+))?$ */ export type WordPressVersionConstraintVersion = ComparableVersionExpression | `${ComparableVersionExpression}-${WordPressVersionSuffix}`; /** * @asType string * @pattern ^(?:latest|\d+\.\d+(?:\.\d+)?(?:-(?:beta\d+|[Rr][Cc]\d+))?)$ */ export type WordPressVersionPreferredVersion = 'latest' | WordPressVersionConstraintVersion; /** * @asType string * @pattern ^(?:latest|\d+\.\d+(?:\.\d+)?)$ */ export type PHPVersionConstraintVersion = SimpleVersionExpression; /** }}} Helper types */ /** * Plugin directory reference, e.g. "jetpack", "jetpack@6.4", or "akismet@6.4.3". * * These refer to a specific plugin slugs in the WordPress.org plugin repository. * * For example, a reference to "wordpress-seo" means the Yoast SEO plugin as * seen on https://wordpress.org/plugins/wordpress-seo/. * * The Plugin Directory Reference are only meaningful in: * * * The top-level `plugins` array * * The `installPlugin` imperative step */ export type PluginDirectoryReference = Slug | `${Slug}@${SimpleVersionExpression}`; /** * Theme directory reference, e.g. "twentytwentythree", "adventurer@4.6.0", or "twentytwentyfour@latest". * * These refer to specific theme slugs in the WordPress.org theme repository. * * For example, a reference to "adventurer" means the Adventurer theme as * seen on https://wordpress.org/themes/adventurer/. * * These references are only meaningful in: * * * The top-level `themes` array * * The `installTheme` imperative step */ export type ThemeDirectoryReference = Slug | `${Slug}@${SimpleVersionExpression}`; /** * WordPress version, e.g. "latest", "beta", "trunk", "none", "6.4", * "6.4.3", "6.8-RC1", or "6.7-beta2". * * These refer to slugs of specific WordPress releases as listed in * the first table column on https://wordpress.org/download/releases/. * "none" is not a release. It means the Blueprint runs PHP without * installing WordPress. * * The WordPressVersion type is only meaningful in the top-level * `wordpressVersion` property. * * @asType string * @pattern ^(?:latest|beta|trunk|nightly|none|\d+\.\d+(?:\.\d+)?(?:-(?:beta\d+|[Rr][Cc]\d+))?)$ */ export type WordPressVersion = 'none' | 'beta' | 'trunk' | 'nightly' | SimpleVersionExpression | `${SimpleVersionExpression}-${WordPressVersionSuffix}`; /** * PHP version, e.g. "8.1", "8.1.3", or "next". * * These refer to PHP versions as listed in https://www.php.net/releases/. * `next` previews the php-src development branch and is currently * supported by the web runtime only. * * The PHPVersion type is only meaningful in the top-level * `phpVersion` property. * * @asType string * @pattern ^(?:latest|next|\d+\.\d+(?:\.\d+)?)$ */ export type PHPVersion = SimpleVersionExpression | 'next'; /** * A path within the target WordPress site, relative to the WordPress root * directory. For example, site:wp-content/uploads/2024/01/image.jpg. * * Unlike an execution-context path, this path is resolved from the mutable * target filesystem when the consuming step runs. Earlier steps may therefore * create the referenced file. The runner must keep the path inside the target * WordPress root; it never names a file on the host filesystem. * * @asType string * @pattern ^site:(?!\/*$)(?!\.\.(?:/|$))(?!.*\/\.\.(?:/|$)).+$ */ export type TargetSitePath = `site:${string}`; export {}; }