Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CliProfileManager

A profile management API compatible with transforming command line arguments into profiles

Hierarchy

Index

Constructors

constructor

Properties

Static Readonly META_FILE_SUFFIX

META_FILE_SUFFIX: string = "_meta"

The meta file suffix - always appended to the meta file to distinguish from other profiles. Users then cannot supply a profile name that would conflict with the meta file.

static
memberof

AbstractProfileManager

Static Readonly PROFILE_EXTENSION

PROFILE_EXTENSION: string = ".yaml"

The default profile file extension (YAML format) - all profiles are stored in YAML format including the meta profile file.

static
memberof

ProfileManager

Accessors

configurations

Protected loadCounter

  • get loadCounter(): Map<string, number>

Protected log

Protected managerParameters

Protected productDisplayName

  • get productDisplayName(): string

Protected profileRootDirectory

  • get profileRootDirectory(): string

Protected profileType

  • get profileType(): string

Protected profileTypeConfiguration

Protected profileTypeConfigurations

Protected profileTypeMetaFileName

  • get profileTypeMetaFileName(): string

Protected profileTypeRootDirectory

  • get profileTypeRootDirectory(): string

Protected profileTypeSchema

Methods

Private addProfileInstruction

  • addProfileInstruction(errDetails: string): string
  • After the DefaultCredentialManager reports an error resolution of recreating a credential, add instruction to recreate the profile.

    Parameters

    • errDetails: string

      The additional details of an error thrown by DefaultCredentialManager.

    Returns string

    An error details string that contains an instruction to recreate the profile (when appropriate).

clearDefault

  • clearDefault(): string

Protected constructFullProfilePath

  • constructFullProfilePath(name: string, type?: string): string

Private createProfileFromCommandArguments

  • Take command line arguments from the user and create a profile from them using the schema and configuration for the profile type

    Parameters

    • profileArguments: Arguments

      CLI arguments specified by the user

    • starterProfile: IProfile

      the profile with name and type to use to start the profile creation

    Returns Promise<IProfile>

    profile which provides the finished profile on fulfill

delete

Protected deleteProfile

Protected deleteProfileFromDisk

  • deleteProfileFromDisk(name: string): string

Private findOptions

getAllProfileNames

  • getAllProfileNames(): string[]

getDefaultProfileName

  • getDefaultProfileName(): string

Private insertCliArgumentsIntoProfile

  • insertCliArgumentsIntoProfile(args: Arguments, profile: IProfile): Promise<void>
  • Default style of building of profile fields to option definitions defined in the schema Will only work if there is a one-to-one option definition mapping for schema fields

    Parameters

    • args: Arguments

      the arguments specified by the user

    • profile: IProfile

      the profile so far, which will be updated

    Returns Promise<void>

Private insertDependenciesIntoProfileFromCLIArguments

  • insertDependenciesIntoProfileFromCLIArguments(args: Arguments, profile: IProfile): void

Protected isProfileEmpty

  • isProfileEmpty(profile: IProfile): boolean

load

loadAll

Protected loadDependencies

Protected loadFailed

  • loadFailed(name: string): void

Protected loadProfile

Protected loadSpecificProfile

  • loadSpecificProfile(name: string, failNotFound?: boolean, loadDependencies?: boolean): Promise<IProfileLoaded>

Protected locateExistingProfile

  • locateExistingProfile(name: string): string

mergeProfiles

Private processSecureProperties

save

Protected saveProfile

setDefault

  • setDefault(name: string): string

update

Protected updateProfile

Private updateProfileFieldsFromCommandArguments

  • If a custom handler is provided for update, the handler will be loaded and invoked in order to build the finished profile

    Parameters

    • oldProfile: IProfile

      the old profile to update

    • newProfile: IProfile

      new profile which may have fields populated, which will be updated from the CLI args

    • newArguments: Arguments

      CLi arguments specified by the user

    • merge: boolean

      should the profiles be merged? (will be skipped if there is a custom update profile handler)

    Returns Promise<IProfile>

    • promise which provides the finished profile on fulfill

Private updateProfileFromCliArgs

validate

Protected validateProfile

Protected validateProfileAgainstSchema

  • validateProfileAgainstSchema(name: string, profile: IProfile, strict?: boolean): void

Protected validateProfileObject

  • validateProfileObject(name: string, type: string, profile: IProfile): void

Private validateRequiredDependenciesAreSpecified

  • validateRequiredDependenciesAreSpecified(profile: IProfile): void

Static initialize

  • Static method to initialize the profile environment. Accepts the profile root directory (normally supplied by your Imperative configuration documents) and all profile "type" configuration documents and constructs the directories needed to manage profiles of all types. You must execute this method before beginning to use profiles OR you must supply all the type configuration documents (normally obtained from your Imperative configuration document) to the constructor of

    static
    memberof

    AbstractProfileManager

    Parameters

    Returns Promise<IProfileInitialized[]>

Generated using TypeDoc