import { Req } from "badmfck-signal"; import { BaseService } from "../BaseService"; import { IConfig, IProjectState } from "./ConfigService"; import { UploadedFile } from "express-fileupload"; import { ValidationModel } from "../.."; import { IDeploymentNotifier } from "./Notifier"; import { IError } from "../structures/Interfaces"; declare const _TSetup: { readonly users: readonly [{ readonly login: ""; readonly password: ""; }]; readonly watchdog: true; readonly $__watchdog_optional: true; readonly notifier: { readonly URL: ""; readonly KEY: ""; }; readonly $__notifier_optional: true; readonly status_url: ""; readonly $__status_url_optional: true; }; export type TDeployerSetup = ValidationModel; export interface IDeployerServiceOptions { projects_path: string; setup_path: string; selfPort?: number; selfBaseEndPoint?: string; } export declare const REQ_DEPLOYMENT_PROCEED: Req<{ auth: string; authLogin?: string; name: string; token: string; files: { file: UploadedFile; }; }, any>; export declare const REQ_DEPLOYMENT_SWITCH: Req<{ auth?: string; authLogin?: string; name: string; token: string; scheme?: "blue" | "green"; }, any>; export declare const REQ_DEPLOYMENT_STATUS: Req<{ auth?: string; authLogin?: string; name?: string; }, any>; export declare const REQ_DEPLOYMENT_SLOT: Req<{ name: string; token: string; slot?: "blue" | "green"; }, any>; export declare const REQ_DEPLOYMENT_BACKUPS: Req<{ auth?: string; authLogin?: string; name: string; }, any>; export declare const REQ_DEPLOYMENT_RESTORE: Req<{ auth?: string; authLogin?: string; name: string; token: string; backup: string; }, any>; export declare class DeployerService extends BaseService { private static MAX_HISTORY; private static _trimHistory; options: IDeployerServiceOptions; setup: TDeployerSetup | null; notifier: IDeploymentNotifier | null; busy: Map; private _setupWatchDebounceTimer; private _lastSetupHash; constructor(options: IDeployerServiceOptions); init(): Promise; private _loadSetup; private _reloadSetup; private _watchSetup; proceed(data: { auth?: string; authLogin?: string; name: string; token: string; files: { file: UploadedFile; }; }): Promise<{ error: { code: number; message: string; httpStatus: number; }; data?: undefined; } | { error?: undefined; data: { ok: boolean; project: string; bluegreen: boolean; slot: "blue" | "green" | null; active: "blue" | "green" | null; activeThisDeploy: boolean; }; }>; switchSlot(data: { auth?: string; authLogin?: string; name: string; token: string; scheme?: "blue" | "green"; }): Promise<{ data?: undefined; error: { code: number; message: string; httpStatus: number; }; } | { error?: undefined; data: { active: "blue" | "green"; previousActive: "blue" | "green"; action: "rollback" | "switch"; hookError: string | null; }; }>; status(data: { auth?: string; authLogin?: string; name?: string; }): Promise<{ data?: undefined; error: { code: number; message: string; httpStatus: number; }; } | { error?: undefined; data: Record; }>; private static _isBlueGreen; private static _backupRoot; listBackups(data: { auth?: string; authLogin?: string; name: string; }): Promise<{ data?: undefined; error: { code: number; message: string; httpStatus: number; }; } | { error?: undefined; data: { project: string; bluegreen: boolean; activeSlot: string | null; backupEnabled: boolean; keep: number; backups: import("./BackupManager").IBackupInfo[]; }; }>; restoreBackup(data: { auth?: string; authLogin?: string; name: string; token: string; backup: string; }): Promise<{ data?: undefined; error: { code: number; message: string; httpStatus: number; details?: undefined; }; } | { data?: undefined; error: { code: number; message: string; details: string; httpStatus: number; }; } | { error?: undefined; data: { project: string; restored: string; appVersion: string | null; slot: import("./BackupManager").TBackupSlot; activeSlot: "blue" | "green" | null; live: boolean; preRestoreBackup: string | null; pm2Restarted: boolean; pm2Error: string | null; }; }>; slotState(data: { name: string; token: string; slot?: "blue" | "green"; }): Promise<{ error: { code: number; message: string; httpStatus: number; }; } | { data: { project: string; active: "blue" | "green"; lastDeployed: "blue" | "green"; readyToSwitch: boolean; slot: "blue" | "green" | null; isActive: boolean | null; checkedAt: number; }; }>; private _statusUrl; private _writeBlueGreenFiles; tokensMatch(a: string | undefined, b: string | undefined): boolean; private _warnPlaintextUsers; static PLAINTEXT_ERROR: string; private _checkUserAuth; private static _extractPort; private _renderNginx; runPM2(found: IConfig, projectState?: IProjectState | null): Promise; private _verifyAutorestart; private static readonly SKIP_DIRS; private static readonly TEMPLATE_EXTENSIONS; applyConfig(dir: string, config: Record): Promise; processFile(filePath: string, config: Record): Promise; private _destinationProblem; private static _unsafeArchiveEntry; private static _escapingSymlink; private _runMigrate; static MIGRATE_TIMEOUT_MS: number; unpack(destination: string, uploadedFile: string, install?: boolean, ignoreDirectoryClean?: boolean): Promise; upload(file: UploadedFile, uploadPath: string): Promise; } export {};