UNPKG

pandora

Version:

A powerful and lightweight application manager for Node.js applications powered by TypeScript.

84 lines (83 loc) 2.99 kB
import { EntryClass, ApplicationRepresentation, ApplicationStructureRepresentation, ProcessRepresentation } from '../domain'; import { ProcfileReconcilerAccessor } from './ProcfileReconcilerAccessor'; /** * Class ProcfileReconciler */ export declare class ProcfileReconciler { appRepresentation: ApplicationRepresentation; procfileBasePath: string; protected discovered: boolean; protected procfileReconcilerAccessor: ProcfileReconcilerAccessor; protected processes: Array<ProcessRepresentation>; protected get appDir(): string; constructor(appRepresentation: ApplicationRepresentation); /** * Find out all possibly profile.js paths * @return {Array} */ resovle(): any[]; /** * Discover procfile.js in appDir, and apply them. */ discover(): void; /** * callProcfile required a argument as typed function, then call that function, pass ProcfileReconcilerAccessor as the first argument of that function. * @param entryFn * @param path */ callProcfile(entryFn: any, path?: any): void; /** * Normalize entry class, entry class such as service class * Those classes have a lazy way to represent, it can get a relative path * this method will wrap that relative path to a real class * @param entry * @return {EntryClass} */ normalizeEntry(entry: any): EntryClass; /** * Define process representation * @param processRepresentation * @return {ProcessRepresentation} */ defineProcess(processRepresentation: any): ProcessRepresentation; /** * Get a process representation by name * @param lookingFor * @return {ProcessRepresentation} */ getProcessByName(lookingFor: any): ProcessRepresentation; /** * Drop a process representation by name */ dropProcessByName(lookingFor: any): void; /** * Get all available processes * @return {any} */ protected getAvailableProcessMap(): {}; /** * Get the Static Structure of the Application * @return {ApplicationStructureRepresentation} */ getApplicationStructure(): ApplicationStructureRepresentation; /** * Echo the appRepresentation to a file * For static getStructureViaNewProcess() read * @param {ApplicationRepresentation} appRepresentation * @param {string} writeTo */ static echoStructure(appRepresentation: ApplicationRepresentation, writeTo: string): void; /** * Get the appRepresentation via a tmp process * Make sure daemon will not got any we don\'t want to be included * @param {ApplicationRepresentation} appRepresentation * @return {Promise<ApplicationStructureRepresentation>} */ static getStructureViaNewProcess(appRepresentation: ApplicationRepresentation): Promise<ApplicationStructureRepresentation>; /** * * @param process * @return {ProcessRepresentation} */ private makeupProcess; }