UNPKG

@code-pushup/models

Version:

Model definitions and validators for the Code PushUp CLI

435 lines (434 loc) 20.9 kB
import { z } from 'zod/v4'; export declare const outputTransformSchema: z.ZodPipe<z.ZodCustom<unknown, unknown>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.core.$ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{ slug: z.ZodString; displayValue: z.ZodOptional<z.ZodString>; value: z.ZodNumber; score: z.ZodNumber; scoreTarget: z.ZodOptional<z.ZodNumber>; details: z.ZodOptional<z.ZodObject<{ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{ message: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warning: "warning"; }>; source: z.ZodOptional<z.ZodObject<{ file: z.ZodString; position: z.ZodOptional<z.ZodObject<{ startLine: z.ZodNumber; startColumn: z.ZodOptional<z.ZodNumber>; endLine: z.ZodOptional<z.ZodNumber>; endColumn: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>>>; table: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>>; rows: z.ZodArray<z.ZodArray<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>, z.ZodArray<z.ZodObject<{ key: z.ZodString; label: z.ZodOptional<z.ZodString>; align: z.ZodOptional<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>; }, z.core.$strip>>]>>; rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>]>>; trees: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodLiteral<"basic">>; root: z.ZodType<import("./tree.js").BasicTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").BasicTreeNode, unknown>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"coverage">; root: z.ZodType<import("./tree.js").CoverageTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").CoverageTreeNode, unknown>>; }, z.core.$strip>]>>>; }, z.core.$strip>>; }, z.core.$strip>>, z.ZodPromise<z.ZodArray<z.ZodObject<{ slug: z.ZodString; displayValue: z.ZodOptional<z.ZodString>; value: z.ZodNumber; score: z.ZodNumber; scoreTarget: z.ZodOptional<z.ZodNumber>; details: z.ZodOptional<z.ZodObject<{ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{ message: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warning: "warning"; }>; source: z.ZodOptional<z.ZodObject<{ file: z.ZodString; position: z.ZodOptional<z.ZodObject<{ startLine: z.ZodNumber; startColumn: z.ZodOptional<z.ZodNumber>; endLine: z.ZodOptional<z.ZodNumber>; endColumn: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>>>; table: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>>; rows: z.ZodArray<z.ZodArray<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>, z.ZodArray<z.ZodObject<{ key: z.ZodString; label: z.ZodOptional<z.ZodString>; align: z.ZodOptional<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>; }, z.core.$strip>>]>>; rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>]>>; trees: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodLiteral<"basic">>; root: z.ZodType<import("./tree.js").BasicTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").BasicTreeNode, unknown>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"coverage">; root: z.ZodType<import("./tree.js").CoverageTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").CoverageTreeNode, unknown>>; }, z.core.$strip>]>>>; }, z.core.$strip>>; }, z.core.$strip>>>]>>, unknown>>; /** * Type Definition: `OutputTransform` * * This type is derived from a Zod schema and represents * the validated structure of `OutputTransform` used within the application. * * @see {@link https://github.com/code-pushup/cli/blob/main/packages/models/docs/models-reference.md#outputtransform} */ export type OutputTransform = z.infer<typeof outputTransformSchema>; export declare const runnerArgsSchema: z.ZodObject<{ persist: z.ZodObject<{ outputDir: z.ZodNonOptional<z.ZodOptional<z.ZodString>>; filename: z.ZodNonOptional<z.ZodOptional<z.ZodString>>; format: z.ZodNonOptional<z.ZodOptional<z.ZodArray<z.ZodEnum<{ json: "json"; md: "md"; }>>>>; skipReports: z.ZodNonOptional<z.ZodOptional<z.ZodBoolean>>; }, z.core.$strip>; }, z.core.$strip>; /** * Type Definition: `RunnerArgs` * * This type is derived from a Zod schema and represents * the validated structure of `RunnerArgs` used within the application. * * @see {@link https://github.com/code-pushup/cli/blob/main/packages/models/docs/models-reference.md#runnerargs} */ export type RunnerArgs = z.infer<typeof runnerArgsSchema>; export declare const runnerConfigSchema: z.ZodObject<{ command: z.ZodString; args: z.ZodOptional<z.ZodArray<z.ZodString>>; outputFile: z.ZodString; outputTransform: z.ZodOptional<z.ZodPipe<z.ZodCustom<unknown, unknown>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.core.$ZodTuple<[z.ZodUnknown], null>, z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{ slug: z.ZodString; displayValue: z.ZodOptional<z.ZodString>; value: z.ZodNumber; score: z.ZodNumber; scoreTarget: z.ZodOptional<z.ZodNumber>; details: z.ZodOptional<z.ZodObject<{ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{ message: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warning: "warning"; }>; source: z.ZodOptional<z.ZodObject<{ file: z.ZodString; position: z.ZodOptional<z.ZodObject<{ startLine: z.ZodNumber; startColumn: z.ZodOptional<z.ZodNumber>; endLine: z.ZodOptional<z.ZodNumber>; endColumn: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>>>; table: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>>; rows: z.ZodArray<z.ZodArray<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>, z.ZodArray<z.ZodObject<{ key: z.ZodString; label: z.ZodOptional<z.ZodString>; align: z.ZodOptional<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>; }, z.core.$strip>>]>>; rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>]>>; trees: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodLiteral<"basic">>; root: z.ZodType<import("./tree.js").BasicTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").BasicTreeNode, unknown>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"coverage">; root: z.ZodType<import("./tree.js").CoverageTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").CoverageTreeNode, unknown>>; }, z.core.$strip>]>>>; }, z.core.$strip>>; }, z.core.$strip>>, z.ZodPromise<z.ZodArray<z.ZodObject<{ slug: z.ZodString; displayValue: z.ZodOptional<z.ZodString>; value: z.ZodNumber; score: z.ZodNumber; scoreTarget: z.ZodOptional<z.ZodNumber>; details: z.ZodOptional<z.ZodObject<{ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{ message: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warning: "warning"; }>; source: z.ZodOptional<z.ZodObject<{ file: z.ZodString; position: z.ZodOptional<z.ZodObject<{ startLine: z.ZodNumber; startColumn: z.ZodOptional<z.ZodNumber>; endLine: z.ZodOptional<z.ZodNumber>; endColumn: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>>>; table: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>>; rows: z.ZodArray<z.ZodArray<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>, z.ZodArray<z.ZodObject<{ key: z.ZodString; label: z.ZodOptional<z.ZodString>; align: z.ZodOptional<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>; }, z.core.$strip>>]>>; rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>]>>; trees: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodLiteral<"basic">>; root: z.ZodType<import("./tree.js").BasicTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").BasicTreeNode, unknown>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"coverage">; root: z.ZodType<import("./tree.js").CoverageTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").CoverageTreeNode, unknown>>; }, z.core.$strip>]>>>; }, z.core.$strip>>; }, z.core.$strip>>>]>>, unknown>>>; configFile: z.ZodOptional<z.ZodString>; }, z.core.$strip>; /** * Type Definition: `RunnerConfig` * * This type is derived from a Zod schema and represents * the validated structure of `RunnerConfig` used within the application. * * @see {@link https://github.com/code-pushup/cli/blob/main/packages/models/docs/models-reference.md#runnerconfig} */ export type RunnerConfig = z.infer<typeof runnerConfigSchema>; export declare const runnerFunctionSchema: z.ZodPipe<z.ZodCustom<unknown, unknown>, z.ZodTransform<z.core.$InferInnerFunctionTypeAsync<z.core.$ZodTuple<[z.ZodObject<{ persist: z.ZodObject<{ outputDir: z.ZodNonOptional<z.ZodOptional<z.ZodString>>; filename: z.ZodNonOptional<z.ZodOptional<z.ZodString>>; format: z.ZodNonOptional<z.ZodOptional<z.ZodArray<z.ZodEnum<{ json: "json"; md: "md"; }>>>>; skipReports: z.ZodNonOptional<z.ZodOptional<z.ZodBoolean>>; }, z.core.$strip>; }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{ slug: z.ZodString; displayValue: z.ZodOptional<z.ZodString>; value: z.ZodNumber; score: z.ZodNumber; scoreTarget: z.ZodOptional<z.ZodNumber>; details: z.ZodOptional<z.ZodObject<{ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{ message: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warning: "warning"; }>; source: z.ZodOptional<z.ZodObject<{ file: z.ZodString; position: z.ZodOptional<z.ZodObject<{ startLine: z.ZodNumber; startColumn: z.ZodOptional<z.ZodNumber>; endLine: z.ZodOptional<z.ZodNumber>; endColumn: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>>>; table: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>>; rows: z.ZodArray<z.ZodArray<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>, z.ZodArray<z.ZodObject<{ key: z.ZodString; label: z.ZodOptional<z.ZodString>; align: z.ZodOptional<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>; }, z.core.$strip>>]>>; rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>]>>; trees: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodLiteral<"basic">>; root: z.ZodType<import("./tree.js").BasicTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").BasicTreeNode, unknown>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"coverage">; root: z.ZodType<import("./tree.js").CoverageTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").CoverageTreeNode, unknown>>; }, z.core.$strip>]>>>; }, z.core.$strip>>; }, z.core.$strip>>, z.ZodPromise<z.ZodArray<z.ZodObject<{ slug: z.ZodString; displayValue: z.ZodOptional<z.ZodString>; value: z.ZodNumber; score: z.ZodNumber; scoreTarget: z.ZodOptional<z.ZodNumber>; details: z.ZodOptional<z.ZodObject<{ issues: z.ZodOptional<z.ZodArray<z.ZodObject<{ message: z.ZodString; severity: z.ZodEnum<{ error: "error"; info: "info"; warning: "warning"; }>; source: z.ZodOptional<z.ZodObject<{ file: z.ZodString; position: z.ZodOptional<z.ZodObject<{ startLine: z.ZodNumber; startColumn: z.ZodOptional<z.ZodNumber>; endLine: z.ZodOptional<z.ZodNumber>; endColumn: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>>; }, z.core.$strip>>; }, z.core.$strip>>>; table: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>>; rows: z.ZodArray<z.ZodArray<z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; columns: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>, z.ZodArray<z.ZodObject<{ key: z.ZodString; label: z.ZodOptional<z.ZodString>; align: z.ZodOptional<z.ZodEnum<{ left: "left"; center: "center"; right: "right"; }>>; }, z.core.$strip>>]>>; rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>>; }, z.core.$strip>]>>; trees: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodOptional<z.ZodLiteral<"basic">>; root: z.ZodType<import("./tree.js").BasicTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").BasicTreeNode, unknown>>; }, z.core.$strip>, z.ZodObject<{ title: z.ZodOptional<z.ZodString>; type: z.ZodLiteral<"coverage">; root: z.ZodType<import("./tree.js").CoverageTreeNode, unknown, z.core.$ZodTypeInternals<import("./tree.js").CoverageTreeNode, unknown>>; }, z.core.$strip>]>>>; }, z.core.$strip>>; }, z.core.$strip>>>]>>, unknown>>; /** * Type Definition: `RunnerFunction` * * This type is derived from a Zod schema and represents * the validated structure of `RunnerFunction` used within the application. * * @see {@link https://github.com/code-pushup/cli/blob/main/packages/models/docs/models-reference.md#runnerfunction} */ export type RunnerFunction = z.infer<typeof runnerFunctionSchema>; export declare const runnerFilesPathsSchema: z.ZodObject<{ runnerConfigPath: z.ZodString; runnerOutputPath: z.ZodString; }, z.core.$strip>; /** * Type Definition: `RunnerFilesPaths` * * This type is derived from a Zod schema and represents * the validated structure of `RunnerFilesPaths` used within the application. * * @see {@link https://github.com/code-pushup/cli/blob/main/packages/models/docs/models-reference.md#runnerfilespaths} */ export type RunnerFilesPaths = z.infer<typeof runnerFilesPathsSchema>;