///
///
export interface Dirent {
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
isCharacterDevice(): boolean;
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
name: string;
}
export declare type Action = 'create' | 'help' | 'version';
export interface TemplateSchema {
templateUrl: string;
fileTarName: string;
cacheExpiresSec: number;
resourceName: Resource;
templateFolderName: string;
}
export interface Args extends TemplateSchema {
name: string;
originPath: string;
resource: Resource;
destinationPath: string;
}
export declare type Resource = 'ddd-value-object' | 'dvo' | 'rest-api' | 'lambda' | 'ddd-entity' | 'den' | 'ddd-aggregate' | 'dag' | 'ddd-repository' | 'dre' | 'ddd-module' | 'dmo' | 'ddd-model' | 'dmd' | 'ddd-adapter' | 'dad' | 'ddd-event' | 'evt' | 'use-case' | 'usc' | 'command' | 'cmd' | 'web-component' | 'wbc' | 'microservice' | 'mcs' | 'ms-client' | 'msc' | 'web-app' | 'wap';
export interface ExtractTarProps {
tarPath: string;
folderPath: string;
}
export interface DownloadTemplateProps {
templateUrl: string;
tarPath: string;
}
export interface CacheExpiredProps {
templateUrl: string;
fileTarName: string;
resource: Resource;
}
export interface RequestCache {
lastRequest: number;
fileTarName: string;
}
export interface Cache {
createdAt: Date;
updatedAt: Date;
requests: Array;
}
export interface ExtractProps {
zipTarFilePath: string;
destinationPath: string;
}
export interface CopyFileProps {
folderOrigin: string;
destinationPath: string;
}
interface Replace {
[key: string]: string;
}
export interface CompileArgs {
originPath: string;
destinationPath: string;
data: Array;
resourceName: Resource;
name: string;
}
export interface MinArgs {
name: string;
destinationPath: string;
}
export declare type System = NodeJS.Platform;
export interface UserInfo {
executionPath: string;
destinationPath: string;
system: System;
}
export declare type FnGetLibPath = (process: NodeJS.Process, require: NodeRequire) => string | null;
export declare type FnGetCommandPath = (process: NodeJS.Process) => string | null;
export declare type FnGetSystem = (process: NodeJS.Process) => System;
export declare type FnGetArgs = (process: NodeJS.Process) => Array;
export declare type FnGetActionArg = (args: Array) => Action | null;
export declare type FnIsValidAction = (action: string) => boolean;
export declare type FnIsHelpAction = (args: Array) => boolean;
export declare type FnIsVersionAction = (args: Array) => boolean;
export declare type FnGetResource = (args: Array) => Resource | null;
export declare type FnRemoveFilesArgs = (args: Array) => Array;
export declare type FnExtractPropsFromArgs = (args: Array) => MinArgs;
export declare type FnValidateInputs = (args: Array) => number;
export declare type FnExtractTar = (props: ExtractTarProps) => number;
export declare type FnDownloadTemplate = (props: DownloadTemplateProps) => Promise;
export declare type FnIsCacheExpired = (props: TemplateSchema) => boolean;
export declare type FnUpdateCacheExpiration = (props: CacheExpiredProps) => number;
export declare type FnExtractFile = (props: ExtractProps) => Promise;
export declare type FnGetCacheFile = () => Cache;
export declare type FnCopyFiles = (props: CopyFileProps) => number;
export declare type FnReadDir = (path: string) => Array;
export declare type FnBaseCreate = (props: Args) => Promise;
export declare type FnCompile = (props: CompileArgs) => Promise;
export declare type FnRenameFile = (oldPath: string, newPath: string) => number;
export declare type FnWriteFileContent = (path: string, data: string) => number;
export declare type FnApplyData = (file: Dirent, args: CompileArgs) => Promise;
export declare type FnCreateDefaultCacheFile = () => number;
export declare type FnExistsFile = (path: string) => boolean;
export declare type FnGetSchemaFromResource = (resource: Resource) => TemplateSchema | null;
export declare type FnCreateFolderIfNotExists = (path: string) => number;
export declare type FnFormatCase = (value: string) => string;
export declare type FnIsValidChar = (char: string) => boolean;
export declare type FnChangeFileExtension = (filePath: string, fileName: string) => string;
export declare type FnDefineLibPath = (path?: string[]) => string;
export declare type FnPrintHelpForResource = () => number;
export declare type PrintCommands = {
[key in Resource]: FnPrintHelpForResource;
};
export declare type FnCommand = (args: Args) => Promise;
export declare type Commands = {
[key in Resource]: FnCommand;
};
export declare type FnCommands = {
'create': Commands;
};
export {};