7.2.608 • Published 5 years ago

@ibm-wch-sdk/cli-utils v7.2.608

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@ibm-wch-sdk/cli-utils

Exposes framework independent utilities to support the implementation command line utilities for @ibm-wch-sdk/ng and similar SDK.

Class documentation

Refer to the documentation.

Usage

Install the module via

npm install --save @ibm-wch-sdk/cli-utils

Home > @ibm-wch-sdk/cli-utils

cli-utils package

Enumerations

EnumerationDescription
PACKAGE_INSTALL

Functions

FunctionDescription
addLayoutToMapping(aLayoutMapping, aLayout)Adds a layout to a layout mapping entry, inplace
assertIsValidCredentials(aValue, aName)Tests if the given value is a valid Credentials object
assertIsValidPassword(aValue, aName)Tests if the given value is a valid password, throws if not.
assertIsValidProjectName(aValue, aName)Tests if the given value is a valid project name
assertIsValidUrl(aValue, aName)Tests if the given value is a valid url, throws if not.
assertIsValidUserName(aValue, aName)Tests if the given value is a valid user name, throws if not.
assertIsValidWchToolsOptions(aValue, aName)Tests if the given value is a valid WchToolsOptions object
blackWhiteList(aInclude, aExclude)
canonicalizeJson(aData)Performs an inplace canonicalization of a JSON object
canTypeHaveLayout(aType)Tests if an authoring type can have a layout
cmdCreateProject(aRootFolder, aProjectName, aApiUrl)Constructs a brand new angular project and adds the SDK to the project
createGuid(aId, aSecret)Constructs a GUID in a reproducible way from an ID
createTypePredicate(aOptions)Creates a predicate that filters authoring types
findLayoutComponent(aSource)Locates the layout component from the source file that represents the layout component declaration.
findLayoutModule(aLayoutClasses)Returns a finder for layout modules
fromRegExp(aRegexp)Returns a regular expression tester from a sequence of expressions
fromRegExpString(aRegexp)
getLayoutComponents(aAllFiles)From these files extract all layout components
getLayoutModules(aAllFiles, aLayoutClasses)Locates the layout modules
getLayoutSelector(aLayoutComponent)Returns the layout selector for the layout component
getLayoutTemplate(aLayout)Returns the template identifier from the authoring layout. For an angular layout this is the template, else it is the name or the id as a fallback
isValidProjectName(projectName)Validates project names for Angular projects
ngGetDefaultProject(aJson)Returns the default project, either the configured project or the first one
packageInstaller(aDirOrFile)Returns a function that allows to install packages via the configured package installer. The function will invoke the package manager in the directory of the package JSON located in the given directory
reduceSourceFiles()Reduces all source files to an object, keyed by filename
rxExecuteCli(aPkgDir, aArgs, aLogSvc)Executes the WCH SDK CLI. If we can find it in the path, use that version, else use npx to install and run it.
rxExecuteNg(aPkgDir, aArgs, aLogSvc)Executes the angular command line. If we can find it in the path, use that version, else use npx to install and run it.
rxExecuteWchTools(aPkgDir, aArgs, aLogSvc)Executes wchtools. If we can find wchtools in the path, use that version, else use npx to install and run it.
rxFindAngularJson(aRootDir)Locates the angular configuration file, next to the package json file
rxFindAngularVersion(aRootDir)Locates the version of angular to use
rxFindAuthoringLayoutMappings(aRoot)Reads the authoring layouts from a directory
rxFindAuthoringLayouts(aRoot)Reads the authoring layouts from a directory
rxFindAuthoringTypes(aRoot)Reads the authoring types from a directory
rxFindDataDir(aDirOrFile)Locates the data directory
rxFindPackageJson(aDirOrFile)Locates the package json relative to the given directory
rxFindPackageManager(aDirOrFile)Locates the configured package manager
rxFindScript(aName, aRoot)Locates the executable script command
rxFindSdkVersion(aRootDir)Locates the version of the SDK to use, either from the package JSON or from our own build
rxGetSourceFolder(aAngularJson, aProject)Returns the source folder for the angular application
rxReadAngularJson(aRootDir)Reads the angular configuration file, next to the package json file
rxReadAuthoringLayoutMappings(aRoot)Reads the authoring layouts from a directory
rxReadAuthoringLayouts(aRoot)Reads the authoring layouts from a directory
rxReadAuthoringTypes(aRoot)Reads the authoring types from a directory
rxReadPackageJson(aDirOrFile)Locates and reads the package json
rxReadSourceFiles(aRoot)Reads all typescript files
rxReadWchToolsOptions(aOptionsDir)Reads the wchtools options object
rxVerifyPreRequisites(aPrereq, aRootDir)Verifies if the installed prerequisites meet the requirements.
rxWchToolsGetCredentials(aApiUrl)Reads the wch credentials from the given API URL
rxWriteJsonEntryMap(aMap)Persists the entries in the map
rxWriteWchToolsOptions(aOptionsDir, aOptions)Reads the wchtools options object
sdkVersionFromAngularVersion(aAngularVersion)Returns the SDK version from the Angular version

Interfaces

InterfaceDescription
JsonEntry

Variables

VariableDescription
VERSIONExports the current version object

Type Aliases

Type AliasDescription
AuthoringLayoutMapMapping from type id to json record for authoring layouts
AuthoringLayoutMappingMapMapping from type id to json record for authoring layout mappings
AuthoringTypeMapMapping from type id to json record for authoring types
JsonEntryMap
PreRequisitesPrerequisites as module name to string

Home > @ibm-wch-sdk/cli-utils > PACKAGE_INSTALL

PACKAGE_INSTALL enum

Signature:

export declare enum PACKAGE_INSTALL 

Enumeration Members

MemberValueDescription
DEPENDENCIES0
DEV_DEPENDENCIES1
GLOBAL2

Home > @ibm-wch-sdk/cli-utils > addLayoutToMapping

addLayoutToMapping() function

Adds a layout to a layout mapping entry, inplace

Signature:

export declare function addLayoutToMapping(aLayoutMapping: AuthoringLayoutMapping, aLayout: AuthoringLayout): AuthoringLayoutMapping;

Parameters

ParameterTypeDescription
aLayoutMappingAuthoringLayoutMappingthe layout mapping entry
aLayoutAuthoringLayoutthe layout

Returns:

AuthoringLayoutMapping

the mapping

Home > @ibm-wch-sdk/cli-utils > assertIsValidCredentials

assertIsValidCredentials() function

Tests if the given value is a valid Credentials object

Signature:

export declare function assertIsValidCredentials(aValue: any, aName?: string): Credentials;

Parameters

ParameterTypeDescription
aValueanythe value to check
aNamestringoptional name of the field we check

Returns:

Credentials

the value

Home > @ibm-wch-sdk/cli-utils > assertIsValidPassword

assertIsValidPassword() function

Tests if the given value is a valid password, throws if not.

Signature:

export declare function assertIsValidPassword(aValue: any, aName?: string): string;

Parameters

ParameterTypeDescription
aValueanythe value to check
aNamestringoptional name of the field we check

Returns:

string

the value

Home > @ibm-wch-sdk/cli-utils > assertIsValidProjectName

assertIsValidProjectName() function

Tests if the given value is a valid project name

Signature:

export declare function assertIsValidProjectName(aValue: any, aName?: string): string;

Parameters

ParameterTypeDescription
aValueanythe value to check
aNamestringoptional name of the field we check

Returns:

string

the value

Home > @ibm-wch-sdk/cli-utils > assertIsValidUrl

assertIsValidUrl() function

Tests if the given value is a valid url, throws if not.

Signature:

export declare function assertIsValidUrl(aValue: any, aName?: string): string;

Parameters

ParameterTypeDescription
aValueanythe value to check
aNamestringoptional name of the field we check

Returns:

string

the value

Home > @ibm-wch-sdk/cli-utils > assertIsValidUserName

assertIsValidUserName() function

Tests if the given value is a valid user name, throws if not.

Signature:

export declare function assertIsValidUserName(aValue: any, aName?: string): string;

Parameters

ParameterTypeDescription
aValueanythe value to check
aNamestringoptional name of the field we check

Returns:

string

the value

Home > @ibm-wch-sdk/cli-utils > assertIsValidWchToolsOptions

assertIsValidWchToolsOptions() function

Tests if the given value is a valid WchToolsOptions object

Signature:

export declare function assertIsValidWchToolsOptions(aValue: any, aName?: string): WchToolsOptions;

Parameters

ParameterTypeDescription
aValueanythe value to check
aNamestringoptional name of the field we check

Returns:

WchToolsOptions

the value

Home > @ibm-wch-sdk/cli-utils > blackWhiteList

blackWhiteList() function

Signature:

export declare function blackWhiteList(aInclude?: string[], aExclude?: string[]): Predicate<string>;

Parameters

ParameterTypeDescription
aIncludestring[]
aExcludestring[]

Returns:

Predicate<string>

Home > @ibm-wch-sdk/cli-utils > canonicalizeJson

canonicalizeJson() function

Performs an inplace canonicalization of a JSON object

Signature:

export declare function canonicalizeJson(aData: any): any;

Parameters

ParameterTypeDescription
aDataanythe JSON object

Returns:

any

the canonicalized object

Home > @ibm-wch-sdk/cli-utils > canTypeHaveLayout

canTypeHaveLayout() function

Tests if an authoring type can have a layout

Signature:

export declare function canTypeHaveLayout(aType: AuthoringType): boolean;

Parameters

ParameterTypeDescription
aTypeAuthoringTypethe type

Returns:

boolean

true if the type can have a layout, else false

Home > @ibm-wch-sdk/cli-utils > cmdCreateProject

cmdCreateProject() function

Constructs a brand new angular project and adds the SDK to the project

Signature:

export declare function cmdCreateProject(aRootFolder: string, aProjectName: string, aApiUrl: string): Observable<SpawnLine>;

Parameters

ParameterTypeDescription
aRootFolderstringthe root folder of the project
aProjectNamestringthe project name
aApiUrlstringthe WCH API URL

Returns:

Observable<SpawnLine>

an observable of the command output

Home > @ibm-wch-sdk/cli-utils > createGuid

createGuid() function

Constructs a GUID in a reproducible way from an ID

Signature:

export declare function createGuid(aId: string, aSecret?: string): string;

Parameters

ParameterTypeDescription
aIdstringthe original ID
aSecretstringsome optional secret

Returns:

string

the guid

Home > @ibm-wch-sdk/cli-utils > createTypePredicate

createTypePredicate() function

Creates a predicate that filters authoring types

Signature:

export declare function createTypePredicate(aOptions: {
    include?: string[];
    exclude?: string[];
}): Predicate<AuthoringType>;

Parameters

ParameterTypeDescription
aOptions{<p/> include?: string[];<p/> exclude?: string[];<p/>}black whitelist options

Returns:

Predicate<AuthoringType>

the predicate

Home > @ibm-wch-sdk/cli-utils > findLayoutComponent

findLayoutComponent() function

Locates the layout component from the source file that represents the layout component declaration.

Signature:

export declare function findLayoutComponent(aSource: SourceFile): ClassDeclaration;

Parameters

ParameterTypeDescription
aSourceSourceFile

Returns:

ClassDeclaration

Home > @ibm-wch-sdk/cli-utils > findLayoutModule

findLayoutModule() function

Returns a finder for layout modules

Signature:

export declare function findLayoutModule(aLayoutClasses: Record<string, ClassDeclaration>): UnaryFunction<SourceFile, ClassDeclaration>;

Parameters

ParameterTypeDescription
aLayoutClassesRecord<string, ClassDeclaration>record of classes

Returns:

UnaryFunction<SourceFile, ClassDeclaration>

the finder

Home > @ibm-wch-sdk/cli-utils > fromRegExp

fromRegExp() function

Returns a regular expression tester from a sequence of expressions

Signature:

export declare function fromRegExp(aRegexp?: RegExp[]): Predicate<string>;

Parameters

ParameterTypeDescription
aRegexpRegExp[]the expressions

Returns:

Predicate<string>

the predicate

Home > @ibm-wch-sdk/cli-utils > fromRegExpString

fromRegExpString() function

Signature:

export declare function fromRegExpString(aRegexp?: string[]): Predicate<string>;

Parameters

ParameterTypeDescription
aRegexpstring[]

Returns:

Predicate<string>

Home > @ibm-wch-sdk/cli-utils > getLayoutComponents

getLayoutComponents() function

From these files extract all layout components

Signature:

export declare function getLayoutComponents(aAllFiles: Record<string, SourceFile>): Record<string, ClassDeclaration>;

Parameters

ParameterTypeDescription
aAllFilesRecord<string, SourceFile>

Returns:

Record<string, ClassDeclaration>

Home > @ibm-wch-sdk/cli-utils > getLayoutModules

getLayoutModules() function

Locates the layout modules

Signature:

export declare function getLayoutModules(aAllFiles: Record<string, SourceFile>, aLayoutClasses: Record<string, ClassDeclaration>): Record<string, ClassDeclaration>;

Parameters

ParameterTypeDescription
aAllFilesRecord<string, SourceFile>all source files
aLayoutClassesRecord<string, ClassDeclaration>the layout classes

Returns:

Record<string, ClassDeclaration>

all modules that export the classes

Home > @ibm-wch-sdk/cli-utils > getLayoutSelector

getLayoutSelector() function

Returns the layout selector for the layout component

Signature:

export declare function getLayoutSelector(aLayoutComponent: ClassDeclaration): string;

Parameters

ParameterTypeDescription
aLayoutComponentClassDeclarationthe layout component

Returns:

string

the layout selector or undefined

Home > @ibm-wch-sdk/cli-utils > getLayoutTemplate

getLayoutTemplate() function

Returns the template identifier from the authoring layout. For an angular layout this is the template, else it is the name or the id as a fallback

Signature:

export declare function getLayoutTemplate(aLayout: AuthoringLayout): string;

Parameters

ParameterTypeDescription
aLayoutAuthoringLayoutthe layout

Returns:

string

the template

Home > @ibm-wch-sdk/cli-utils > isValidProjectName

isValidProjectName() function

Validates project names for Angular projects

Signature:

export declare function isValidProjectName(projectName: string): boolean;

Parameters

ParameterTypeDescription
projectNamestringthe project name

Returns:

boolean

true if the project name is valid, else false

Home > @ibm-wch-sdk/cli-utils > ngGetDefaultProject

ngGetDefaultProject() function

Returns the default project, either the configured project or the first one

Signature:

export declare function ngGetDefaultProject(aJson: any): string;

Parameters

ParameterTypeDescription
aJsonanythe angular json

Returns:

string

the default project

Home > @ibm-wch-sdk/cli-utils > packageInstaller

packageInstaller() function

Returns a function that allows to install packages via the configured package installer. The function will invoke the package manager in the directory of the package JSON located in the given directory

Signature:

export declare function packageInstaller(aDirOrFile: string): (aType: PACKAGE_INSTALL, ...aPackages: string[]) => Observable<SpawnLine>;

Parameters

ParameterTypeDescription
aDirOrFilestringbase directory

Returns:

(aType: PACKAGE_INSTALL, ...aPackages: string[]) => Observable<SpawnLine>

an install callback

Home > @ibm-wch-sdk/cli-utils > reduceSourceFiles

reduceSourceFiles() function

Reduces all source files to an object, keyed by filename

Signature:

export declare function reduceSourceFiles(): OperatorFunction<SourceFile, Record<string, SourceFile>>;

Returns:

OperatorFunction<SourceFile, Record<string, SourceFile>>

the reducer function

Home > @ibm-wch-sdk/cli-utils > rxExecuteCli

rxExecuteCli() function

Executes the WCH SDK CLI. If we can find it in the path, use that version, else use npx to install and run it.

Signature:

export declare function rxExecuteCli(aPkgDir: string, aArgs: string[], aLogSvc?: LoggerService): Observable<SpawnLine>;

Parameters

ParameterTypeDescription
aPkgDirstringthe package directory, will be the execution directory
aArgsstring[]the arguments
aLogSvcLoggerServicethe logger service

Returns:

Observable<SpawnLine>

an observable with the output of the command

Home > @ibm-wch-sdk/cli-utils > rxExecuteNg

rxExecuteNg() function

Executes the angular command line. If we can find it in the path, use that version, else use npx to install and run it.

Signature:

export declare function rxExecuteNg(aPkgDir: string, aArgs: string[], aLogSvc?: LoggerService): Observable<SpawnLine>;

Parameters

ParameterTypeDescription
aPkgDirstringthe package directory, will be the execution directory
aArgsstring[]the arguments
aLogSvcLoggerServicethe logger service

Returns:

Observable<SpawnLine>

an observable with the output of the command

Home > @ibm-wch-sdk/cli-utils > rxExecuteWchTools

rxExecuteWchTools() function

Executes wchtools. If we can find wchtools in the path, use that version, else use npx to install and run it.

Signature:

export declare function rxExecuteWchTools(aPkgDir: string, aArgs: string[], aLogSvc?: LoggerService): Observable<SpawnLine>;

Parameters

ParameterTypeDescription
aPkgDirstringthe package directory, will be the execution directory
aArgsstring[]the arguments to wchtools
aLogSvcLoggerServicethe logger service

Returns:

Observable<SpawnLine>

an observable with the output of the command

Home > @ibm-wch-sdk/cli-utils > rxFindAngularJson

rxFindAngularJson() function

Locates the angular configuration file, next to the package json file

Signature:

export declare function rxFindAngularJson(aRootDir: string): Observable<FileDescriptor>;

Parameters

ParameterTypeDescription
aRootDirstringthe starting directory

Returns:

Observable<FileDescriptor>

the angular JSON file

Home > @ibm-wch-sdk/cli-utils > rxFindAngularVersion

rxFindAngularVersion() function

Locates the version of angular to use

Signature:

export declare function rxFindAngularVersion(aRootDir: string): Observable<string>;

Parameters

ParameterTypeDescription
aRootDirstringthe root directory used to locate the packae

Returns:

Observable<string>

the angular version as a semantic version string

Home > @ibm-wch-sdk/cli-utils > rxFindAuthoringLayoutMappings

rxFindAuthoringLayoutMappings() function

Reads the authoring layouts from a directory

Signature:

export declare function rxFindAuthoringLayoutMappings(aRoot: string): Observable<JsonEntry<AuthoringLayoutMapping>>;

Parameters

ParameterTypeDescription
aRootstringroot directory

Returns:

Observable<JsonEntry<AuthoringLayoutMapping>>

the result

Home > @ibm-wch-sdk/cli-utils > rxFindAuthoringLayouts

rxFindAuthoringLayouts() function

Reads the authoring layouts from a directory

Signature:

export declare function rxFindAuthoringLayouts(aRoot: string): Observable<JsonEntry<AuthoringLayout>>;

Parameters

ParameterTypeDescription
aRootstringroot directory

Returns:

Observable<JsonEntry<AuthoringLayout>>

the result

Home > @ibm-wch-sdk/cli-utils > rxFindAuthoringTypes

rxFindAuthoringTypes() function

Reads the authoring types from a directory

Signature:

export declare function rxFindAuthoringTypes(aRoot: string): Observable<JsonFile<AuthoringType>>;

Parameters

ParameterTypeDescription
aRootstringroot directory

Returns:

Observable<JsonFile<AuthoringType>>

the result

Home > @ibm-wch-sdk/cli-utils > rxFindDataDir

rxFindDataDir() function

Locates the data directory

Signature:

export declare function rxFindDataDir(aDirOrFile: string): Observable<string>;

Parameters

ParameterTypeDescription
aDirOrFilestringroot path or file to search from

Returns:

Observable<string>

the data path

Home > @ibm-wch-sdk/cli-utils > rxFindPackageJson

rxFindPackageJson() function

Locates the package json relative to the given directory

Signature:

export declare function rxFindPackageJson(aDirOrFile: string): Observable<string>;

Parameters

ParameterTypeDescription
aDirOrFilestringthe starting directory or the name of the package json or the name of a package json

Returns:

Observable<string>

the name of the package json or an error

Home > @ibm-wch-sdk/cli-utils > rxFindPackageManager

rxFindPackageManager() function

Locates the configured package manager

Signature:

export declare function rxFindPackageManager(aDirOrFile: string): Observable<string>;

Parameters

ParameterTypeDescription
aDirOrFilestringroot directory

Returns:

Observable<string>

the package manager to use

Home > @ibm-wch-sdk/cli-utils > rxFindScript

rxFindScript() function

Locates the executable script command

Signature:

export declare function rxFindScript(aName: string, aRoot?: string): Observable<string>;

Parameters

ParameterTypeDescription
aNamestringname of the script
aRootstringoptionally a root to identify the project to seach in

Returns:

Observable<string>

the full path to the executable script

Home > @ibm-wch-sdk/cli-utils > rxFindSdkVersion

rxFindSdkVersion() function

Locates the version of the SDK to use, either from the package JSON or from our own build

Signature:

export declare function rxFindSdkVersion(aRootDir: string): Observable<string>;

Parameters

ParameterTypeDescription
aRootDirstringthe root directory used to locate the packae

Returns:

Observable<string>

the SDK version as a semantic version string

Home > @ibm-wch-sdk/cli-utils > rxGetSourceFolder

rxGetSourceFolder() function

Returns the source folder for the angular application

Signature:

export declare function rxGetSourceFolder(aAngularJson: JsonFile<any>, aProject?: string): Observable<FileDescriptor>;

Parameters

ParameterTypeDescription
aAngularJsonJsonFile<any>the angular JSON file
aProjectstringoptionally the project, otherwise use the default project

Returns:

Observable<FileDescriptor>

the source folder from that file

Home > @ibm-wch-sdk/cli-utils > rxReadAngularJson

rxReadAngularJson() function

Reads the angular configuration file, next to the package json file

Signature:

export declare function rxReadAngularJson(aRootDir: string): Observable<JsonFile<any>>;

Parameters

ParameterTypeDescription
aRootDirstringthe starting directory

Returns:

Observable<JsonFile<any>>

the angular JSON file

Home > @ibm-wch-sdk/cli-utils > rxReadAuthoringLayoutMappings

rxReadAuthoringLayoutMappings() function

Reads the authoring layouts from a directory

Signature:

export declare function rxReadAuthoringLayoutMappings(aRoot: string): Observable<AuthoringLayoutMappingMap>;

Parameters

ParameterTypeDescription
aRootstringroot directory

Returns:

Observable<AuthoringLayoutMappingMap>

the result

Home > @ibm-wch-sdk/cli-utils > rxReadAuthoringLayouts

rxReadAuthoringLayouts() function

Reads the authoring layouts from a directory

Signature:

export declare function rxReadAuthoringLayouts(aRoot: string): Observable<AuthoringLayoutMap>;

Parameters

ParameterTypeDescription
aRootstringroot directory

Returns:

Observable<AuthoringLayoutMap>

the result

Home > @ibm-wch-sdk/cli-utils > rxReadAuthoringTypes

rxReadAuthoringTypes() function

Reads the authoring types from a directory

Signature:

export declare function rxReadAuthoringTypes(aRoot: string): Observable<AuthoringTypeMap>;

Parameters

ParameterTypeDescription
aRootstringroot directory

Returns:

Observable<AuthoringTypeMap>

the result

Home > @ibm-wch-sdk/cli-utils > rxReadPackageJson

rxReadPackageJson() function

Locates and reads the package json

Signature:

export declare function rxReadPackageJson(aDirOrFile: string): Observable<any>;

Parameters

ParameterTypeDescription
aDirOrFilestringdirectory or file as a starting point

Returns:

Observable<any>

the package

Home > @ibm-wch-sdk/cli-utils > rxReadSourceFiles

rxReadSourceFiles() function

Reads all typescript files

Signature:

export declare function rxReadSourceFiles(aRoot: string): Observable<SourceFile>;

Parameters

ParameterTypeDescription
aRootstringroot of the source files

Returns:

Observable<SourceFile>

an observable of the source files

Home > @ibm-wch-sdk/cli-utils > rxReadWchToolsOptions

rxReadWchToolsOptions() function

Reads the wchtools options object

Signature:

export declare function rxReadWchToolsOptions(aOptionsDir: string): Observable<WchToolsOptions>;

Parameters

ParameterTypeDescription
aOptionsDirstringthe options directory

Returns:

Observable<WchToolsOptions>

the options

Home > @ibm-wch-sdk/cli-utils > rxVerifyPreRequisites

rxVerifyPreRequisites() function

Verifies if the installed prerequisites meet the requirements.

Signature:

export declare function rxVerifyPreRequisites(aPrereq: PreRequisites, aRootDir: string): Observable<PreRequisites>;

Parameters

ParameterTypeDescription
aPrereqPreRequisitesrequired prerequisites
aRootDirstringroot directory

Returns:

Observable<PreRequisites>

the missing prerequisites from the input or the empty object

Home > @ibm-wch-sdk/cli-utils > rxWchToolsGetCredentials

rxWchToolsGetCredentials() function

Reads the wch credentials from the given API URL

Signature:

export declare function rxWchToolsGetCredentials(aApiUrl: string): Observable<Credentials>;

Parameters

ParameterTypeDescription
aApiUrlstringthe API URL

Returns:

Observable<Credentials>

the attached credentials

Home > @ibm-wch-sdk/cli-utils > rxWriteJsonEntryMap

rxWriteJsonEntryMap() function

Persists the entries in the map

Signature:

export declare function rxWriteJsonEntryMap<T>(aMap: JsonEntryMap<T>): Observable<JsonEntry<T>>;

Parameters

ParameterTypeDescription
aMapJsonEntryMap<T>the map to persist

Returns:

Observable<JsonEntry<T>>

an observable stream of the persisted entries

Home > @ibm-wch-sdk/cli-utils > rxWriteWchToolsOptions

rxWriteWchToolsOptions() function

Reads the wchtools options object

Signature:

export declare function rxWriteWchToolsOptions(aOptionsDir: string, aOptions: WchToolsOptions): Observable<WchToolsOptions>;

Parameters

ParameterTypeDescription
aOptionsDirstringthe directory for the options
aOptionsWchToolsOptionsthe new options to write

Returns:

Observable<WchToolsOptions>

the written options

Home > @ibm-wch-sdk/cli-utils > sdkVersionFromAngularVersion

sdkVersionFromAngularVersion() function

Returns the SDK version from the Angular version

Signature:

export declare function sdkVersionFromAngularVersion(aAngularVersion: string): string;

Parameters

ParameterTypeDescription
aAngularVersionstringthe angular version string

Returns:

string

the matching SDK version string

Home > @ibm-wch-sdk/cli-utils > JsonEntry

JsonEntry interface

Signature:

export interface JsonEntry<T> extends JsonFile<T> 

Properties

PropertyTypeDescription
idstring

Home > @ibm-wch-sdk/cli-utils > VERSION

VERSION variable

Exports the current version object

Signature:

VERSION: import("@ibm-wch-sdk/api").WchSdkVersion

Home > @ibm-wch-sdk/cli-utils > AuthoringLayoutMap

AuthoringLayoutMap type

Mapping from type id to json record for authoring layouts

Signature:

export declare type AuthoringLayoutMap = JsonEntryMap<AuthoringLayout>;

Home > @ibm-wch-sdk/cli-utils > AuthoringLayoutMappingMap

AuthoringLayoutMappingMap type

Mapping from type id to json record for authoring layout mappings

Signature:

export declare type AuthoringLayoutMappingMap = JsonEntryMap<AuthoringLayoutMapping>;

Home > @ibm-wch-sdk/cli-utils > AuthoringTypeMap

AuthoringTypeMap type

Mapping from type id to json record for authoring types

Signature:

export declare type AuthoringTypeMap = JsonEntryMap<AuthoringType>;

Home > @ibm-wch-sdk/cli-utils > JsonEntryMap

JsonEntryMap type

Signature:

export declare type JsonEntryMap<T> = Record<string, JsonEntry<T>>;

Home > @ibm-wch-sdk/cli-utils > PreRequisites

PreRequisites type

Prerequisites as module name to string

Signature:

export declare type PreRequisites = Record<string, string>;

Home > @ibm-wch-sdk/cli-utils > JsonEntry > id

JsonEntry.id property

Signature:

id: string;