@soos-io/api-client
Version:
This is the SOOS API Client for registered clients leveraging the various integrations to the SOOS platform. Register for a free trial today at https://app.soos.io/register
58 lines (57 loc) • 2.17 kB
TypeScript
import { IntegrationType } from "../enums";
import { IntegrationName, LogLevel, ScanType } from "../enums";
type ParsedOptions = Record<string, any>;
interface ICommonArguments {
apiKey: string;
apiURL: string;
clientId: string;
integrationName: IntegrationName;
integrationType: IntegrationType;
logLevel: LogLevel;
scanType: ScanType;
scriptVersion: string;
}
declare abstract class ArgumentParserBase {
private argumentParser;
description: string;
scanType: ScanType;
scriptVersion: string;
integrationName: IntegrationName;
integrationType: IntegrationType;
protected constructor(description: string, scanType: ScanType, scriptVersion: string, integrationName: IntegrationName, integrationType: IntegrationType);
private getIntegrateUrl;
private parseCommanderOptions;
private parseCommanderArguments;
private getCombinedCommanderOptionsAndArguments;
protected ensureNoEmptyArgument(name: string, value: string): string;
protected addCommonArguments(scriptVersion: string, integrationName: IntegrationName, integrationType: IntegrationType): void;
addArgument(name: string, description: string, options?: {
defaultValue?: unknown;
internal?: boolean;
required?: boolean;
argParser?: (value: string) => unknown;
choices?: string[];
useNoOptionKey?: boolean;
isFlag?: boolean;
}): void;
addEnumArgument<T, TEnumObject extends Record<string, T>>(name: string, enumObject: TEnumObject, description: string, options: {
defaultValue: T;
allowMultipleValues?: false;
excludeDefault?: string;
internal?: boolean;
required?: boolean;
} | {
defaultValue?: T[];
allowMultipleValues: true;
excludeDefault?: string;
internal?: boolean;
required?: boolean;
}): void;
preParseArguments<T extends ParsedOptions>(argv?: string[]): {
[k: string]: string;
} & T;
parseArguments<T extends ParsedOptions>(argv?: string[]): {
[k: string]: string;
} & T;
}
export { ArgumentParserBase, ICommonArguments, ParsedOptions };