npm package: @ibm-wch-sdk/cli-utils
Description: Helper library for rx helpers around node APIs.
Author: Carsten Leue
Latest version: 7.2.608

<a name="_07fc3e3f0a90e5b4ec028dbdbbcb2ae68d690cf82df3975bd8efb74f0c36ba69"></a>
# @ibm-wch-sdk/cli-utils

Exposes framework independent utilities to support the implementation command line utilities for [@ibm-wch-sdk/ng](https://www.npmjs.com/package/@ibm-wch-sdk/ng) and similar SDK.

## Class documentation

Refer to the [documentation](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a).

## Usage

Install the module via

```bash
npm install --save @ibm-wch-sdk/cli-utils
```

<a name="_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a)

## cli-utils package

## Enumerations

|  Enumeration | Description |
|  --- | --- |
|  [PACKAGE\_INSTALL](#_78ce36dce377c861d5b16530498c7929e8dfe2a0b657e671c36d2419d7f7a351) |  |

## Functions

|  Function | Description |
|  --- | --- |
|  [addLayoutToMapping(aLayoutMapping, aLayout)](#_ac23f68695bebd15c88420d07c3a981611116eb85567fee048f2150562d74c19) | Adds a layout to a layout mapping entry, inplace |
|  [assertIsValidCredentials(aValue, aName)](#_c780051eeb735599192311e06cc722a456058a5afccfcb23f735313c05d023c4) | Tests if the given value is a valid Credentials object |
|  [assertIsValidPassword(aValue, aName)](#_d20342a194b3a0ddff7420e8072caf779d292a522ed29b376875a0eafdb854fb) | Tests if the given value is a valid password, throws if not. |
|  [assertIsValidProjectName(aValue, aName)](#_88cb579e70426671fc7efdaf198d0634be8128d4d4104e114fb95439b687b5f0) | Tests if the given value is a valid project name |
|  [assertIsValidUrl(aValue, aName)](#_df873b145a67f966502d4b596c5d5f3364d9cf3b9ffe7b65edc0a5f183db3300) | Tests if the given value is a valid url, throws if not. |
|  [assertIsValidUserName(aValue, aName)](#_66891eaa5b5615d01247bce0cbefca2ff7a1d6b9c75a31083f8317efe5de8723) | Tests if the given value is a valid user name, throws if not. |
|  [assertIsValidWchToolsOptions(aValue, aName)](#_92efe2b48452f8cdb2c14ef6234780e8a7af3342530ab8790bed235271a5fac5) | Tests if the given value is a valid WchToolsOptions object |
|  [blackWhiteList(aInclude, aExclude)](#_266a2742a46a9738ba202d2e35fee4554c7c7091450cc18570d9f0ac14d49e5d) |  |
|  [canonicalizeJson(aData)](#_f42d0d940f287b01fcebf2a5a4498655cf58b52b1c250cf28b1a96459c3434fd) | Performs an inplace canonicalization of a JSON object |
|  [canTypeHaveLayout(aType)](#_a51dc7954faa64612b727541437dcf74596be17bd43938dcb2fe7f153d1a05a3) | Tests if an authoring type can have a layout |
|  [cmdCreateProject(aRootFolder, aProjectName, aApiUrl)](#_2397cb9f1cddcd9eff24f92a3b2fd1e6507f6deea71076fd697fcdc2f15c216b) | Constructs a brand new angular project and adds the SDK to the project |
|  [createGuid(aId, aSecret)](#_d32890fc1dc3af75a55bf499c001d582ac502cc5f158c9b2b8e492a37c68bca8) | Constructs a GUID in a reproducible way from an ID |
|  [createTypePredicate(aOptions)](#_a5e86458317da824837e7956dac6c751afb5b73ada51c965de597afcbf887101) | Creates a predicate that filters authoring types |
|  [findLayoutComponent(aSource)](#_eea8ed70e9a562a8f506df174f29ec44147e09b3a35e0c4f3bbaaf718f689144) | Locates the layout component from the source file that represents the layout component declaration. |
|  [findLayoutModule(aLayoutClasses)](#_6e3b00a7164b3d4c96f24f3092e9e079921ef6f195ef8ab02955689d15d39af3) | Returns a finder for layout modules |
|  [fromRegExp(aRegexp)](#_fa411c1f5d1ebe568d2b0c128bec57bd954850cf6d86c1055e35629c0cfe8798) | Returns a regular expression tester from a sequence of expressions |
|  [fromRegExpString(aRegexp)](#_8be817cb81d2089dfd20a8c22aba6d6bfe2901694f08bd48d92b71bc5cb41ae0) |  |
|  [getLayoutComponents(aAllFiles)](#_87df9a93a0d42b358e5e0274a71b81b5750142ca6689d13936a37237dc117860) | From these files extract all layout components |
|  [getLayoutModules(aAllFiles, aLayoutClasses)](#_e8cec605c8a2844eb75e9233a5906921af5bea893268e084cec766934e427e70) | Locates the layout modules |
|  [getLayoutSelector(aLayoutComponent)](#_b040c1f2deccca2994bdc7f1e81e787be684f7c60b2e7ac9de9503aa00c96226) | Returns the layout selector for the layout component |
|  [getLayoutTemplate(aLayout)](#_8d54c4cfb13e8bacb0cb295dcf65cf615529a4080a4b2baa40af3cb306d31516) | 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)](#_60f49a32ed2fc60fb6caafbd73726823a0c2a6e6b0b02eccdc63b2a3ccefef23) | Validates project names for Angular projects |
|  [ngGetDefaultProject(aJson)](#_749ca7a78f0519714fc2f1567248b5188a3f5a2b1be1ad8aa77a319fc7b20810) | Returns the default project, either the configured project or the first one |
|  [packageInstaller(aDirOrFile)](#_91dc1d163ef487ac0b0e244eeb607e567d099fe9d37232ba7101a3cfe93b146b) | 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()](#_0a058992016473640e8562e7fc4bdebb1647f410ab4561aefc2919dbc304c06b) | Reduces all source files to an object, keyed by filename |
|  [rxExecuteCli(aPkgDir, aArgs, aLogSvc)](#_66b34f54be6a8bf709ce7cf2b17f20b8086902858fc773252947742f530095c2) | 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)](#_3352d23b9911a6c464b3603942e1e1c23ce4986450ac1933dadae66ff2fd0e39) | 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)](#_aa1cacf1be8c830c109c49b5521f8fbf77063114402c9a2c44b1d6dc134d109e) | Executes wchtools. If we can find wchtools in the path, use that version, else use npx to install and run it. |
|  [rxFindAngularJson(aRootDir)](#_d39128bc164a8cfefa087d9b5f75ed4639df09ffb49b762dacb0f9b54ef400c4) | Locates the angular configuration file, next to the package json file |
|  [rxFindAngularVersion(aRootDir)](#_20b980543e3e94c78a04e19da84bb22855f258cd56571b7d41230e280e727458) | Locates the version of angular to use |
|  [rxFindAuthoringLayoutMappings(aRoot)](#_716538cad0ec2d41296f4db3331a42f68d6fc3a7420a79f3eaf0816a80c99a23) | Reads the authoring layouts from a directory |
|  [rxFindAuthoringLayouts(aRoot)](#_673c11baf2942ef4abb31113ae1050badaa23d3d17347177ff8070b4265f35b6) | Reads the authoring layouts from a directory |
|  [rxFindAuthoringTypes(aRoot)](#_f07a1ac255a048763331f4e8eb62b6770ba91bc7348e8092159699742b599c62) | Reads the authoring types from a directory |
|  [rxFindDataDir(aDirOrFile)](#_cd5217676bf90127d66f06554fc770e2cfec3ba68a789f0a19ceb9645f5bdb83) | Locates the data directory |
|  [rxFindPackageJson(aDirOrFile)](#_5d88feeef58959c1be2f2211290cc285c2b84194f7ec1a7ebb89f519ede98dc7) | Locates the package json relative to the given directory |
|  [rxFindPackageManager(aDirOrFile)](#_7b01e5f272adbfc8e61f4f986d2af92131a4e685261f4016230813521cd1fe33) | Locates the configured package manager |
|  [rxFindScript(aName, aRoot)](#_641590bab1da75af976c472c3cfe5879c6a3e9b42930ef30f5261668aa835e7f) | Locates the executable script command |
|  [rxFindSdkVersion(aRootDir)](#_9c70c55de787696b1dae1c2ff0deda183e3c93015d0425f39bee429370dceeec) | Locates the version of the SDK to use, either from the package JSON or from our own build |
|  [rxGetSourceFolder(aAngularJson, aProject)](#_5607f453ae598b1ac96e9ab6bb5c8aea4dbb5918a9e34657fa805335b4347865) | Returns the source folder for the angular application |
|  [rxReadAngularJson(aRootDir)](#_8b2e508e9b0d864a37334cd9db659ce806703f891a9b42da2789fbd0867c869c) | Reads the angular configuration file, next to the package json file |
|  [rxReadAuthoringLayoutMappings(aRoot)](#_784b121df5bd9f728d253cea2d00b91023701afbb90dd742776155cd53105db5) | Reads the authoring layouts from a directory |
|  [rxReadAuthoringLayouts(aRoot)](#_c7d8555fefcdee48ffbb28f324a5a53d79652f0d7ff9b58210cfd0e7675725dd) | Reads the authoring layouts from a directory |
|  [rxReadAuthoringTypes(aRoot)](#_374b199b785e0fcae30b6ae9071e0447c988b8ea74493cd502434d3b9bbeb756) | Reads the authoring types from a directory |
|  [rxReadPackageJson(aDirOrFile)](#_3a182264f894487a677d1301889ee0a3ae9b1f1debd0795e4cf945aaa387763f) | Locates and reads the package json |
|  [rxReadSourceFiles(aRoot)](#_37ffe30536b33d5cdc39bc0ed6e2f9c533ea35cc564289aae450888b487014a7) | Reads all typescript files |
|  [rxReadWchToolsOptions(aOptionsDir)](#_18752a46e1930675d4a46fbae62281e4112c16d4371b7a9ef4f2ca46e616726e) | Reads the wchtools options object |
|  [rxVerifyPreRequisites(aPrereq, aRootDir)](#_ea42af1ac5b6250e7d5708b6d47d5f9e612cde4157e5ac69235910c6b623da73) | Verifies if the installed prerequisites meet the requirements. |
|  [rxWchToolsGetCredentials(aApiUrl)](#_309c397aacaef5125dd7793df43ef7c3124249a7a68a8a7012eaf3005caf771a) | Reads the wch credentials from the given API URL |
|  [rxWriteJsonEntryMap(aMap)](#_14de81c6aef3d75621866aace8eae8964d18e8852124df9579c0d7c523f0e9b0) | Persists the entries in the map |
|  [rxWriteWchToolsOptions(aOptionsDir, aOptions)](#_f214d0e914022cf00065e58dc006ec2a1ca7dbe03ed734a61aedf8f7a7ed5c9a) | Reads the wchtools options object |
|  [sdkVersionFromAngularVersion(aAngularVersion)](#_45f79baa318e92518734e0d8f8c019a6dbc09b270cbd06e139e32850fe29f797) | Returns the SDK version from the Angular version |

## Interfaces

|  Interface | Description |
|  --- | --- |
|  [JsonEntry](#_a148fe5d0ff2993473bbeb2360d6d57f5da4bec99ee13a17e345dff6812e5747) |  |

## Variables

|  Variable | Description |
|  --- | --- |
|  [VERSION](#_f1e9d499dea755f7d965e020951cd39c4967d29149e0113bb3966cf0845919f8) | Exports the current version object |

## Type Aliases

|  Type Alias | Description |
|  --- | --- |
|  [AuthoringLayoutMap](#_3d7711df88a1c153fdffcdd53cabff2572d0d9d57c49056649899bae1a0e6252) | Mapping from type id to json record for authoring layouts |
|  [AuthoringLayoutMappingMap](#_623d73a76a9fe70e450b31a5a9a0ef8c8a409d6a154e602fb8a5ec81f75df5da) | Mapping from type id to json record for authoring layout mappings |
|  [AuthoringTypeMap](#_1161e0bbf68bad5b3c9eb78d37c0c043240271ff90468913b5103468abf17661) | Mapping from type id to json record for authoring types |
|  [JsonEntryMap](#_b6f44bd4f1563f41e99971f5b738739549ec34288252d7fcd38442bcb4163281) |  |
|  [PreRequisites](#_2b36dd9c6fe5e5d3e8d9680e59c9406c47af320802404b49cd331e36024ee95a) | Prerequisites as module name to string |


<a name="_07fc3e3f0a90e5b4ec028dbdbbcb2ae68d690cf82df3975bd8efb74f0c36ba69"></a>

<a name="_78ce36dce377c861d5b16530498c7929e8dfe2a0b657e671c36d2419d7f7a351"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [PACKAGE\_INSTALL](#_78ce36dce377c861d5b16530498c7929e8dfe2a0b657e671c36d2419d7f7a351)

## PACKAGE\_INSTALL enum

<b>Signature:</b>

```typescript
export declare enum PACKAGE_INSTALL 
```

## Enumeration Members

|  Member | Value | Description |
|  --- | --- | --- |
|  DEPENDENCIES | <code>0</code> |  |
|  DEV\_DEPENDENCIES | <code>1</code> |  |
|  GLOBAL | <code>2</code> |  |


<a name="_ac23f68695bebd15c88420d07c3a981611116eb85567fee048f2150562d74c19"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [addLayoutToMapping](#_ac23f68695bebd15c88420d07c3a981611116eb85567fee048f2150562d74c19)

## addLayoutToMapping() function

Adds a layout to a layout mapping entry, inplace

<b>Signature:</b>

```typescript
export declare function addLayoutToMapping(aLayoutMapping: AuthoringLayoutMapping, aLayout: AuthoringLayout): AuthoringLayoutMapping;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aLayoutMapping | <code>AuthoringLayoutMapping</code> | the layout mapping entry |
|  aLayout | <code>AuthoringLayout</code> | the layout |

<b>Returns:</b>

`AuthoringLayoutMapping`

the mapping


<a name="_c780051eeb735599192311e06cc722a456058a5afccfcb23f735313c05d023c4"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [assertIsValidCredentials](#_c780051eeb735599192311e06cc722a456058a5afccfcb23f735313c05d023c4)

## assertIsValidCredentials() function

Tests if the given value is a valid Credentials object

<b>Signature:</b>

```typescript
export declare function assertIsValidCredentials(aValue: any, aName?: string): Credentials;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aValue | <code>any</code> | the value to check |
|  aName | <code>string</code> | optional name of the field we check |

<b>Returns:</b>

`Credentials`

the value


<a name="_d20342a194b3a0ddff7420e8072caf779d292a522ed29b376875a0eafdb854fb"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [assertIsValidPassword](#_d20342a194b3a0ddff7420e8072caf779d292a522ed29b376875a0eafdb854fb)

## assertIsValidPassword() function

Tests if the given value is a valid password, throws if not.

<b>Signature:</b>

```typescript
export declare function assertIsValidPassword(aValue: any, aName?: string): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aValue | <code>any</code> | the value to check |
|  aName | <code>string</code> | optional name of the field we check |

<b>Returns:</b>

`string`

the value


<a name="_88cb579e70426671fc7efdaf198d0634be8128d4d4104e114fb95439b687b5f0"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [assertIsValidProjectName](#_88cb579e70426671fc7efdaf198d0634be8128d4d4104e114fb95439b687b5f0)

## assertIsValidProjectName() function

Tests if the given value is a valid project name

<b>Signature:</b>

```typescript
export declare function assertIsValidProjectName(aValue: any, aName?: string): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aValue | <code>any</code> | the value to check |
|  aName | <code>string</code> | optional name of the field we check |

<b>Returns:</b>

`string`

the value


<a name="_df873b145a67f966502d4b596c5d5f3364d9cf3b9ffe7b65edc0a5f183db3300"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [assertIsValidUrl](#_df873b145a67f966502d4b596c5d5f3364d9cf3b9ffe7b65edc0a5f183db3300)

## assertIsValidUrl() function

Tests if the given value is a valid url, throws if not.

<b>Signature:</b>

```typescript
export declare function assertIsValidUrl(aValue: any, aName?: string): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aValue | <code>any</code> | the value to check |
|  aName | <code>string</code> | optional name of the field we check |

<b>Returns:</b>

`string`

the value


<a name="_66891eaa5b5615d01247bce0cbefca2ff7a1d6b9c75a31083f8317efe5de8723"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [assertIsValidUserName](#_66891eaa5b5615d01247bce0cbefca2ff7a1d6b9c75a31083f8317efe5de8723)

## assertIsValidUserName() function

Tests if the given value is a valid user name, throws if not.

<b>Signature:</b>

```typescript
export declare function assertIsValidUserName(aValue: any, aName?: string): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aValue | <code>any</code> | the value to check |
|  aName | <code>string</code> | optional name of the field we check |

<b>Returns:</b>

`string`

the value


<a name="_92efe2b48452f8cdb2c14ef6234780e8a7af3342530ab8790bed235271a5fac5"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [assertIsValidWchToolsOptions](#_92efe2b48452f8cdb2c14ef6234780e8a7af3342530ab8790bed235271a5fac5)

## assertIsValidWchToolsOptions() function

Tests if the given value is a valid WchToolsOptions object

<b>Signature:</b>

```typescript
export declare function assertIsValidWchToolsOptions(aValue: any, aName?: string): WchToolsOptions;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aValue | <code>any</code> | the value to check |
|  aName | <code>string</code> | optional name of the field we check |

<b>Returns:</b>

`WchToolsOptions`

the value


<a name="_266a2742a46a9738ba202d2e35fee4554c7c7091450cc18570d9f0ac14d49e5d"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [blackWhiteList](#_266a2742a46a9738ba202d2e35fee4554c7c7091450cc18570d9f0ac14d49e5d)

## blackWhiteList() function

<b>Signature:</b>

```typescript
export declare function blackWhiteList(aInclude?: string[], aExclude?: string[]): Predicate<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aInclude | <code>string[]</code> |  |
|  aExclude | <code>string[]</code> |  |

<b>Returns:</b>

`Predicate<string>`


<a name="_f42d0d940f287b01fcebf2a5a4498655cf58b52b1c250cf28b1a96459c3434fd"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [canonicalizeJson](#_f42d0d940f287b01fcebf2a5a4498655cf58b52b1c250cf28b1a96459c3434fd)

## canonicalizeJson() function

Performs an inplace canonicalization of a JSON object

<b>Signature:</b>

```typescript
export declare function canonicalizeJson(aData: any): any;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aData | <code>any</code> | the JSON object |

<b>Returns:</b>

`any`

the canonicalized object


<a name="_a51dc7954faa64612b727541437dcf74596be17bd43938dcb2fe7f153d1a05a3"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [canTypeHaveLayout](#_a51dc7954faa64612b727541437dcf74596be17bd43938dcb2fe7f153d1a05a3)

## canTypeHaveLayout() function

Tests if an authoring type can have a layout

<b>Signature:</b>

```typescript
export declare function canTypeHaveLayout(aType: AuthoringType): boolean;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aType | <code>AuthoringType</code> | the type |

<b>Returns:</b>

`boolean`

true if the type can have a layout, else false


<a name="_2397cb9f1cddcd9eff24f92a3b2fd1e6507f6deea71076fd697fcdc2f15c216b"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [cmdCreateProject](#_2397cb9f1cddcd9eff24f92a3b2fd1e6507f6deea71076fd697fcdc2f15c216b)

## cmdCreateProject() function

Constructs a brand new angular project and adds the SDK to the project

<b>Signature:</b>

```typescript
export declare function cmdCreateProject(aRootFolder: string, aProjectName: string, aApiUrl: string): Observable<SpawnLine>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRootFolder | <code>string</code> | the root folder of the project |
|  aProjectName | <code>string</code> | the project name |
|  aApiUrl | <code>string</code> | the WCH API URL |

<b>Returns:</b>

`Observable<SpawnLine>`

an observable of the command output


<a name="_d32890fc1dc3af75a55bf499c001d582ac502cc5f158c9b2b8e492a37c68bca8"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [createGuid](#_d32890fc1dc3af75a55bf499c001d582ac502cc5f158c9b2b8e492a37c68bca8)

## createGuid() function

Constructs a GUID in a reproducible way from an ID

<b>Signature:</b>

```typescript
export declare function createGuid(aId: string, aSecret?: string): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aId | <code>string</code> | the original ID |
|  aSecret | <code>string</code> | some optional secret |

<b>Returns:</b>

`string`

the guid


<a name="_a5e86458317da824837e7956dac6c751afb5b73ada51c965de597afcbf887101"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [createTypePredicate](#_a5e86458317da824837e7956dac6c751afb5b73ada51c965de597afcbf887101)

## createTypePredicate() function

Creates a predicate that filters authoring types

<b>Signature:</b>

```typescript
export declare function createTypePredicate(aOptions: {
    include?: string[];
    exclude?: string[];
}): Predicate<AuthoringType>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aOptions | <code>{`<p/>`    include?: string[];`<p/>`    exclude?: string[];`<p/>`}</code> | black whitelist options |

<b>Returns:</b>

`Predicate<AuthoringType>`

the predicate


<a name="_eea8ed70e9a562a8f506df174f29ec44147e09b3a35e0c4f3bbaaf718f689144"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [findLayoutComponent](#_eea8ed70e9a562a8f506df174f29ec44147e09b3a35e0c4f3bbaaf718f689144)

## findLayoutComponent() function

Locates the layout component from the source file that represents the layout component declaration.

<b>Signature:</b>

```typescript
export declare function findLayoutComponent(aSource: SourceFile): ClassDeclaration;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aSource | <code>SourceFile</code> |  |

<b>Returns:</b>

`ClassDeclaration`


<a name="_6e3b00a7164b3d4c96f24f3092e9e079921ef6f195ef8ab02955689d15d39af3"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [findLayoutModule](#_6e3b00a7164b3d4c96f24f3092e9e079921ef6f195ef8ab02955689d15d39af3)

## findLayoutModule() function

Returns a finder for layout modules

<b>Signature:</b>

```typescript
export declare function findLayoutModule(aLayoutClasses: Record<string, ClassDeclaration>): UnaryFunction<SourceFile, ClassDeclaration>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aLayoutClasses | <code>Record&lt;string, ClassDeclaration&gt;</code> | record of classes |

<b>Returns:</b>

`UnaryFunction<SourceFile, ClassDeclaration>`

the finder


<a name="_fa411c1f5d1ebe568d2b0c128bec57bd954850cf6d86c1055e35629c0cfe8798"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [fromRegExp](#_fa411c1f5d1ebe568d2b0c128bec57bd954850cf6d86c1055e35629c0cfe8798)

## fromRegExp() function

Returns a regular expression tester from a sequence of expressions

<b>Signature:</b>

```typescript
export declare function fromRegExp(aRegexp?: RegExp[]): Predicate<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRegexp | <code>RegExp[]</code> | the expressions |

<b>Returns:</b>

`Predicate<string>`

the predicate


<a name="_8be817cb81d2089dfd20a8c22aba6d6bfe2901694f08bd48d92b71bc5cb41ae0"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [fromRegExpString](#_8be817cb81d2089dfd20a8c22aba6d6bfe2901694f08bd48d92b71bc5cb41ae0)

## fromRegExpString() function

<b>Signature:</b>

```typescript
export declare function fromRegExpString(aRegexp?: string[]): Predicate<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRegexp | <code>string[]</code> |  |

<b>Returns:</b>

`Predicate<string>`


<a name="_87df9a93a0d42b358e5e0274a71b81b5750142ca6689d13936a37237dc117860"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [getLayoutComponents](#_87df9a93a0d42b358e5e0274a71b81b5750142ca6689d13936a37237dc117860)

## getLayoutComponents() function

From these files extract all layout components

<b>Signature:</b>

```typescript
export declare function getLayoutComponents(aAllFiles: Record<string, SourceFile>): Record<string, ClassDeclaration>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aAllFiles | <code>Record&lt;string, SourceFile&gt;</code> |  |

<b>Returns:</b>

`Record<string, ClassDeclaration>`


<a name="_e8cec605c8a2844eb75e9233a5906921af5bea893268e084cec766934e427e70"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [getLayoutModules](#_e8cec605c8a2844eb75e9233a5906921af5bea893268e084cec766934e427e70)

## getLayoutModules() function

Locates the layout modules

<b>Signature:</b>

```typescript
export declare function getLayoutModules(aAllFiles: Record<string, SourceFile>, aLayoutClasses: Record<string, ClassDeclaration>): Record<string, ClassDeclaration>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aAllFiles | <code>Record&lt;string, SourceFile&gt;</code> | all source files |
|  aLayoutClasses | <code>Record&lt;string, ClassDeclaration&gt;</code> | the layout classes |

<b>Returns:</b>

`Record<string, ClassDeclaration>`

all modules that export the classes


<a name="_b040c1f2deccca2994bdc7f1e81e787be684f7c60b2e7ac9de9503aa00c96226"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [getLayoutSelector](#_b040c1f2deccca2994bdc7f1e81e787be684f7c60b2e7ac9de9503aa00c96226)

## getLayoutSelector() function

Returns the layout selector for the layout component

<b>Signature:</b>

```typescript
export declare function getLayoutSelector(aLayoutComponent: ClassDeclaration): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aLayoutComponent | <code>ClassDeclaration</code> | the layout component |

<b>Returns:</b>

`string`

the layout selector or undefined


<a name="_8d54c4cfb13e8bacb0cb295dcf65cf615529a4080a4b2baa40af3cb306d31516"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [getLayoutTemplate](#_8d54c4cfb13e8bacb0cb295dcf65cf615529a4080a4b2baa40af3cb306d31516)

## 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

<b>Signature:</b>

```typescript
export declare function getLayoutTemplate(aLayout: AuthoringLayout): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aLayout | <code>AuthoringLayout</code> | the layout |

<b>Returns:</b>

`string`

the template


<a name="_60f49a32ed2fc60fb6caafbd73726823a0c2a6e6b0b02eccdc63b2a3ccefef23"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [isValidProjectName](#_60f49a32ed2fc60fb6caafbd73726823a0c2a6e6b0b02eccdc63b2a3ccefef23)

## isValidProjectName() function

Validates project names for Angular projects

<b>Signature:</b>

```typescript
export declare function isValidProjectName(projectName: string): boolean;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  projectName | <code>string</code> | the project name |

<b>Returns:</b>

`boolean`

true if the project name is valid, else false


<a name="_749ca7a78f0519714fc2f1567248b5188a3f5a2b1be1ad8aa77a319fc7b20810"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [ngGetDefaultProject](#_749ca7a78f0519714fc2f1567248b5188a3f5a2b1be1ad8aa77a319fc7b20810)

## ngGetDefaultProject() function

Returns the default project, either the configured project or the first one

<b>Signature:</b>

```typescript
export declare function ngGetDefaultProject(aJson: any): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aJson | <code>any</code> | the angular json |

<b>Returns:</b>

`string`

the default project


<a name="_91dc1d163ef487ac0b0e244eeb607e567d099fe9d37232ba7101a3cfe93b146b"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [packageInstaller](#_91dc1d163ef487ac0b0e244eeb607e567d099fe9d37232ba7101a3cfe93b146b)

## 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

<b>Signature:</b>

```typescript
export declare function packageInstaller(aDirOrFile: string): (aType: PACKAGE_INSTALL, ...aPackages: string[]) => Observable<SpawnLine>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aDirOrFile | <code>string</code> | base directory |

<b>Returns:</b>

`(aType: PACKAGE_INSTALL, ...aPackages: string[]) => Observable<SpawnLine>`

an install callback


<a name="_0a058992016473640e8562e7fc4bdebb1647f410ab4561aefc2919dbc304c06b"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [reduceSourceFiles](#_0a058992016473640e8562e7fc4bdebb1647f410ab4561aefc2919dbc304c06b)

## reduceSourceFiles() function

Reduces all source files to an object, keyed by filename

<b>Signature:</b>

```typescript
export declare function reduceSourceFiles(): OperatorFunction<SourceFile, Record<string, SourceFile>>;
```
<b>Returns:</b>

`OperatorFunction<SourceFile, Record<string, SourceFile>>`

the reducer function


<a name="_66b34f54be6a8bf709ce7cf2b17f20b8086902858fc773252947742f530095c2"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxExecuteCli](#_66b34f54be6a8bf709ce7cf2b17f20b8086902858fc773252947742f530095c2)

## 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.

<b>Signature:</b>

```typescript
export declare function rxExecuteCli(aPkgDir: string, aArgs: string[], aLogSvc?: LoggerService): Observable<SpawnLine>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aPkgDir | <code>string</code> | the package directory, will be the execution directory |
|  aArgs | <code>string[]</code> | the arguments |
|  aLogSvc | <code>LoggerService</code> | the logger service |

<b>Returns:</b>

`Observable<SpawnLine>`

an observable with the output of the command


<a name="_3352d23b9911a6c464b3603942e1e1c23ce4986450ac1933dadae66ff2fd0e39"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxExecuteNg](#_3352d23b9911a6c464b3603942e1e1c23ce4986450ac1933dadae66ff2fd0e39)

## 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.

<b>Signature:</b>

```typescript
export declare function rxExecuteNg(aPkgDir: string, aArgs: string[], aLogSvc?: LoggerService): Observable<SpawnLine>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aPkgDir | <code>string</code> | the package directory, will be the execution directory |
|  aArgs | <code>string[]</code> | the arguments |
|  aLogSvc | <code>LoggerService</code> | the logger service |

<b>Returns:</b>

`Observable<SpawnLine>`

an observable with the output of the command


<a name="_aa1cacf1be8c830c109c49b5521f8fbf77063114402c9a2c44b1d6dc134d109e"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxExecuteWchTools](#_aa1cacf1be8c830c109c49b5521f8fbf77063114402c9a2c44b1d6dc134d109e)

## rxExecuteWchTools() function

Executes wchtools. If we can find wchtools in the path, use that version, else use npx to install and run it.

<b>Signature:</b>

```typescript
export declare function rxExecuteWchTools(aPkgDir: string, aArgs: string[], aLogSvc?: LoggerService): Observable<SpawnLine>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aPkgDir | <code>string</code> | the package directory, will be the execution directory |
|  aArgs | <code>string[]</code> | the arguments to wchtools |
|  aLogSvc | <code>LoggerService</code> | the logger service |

<b>Returns:</b>

`Observable<SpawnLine>`

an observable with the output of the command


<a name="_d39128bc164a8cfefa087d9b5f75ed4639df09ffb49b762dacb0f9b54ef400c4"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindAngularJson](#_d39128bc164a8cfefa087d9b5f75ed4639df09ffb49b762dacb0f9b54ef400c4)

## rxFindAngularJson() function

Locates the angular configuration file, next to the package json file

<b>Signature:</b>

```typescript
export declare function rxFindAngularJson(aRootDir: string): Observable<FileDescriptor>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRootDir | <code>string</code> | the starting directory |

<b>Returns:</b>

`Observable<FileDescriptor>`

the angular JSON file


<a name="_20b980543e3e94c78a04e19da84bb22855f258cd56571b7d41230e280e727458"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindAngularVersion](#_20b980543e3e94c78a04e19da84bb22855f258cd56571b7d41230e280e727458)

## rxFindAngularVersion() function

Locates the version of angular to use

<b>Signature:</b>

```typescript
export declare function rxFindAngularVersion(aRootDir: string): Observable<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRootDir | <code>string</code> | the root directory used to locate the packae |

<b>Returns:</b>

`Observable<string>`

the angular version as a semantic version string


<a name="_716538cad0ec2d41296f4db3331a42f68d6fc3a7420a79f3eaf0816a80c99a23"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindAuthoringLayoutMappings](#_716538cad0ec2d41296f4db3331a42f68d6fc3a7420a79f3eaf0816a80c99a23)

## rxFindAuthoringLayoutMappings() function

Reads the authoring layouts from a directory

<b>Signature:</b>

```typescript
export declare function rxFindAuthoringLayoutMappings(aRoot: string): Observable<JsonEntry<AuthoringLayoutMapping>>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRoot | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<JsonEntry<AuthoringLayoutMapping>>`

the result


<a name="_673c11baf2942ef4abb31113ae1050badaa23d3d17347177ff8070b4265f35b6"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindAuthoringLayouts](#_673c11baf2942ef4abb31113ae1050badaa23d3d17347177ff8070b4265f35b6)

## rxFindAuthoringLayouts() function

Reads the authoring layouts from a directory

<b>Signature:</b>

```typescript
export declare function rxFindAuthoringLayouts(aRoot: string): Observable<JsonEntry<AuthoringLayout>>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRoot | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<JsonEntry<AuthoringLayout>>`

the result


<a name="_f07a1ac255a048763331f4e8eb62b6770ba91bc7348e8092159699742b599c62"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindAuthoringTypes](#_f07a1ac255a048763331f4e8eb62b6770ba91bc7348e8092159699742b599c62)

## rxFindAuthoringTypes() function

Reads the authoring types from a directory

<b>Signature:</b>

```typescript
export declare function rxFindAuthoringTypes(aRoot: string): Observable<JsonFile<AuthoringType>>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRoot | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<JsonFile<AuthoringType>>`

the result


<a name="_cd5217676bf90127d66f06554fc770e2cfec3ba68a789f0a19ceb9645f5bdb83"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindDataDir](#_cd5217676bf90127d66f06554fc770e2cfec3ba68a789f0a19ceb9645f5bdb83)

## rxFindDataDir() function

Locates the data directory

<b>Signature:</b>

```typescript
export declare function rxFindDataDir(aDirOrFile: string): Observable<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aDirOrFile | <code>string</code> | root path or file to search from |

<b>Returns:</b>

`Observable<string>`

the data path


<a name="_5d88feeef58959c1be2f2211290cc285c2b84194f7ec1a7ebb89f519ede98dc7"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindPackageJson](#_5d88feeef58959c1be2f2211290cc285c2b84194f7ec1a7ebb89f519ede98dc7)

## rxFindPackageJson() function

Locates the package json relative to the given directory

<b>Signature:</b>

```typescript
export declare function rxFindPackageJson(aDirOrFile: string): Observable<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aDirOrFile | <code>string</code> | the starting directory or the name of the package json or the name of a package json |

<b>Returns:</b>

`Observable<string>`

the name of the package json or an error


<a name="_7b01e5f272adbfc8e61f4f986d2af92131a4e685261f4016230813521cd1fe33"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindPackageManager](#_7b01e5f272adbfc8e61f4f986d2af92131a4e685261f4016230813521cd1fe33)

## rxFindPackageManager() function

Locates the configured package manager

<b>Signature:</b>

```typescript
export declare function rxFindPackageManager(aDirOrFile: string): Observable<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aDirOrFile | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<string>`

the package manager to use


<a name="_641590bab1da75af976c472c3cfe5879c6a3e9b42930ef30f5261668aa835e7f"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindScript](#_641590bab1da75af976c472c3cfe5879c6a3e9b42930ef30f5261668aa835e7f)

## rxFindScript() function

Locates the executable script command

<b>Signature:</b>

```typescript
export declare function rxFindScript(aName: string, aRoot?: string): Observable<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aName | <code>string</code> | name of the script |
|  aRoot | <code>string</code> | optionally a root to identify the project to seach in |

<b>Returns:</b>

`Observable<string>`

the full path to the executable script


<a name="_9c70c55de787696b1dae1c2ff0deda183e3c93015d0425f39bee429370dceeec"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxFindSdkVersion](#_9c70c55de787696b1dae1c2ff0deda183e3c93015d0425f39bee429370dceeec)

## rxFindSdkVersion() function

Locates the version of the SDK to use, either from the package JSON or from our own build

<b>Signature:</b>

```typescript
export declare function rxFindSdkVersion(aRootDir: string): Observable<string>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRootDir | <code>string</code> | the root directory used to locate the packae |

<b>Returns:</b>

`Observable<string>`

the SDK version as a semantic version string


<a name="_5607f453ae598b1ac96e9ab6bb5c8aea4dbb5918a9e34657fa805335b4347865"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxGetSourceFolder](#_5607f453ae598b1ac96e9ab6bb5c8aea4dbb5918a9e34657fa805335b4347865)

## rxGetSourceFolder() function

Returns the source folder for the angular application

<b>Signature:</b>

```typescript
export declare function rxGetSourceFolder(aAngularJson: JsonFile<any>, aProject?: string): Observable<FileDescriptor>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aAngularJson | <code>JsonFile&lt;any&gt;</code> | the angular JSON file |
|  aProject | <code>string</code> | optionally the project, otherwise use the default project |

<b>Returns:</b>

`Observable<FileDescriptor>`

the source folder from that file


<a name="_8b2e508e9b0d864a37334cd9db659ce806703f891a9b42da2789fbd0867c869c"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxReadAngularJson](#_8b2e508e9b0d864a37334cd9db659ce806703f891a9b42da2789fbd0867c869c)

## rxReadAngularJson() function

Reads the angular configuration file, next to the package json file

<b>Signature:</b>

```typescript
export declare function rxReadAngularJson(aRootDir: string): Observable<JsonFile<any>>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRootDir | <code>string</code> | the starting directory |

<b>Returns:</b>

`Observable<JsonFile<any>>`

the angular JSON file


<a name="_784b121df5bd9f728d253cea2d00b91023701afbb90dd742776155cd53105db5"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxReadAuthoringLayoutMappings](#_784b121df5bd9f728d253cea2d00b91023701afbb90dd742776155cd53105db5)

## rxReadAuthoringLayoutMappings() function

Reads the authoring layouts from a directory

<b>Signature:</b>

```typescript
export declare function rxReadAuthoringLayoutMappings(aRoot: string): Observable<AuthoringLayoutMappingMap>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRoot | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<AuthoringLayoutMappingMap>`

the result


<a name="_c7d8555fefcdee48ffbb28f324a5a53d79652f0d7ff9b58210cfd0e7675725dd"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxReadAuthoringLayouts](#_c7d8555fefcdee48ffbb28f324a5a53d79652f0d7ff9b58210cfd0e7675725dd)

## rxReadAuthoringLayouts() function

Reads the authoring layouts from a directory

<b>Signature:</b>

```typescript
export declare function rxReadAuthoringLayouts(aRoot: string): Observable<AuthoringLayoutMap>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRoot | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<AuthoringLayoutMap>`

the result


<a name="_374b199b785e0fcae30b6ae9071e0447c988b8ea74493cd502434d3b9bbeb756"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxReadAuthoringTypes](#_374b199b785e0fcae30b6ae9071e0447c988b8ea74493cd502434d3b9bbeb756)

## rxReadAuthoringTypes() function

Reads the authoring types from a directory

<b>Signature:</b>

```typescript
export declare function rxReadAuthoringTypes(aRoot: string): Observable<AuthoringTypeMap>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRoot | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<AuthoringTypeMap>`

the result


<a name="_3a182264f894487a677d1301889ee0a3ae9b1f1debd0795e4cf945aaa387763f"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxReadPackageJson](#_3a182264f894487a677d1301889ee0a3ae9b1f1debd0795e4cf945aaa387763f)

## rxReadPackageJson() function

Locates and reads the package json

<b>Signature:</b>

```typescript
export declare function rxReadPackageJson(aDirOrFile: string): Observable<any>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aDirOrFile | <code>string</code> | directory or file as a starting point |

<b>Returns:</b>

`Observable<any>`

the package


<a name="_37ffe30536b33d5cdc39bc0ed6e2f9c533ea35cc564289aae450888b487014a7"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxReadSourceFiles](#_37ffe30536b33d5cdc39bc0ed6e2f9c533ea35cc564289aae450888b487014a7)

## rxReadSourceFiles() function

Reads all typescript files

<b>Signature:</b>

```typescript
export declare function rxReadSourceFiles(aRoot: string): Observable<SourceFile>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aRoot | <code>string</code> | root of the source files |

<b>Returns:</b>

`Observable<SourceFile>`

an observable of the source files


<a name="_18752a46e1930675d4a46fbae62281e4112c16d4371b7a9ef4f2ca46e616726e"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxReadWchToolsOptions](#_18752a46e1930675d4a46fbae62281e4112c16d4371b7a9ef4f2ca46e616726e)

## rxReadWchToolsOptions() function

Reads the wchtools options object

<b>Signature:</b>

```typescript
export declare function rxReadWchToolsOptions(aOptionsDir: string): Observable<WchToolsOptions>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aOptionsDir | <code>string</code> | the options directory |

<b>Returns:</b>

`Observable<WchToolsOptions>`

the options


<a name="_ea42af1ac5b6250e7d5708b6d47d5f9e612cde4157e5ac69235910c6b623da73"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxVerifyPreRequisites](#_ea42af1ac5b6250e7d5708b6d47d5f9e612cde4157e5ac69235910c6b623da73)

## rxVerifyPreRequisites() function

Verifies if the installed prerequisites meet the requirements.

<b>Signature:</b>

```typescript
export declare function rxVerifyPreRequisites(aPrereq: PreRequisites, aRootDir: string): Observable<PreRequisites>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aPrereq | <code>PreRequisites</code> | required prerequisites |
|  aRootDir | <code>string</code> | root directory |

<b>Returns:</b>

`Observable<PreRequisites>`

the missing prerequisites from the input or the empty object


<a name="_309c397aacaef5125dd7793df43ef7c3124249a7a68a8a7012eaf3005caf771a"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxWchToolsGetCredentials](#_309c397aacaef5125dd7793df43ef7c3124249a7a68a8a7012eaf3005caf771a)

## rxWchToolsGetCredentials() function

Reads the wch credentials from the given API URL

<b>Signature:</b>

```typescript
export declare function rxWchToolsGetCredentials(aApiUrl: string): Observable<Credentials>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aApiUrl | <code>string</code> | the API URL |

<b>Returns:</b>

`Observable<Credentials>`

the attached credentials


<a name="_14de81c6aef3d75621866aace8eae8964d18e8852124df9579c0d7c523f0e9b0"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxWriteJsonEntryMap](#_14de81c6aef3d75621866aace8eae8964d18e8852124df9579c0d7c523f0e9b0)

## rxWriteJsonEntryMap() function

Persists the entries in the map

<b>Signature:</b>

```typescript
export declare function rxWriteJsonEntryMap<T>(aMap: JsonEntryMap<T>): Observable<JsonEntry<T>>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aMap | <code>JsonEntryMap&lt;T&gt;</code> | the map to persist |

<b>Returns:</b>

`Observable<JsonEntry<T>>`

an observable stream of the persisted entries


<a name="_f214d0e914022cf00065e58dc006ec2a1ca7dbe03ed734a61aedf8f7a7ed5c9a"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [rxWriteWchToolsOptions](#_f214d0e914022cf00065e58dc006ec2a1ca7dbe03ed734a61aedf8f7a7ed5c9a)

## rxWriteWchToolsOptions() function

Reads the wchtools options object

<b>Signature:</b>

```typescript
export declare function rxWriteWchToolsOptions(aOptionsDir: string, aOptions: WchToolsOptions): Observable<WchToolsOptions>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aOptionsDir | <code>string</code> | the directory for the options |
|  aOptions | <code>WchToolsOptions</code> | the new options to write |

<b>Returns:</b>

`Observable<WchToolsOptions>`

the written options


<a name="_45f79baa318e92518734e0d8f8c019a6dbc09b270cbd06e139e32850fe29f797"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [sdkVersionFromAngularVersion](#_45f79baa318e92518734e0d8f8c019a6dbc09b270cbd06e139e32850fe29f797)

## sdkVersionFromAngularVersion() function

Returns the SDK version from the Angular version

<b>Signature:</b>

```typescript
export declare function sdkVersionFromAngularVersion(aAngularVersion: string): string;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  aAngularVersion | <code>string</code> | the angular version string |

<b>Returns:</b>

`string`

the matching SDK version string


<a name="_a148fe5d0ff2993473bbeb2360d6d57f5da4bec99ee13a17e345dff6812e5747"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [JsonEntry](#_a148fe5d0ff2993473bbeb2360d6d57f5da4bec99ee13a17e345dff6812e5747)

## JsonEntry interface

<b>Signature:</b>

```typescript
export interface JsonEntry<T> extends JsonFile<T> 
```

## Properties

|  Property | Type | Description |
|  --- | --- | --- |
|  [id](#_c90819d74e851e06fa427ecaa543b59e52ddb4955436bf5dd54f6ae10125555d) | <code>string</code> |  |


<a name="_f1e9d499dea755f7d965e020951cd39c4967d29149e0113bb3966cf0845919f8"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [VERSION](#_f1e9d499dea755f7d965e020951cd39c4967d29149e0113bb3966cf0845919f8)

## VERSION variable

Exports the current version object

<b>Signature:</b>

```typescript
VERSION: import("@ibm-wch-sdk/api").WchSdkVersion
```

<a name="_3d7711df88a1c153fdffcdd53cabff2572d0d9d57c49056649899bae1a0e6252"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [AuthoringLayoutMap](#_3d7711df88a1c153fdffcdd53cabff2572d0d9d57c49056649899bae1a0e6252)

## AuthoringLayoutMap type

Mapping from type id to json record for authoring layouts

<b>Signature:</b>

```typescript
export declare type AuthoringLayoutMap = JsonEntryMap<AuthoringLayout>;
```

<a name="_623d73a76a9fe70e450b31a5a9a0ef8c8a409d6a154e602fb8a5ec81f75df5da"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [AuthoringLayoutMappingMap](#_623d73a76a9fe70e450b31a5a9a0ef8c8a409d6a154e602fb8a5ec81f75df5da)

## AuthoringLayoutMappingMap type

Mapping from type id to json record for authoring layout mappings

<b>Signature:</b>

```typescript
export declare type AuthoringLayoutMappingMap = JsonEntryMap<AuthoringLayoutMapping>;
```

<a name="_1161e0bbf68bad5b3c9eb78d37c0c043240271ff90468913b5103468abf17661"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [AuthoringTypeMap](#_1161e0bbf68bad5b3c9eb78d37c0c043240271ff90468913b5103468abf17661)

## AuthoringTypeMap type

Mapping from type id to json record for authoring types

<b>Signature:</b>

```typescript
export declare type AuthoringTypeMap = JsonEntryMap<AuthoringType>;
```

<a name="_b6f44bd4f1563f41e99971f5b738739549ec34288252d7fcd38442bcb4163281"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [JsonEntryMap](#_b6f44bd4f1563f41e99971f5b738739549ec34288252d7fcd38442bcb4163281)

## JsonEntryMap type

<b>Signature:</b>

```typescript
export declare type JsonEntryMap<T> = Record<string, JsonEntry<T>>;
```

<a name="_2b36dd9c6fe5e5d3e8d9680e59c9406c47af320802404b49cd331e36024ee95a"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [PreRequisites](#_2b36dd9c6fe5e5d3e8d9680e59c9406c47af320802404b49cd331e36024ee95a)

## PreRequisites type

Prerequisites as module name to string

<b>Signature:</b>

```typescript
export declare type PreRequisites = Record<string, string>;
```

<a name="_c90819d74e851e06fa427ecaa543b59e52ddb4955436bf5dd54f6ae10125555d"></a>
[Home](#_d837eb3ec467224a00ff0d876976048b03dc62da28da3ca80d944b4f7649ea9a) &gt; [@ibm-wch-sdk/cli-utils](#_b65a5a41abfd560bd3139ef5eca39869738c722d09ec555183cb3968a410a59a) &gt; [JsonEntry](#_a148fe5d0ff2993473bbeb2360d6d57f5da4bec99ee13a17e345dff6812e5747) &gt; [id](#_c90819d74e851e06fa427ecaa543b59e52ddb4955436bf5dd54f6ae10125555d)

## JsonEntry.id property

<b>Signature:</b>

```typescript
id: string;
```