import { CheckConfigDefaults } from '../services/checkly-config-loader.js'; import { type EngineDetectionResult } from '../services/engine-detector.js'; import { Parser } from '../services/check-parser/parser.js'; import { Construct } from './construct.js'; import { PrivateLocationApi } from '../rest/private-locations.js'; import type { Account } from '../rest/accounts.js'; import { FileLoader } from '../loader/index.js'; import { Workspace } from '../services/check-parser/package-files/workspace.js'; import { PackageManager } from '../services/check-parser/package-files/package-manager.js'; import { Result } from '../services/check-parser/package-files/result.js'; import { Runtime } from '../runtimes/index.js'; import { EmbeddedPackagesMaterializer } from '../services/embedded-packages/materializer.js'; import { PlaywrightProjectBundler } from '../services/playwright-project-bundler.js'; import type { Project } from './project.js'; import type { Check } from './check.js'; import type { ProjectDefaults } from './internal/codegen/context.js'; /** * A construct created outside a project, thrown by this copy of checkly. * Another copy's (or an older version's) error is not an instance, which is * how loadFile tells that a project's files use a different install. */ export declare class OutsideProjectError extends Error { } export interface ConstructExport { type: string; logicalId: string; filePath: string; exportName: string; } export type CheckFilter = (check: Check) => boolean; export interface SharedFile { path: string; content: string; } export type SharedFileRef = number; export declare class Session { #private; /** * The loader for check and config files. The default one is created on * first use, since creating it reads the loader preference from the * environment, which a program that only imports a construct should not do. */ static get loader(): FileLoader; static set loader(loader: FileLoader); static project?: Project; static basePath?: string; static contextPath?: string; static checkDefaults?: CheckConfigDefaults; static checkFilter?: CheckFilter; static browserCheckDefaults?: CheckConfigDefaults; static multiStepCheckDefaults?: CheckConfigDefaults; /** * The parser's current check file, as an absolute physical path. A * construct whose declaring file cannot be read off the call stack (one * the CLI creates itself for a `browserChecks` or `multiStepChecks` glob * entry, a Playwright check, or one created from a test) is attributed * to it; see `Construct.checkFileAbsolutePath`. */ static checkFileAbsolutePath?: string; /** * The physical directory the project is parsed from. `Check.__checkFilePath`, * the path `checkly test ` filters on and reporters group by, is * relative to it. */ static checkFilesDirectory?: string; static availableRuntimes: Record; static defaultRuntimeId?: string; static verifyRuntimeDependencies: boolean; static loadingChecklyConfigFile: boolean; static checklyConfigFileConstructs?: Construct[]; /** * The authenticated account, for constructs that validate against it. * Undefined when the command does not authenticate. */ static account?: Account; static privateLocations: PrivateLocationApi[]; static parsers: Map; static playwrightProjectBundler?: PlaywrightProjectBundler; static embeddedPackagesMaterializer?: EmbeddedPackagesMaterializer; static constructExports: ConstructExport[]; static ignoreDirectoriesMatch: string[]; static embeddedPackages?: string[]; static warnOnWebServerConfig?: boolean; /** * Whether to warn about checks without a location to run on. Only * deploying uses a check's locations; `checkly test` runs every check on * its own run location instead. */ static warnOnMissingCheckLocations: boolean; static packageManager: PackageManager; static workspace: Result; static detectedEnginePromise?: Promise; static reset(): void; static loadFile(filePath: string): Promise; /** * The message to report when loading `filePath` failed because its * constructs come from another checkly install, or `undefined`. */ private static explainOtherInstall; static registerConstruct(construct: Construct): void; static validateCreateConstruct(construct: Construct): void; static getPrivateLocations(): Promise; /** * The loaded project's check defaults, for code generated to live in that * project. Without a loaded project these are all unset, which a codegen * reads as a project without defaults. */ static projectDefaults(): ProjectDefaults; static getRuntime(runtimeId?: string): Runtime | undefined; static getParser(runtime: Runtime): Parser; static getPlaywrightParser(): Parser; static getPlaywrightProjectBundler(): PlaywrightProjectBundler; /** * The materializer for the project's `bundle.packages.embed` option, or * undefined when the option is not set. Memoized so that validation and * bundling share one plan; tarballs are materialized once, at bundle * finalize time, after the bundled lockfile has been pruned. */ static getEmbeddedPackagesMaterializer(): EmbeddedPackagesMaterializer | undefined; /** * A construct's declaring file relative to the directory the project is * parsed from, with posix separators; `undefined` until a parse is under * way (constructs declared in the Checkly config file are created before * that) or when the file is unknown. */ static relativeCheckFilePath(absolutePath?: string): string | undefined; static relativePosixPath(filePath: string): string; static contextRelativePosixPath(filePath: string): string; static sharedFileRefs: Map; static sharedFiles: SharedFile[]; static registerSharedFile(file: SharedFile): SharedFileRef; static resetSharedFiles(): void; }