UNPKG

@sasjs/cli

Version:

Command line interface for SASjs

65 lines (64 loc) 3.58 kB
import { Target, MacroVars } from '@sasjs/utils'; import SASjs from '@sasjs/adapter/node'; import { LogJson } from '../types'; export declare function inExistingProject(folderPath: string): Promise<boolean>; export declare function diff(a: any[], b: any[]): any[]; export declare function createReactApp(folderPath: string): Promise<void>; export declare function createAngularApp(folderPath: string): Promise<void>; export declare function createMinimalApp(folderPath: string): Promise<void>; export declare function createTemplateApp(folderPath: string, template: string): Promise<void>; export declare function setupNpmProject(folderName: string): Promise<void>; export declare function setupGitIgnore(folderName: string): Promise<void>; export declare function setupDoxygen(folderPath: string): Promise<void>; export declare function getUniqServicesObj(services: string[]): any; export declare function executeShellScript(filePath: string, logFilePath: string): Promise<unknown>; export declare function executePowerShellScript(filePath: string, logFilePath: string): Promise<void>; /** * Extracts plain text job log from fetched json log * @param {object} logJson */ export declare function parseLogLines(logJson: LogJson): string; /** * Converts MacroVars JSON from command source param to sas statements * The JSON must have the following structure: * {"macroVars": {"var1": "val1", "var2": "val2"}} * * @param {object} json */ export declare function convertToSASStatements(json: MacroVars): string; export declare const arrToObj: (arr: any[]) => any; export declare const millisecondsToDdHhMmSs: (milliseconds: number) => string; export declare function checkNodeVersion(): void; export declare function getAdapterInstance(target: Target): SASjs; export declare function displaySasjsRunnerError(username: string): void; export declare const loadEnvVariables: (fileName: string) => Promise<void>; export declare function prefixAppLoc(appLoc?: string, path?: string): string | null; export declare const terminateProcess: (status: number) => never; /** * This function checks whether the current directory, or any of the parent * directories, are part of a SASjs project. This is done by testing for * the existence of a ./sasjs/sasjsconfig.json file. * * @returns boolean */ export declare const isSASjsProject: () => Promise<boolean>; /** * Locates an installed npm module and returns its root folder. * * Without `fromDir`, `require.resolve` searches relative to *this file's own* * location on disk - i.e. wherever @sasjs/cli itself is installed - not the * user's project. That's fine for CLI-internal dependencies, but wrong for * anything the user is expected to manage in their own project's * node_modules (e.g. @sasjs/core): since @sasjs/cli also depends on that * same package, default resolution finds the CLI's own bundled copy first * and never reaches the project's. Passing `fromDir` anchors the search at * that directory instead (Node's `paths` option replaces, rather than * extends, the default resolution paths), so callers that need * project-first resolution should pass `process.projectDir` and fall back to * an unscoped call if that returns nothing. * @param {string} module - the name of the npm module to locate. * @param {string} fromDir - optional directory to resolve `module` from, * instead of this file's own location. */ export declare const getNodeModulePath: (module: string, fromDir?: string) => Promise<string>; export declare const isSasJsServerInServerMode: (target: Target) => Promise<boolean>;