## Classes

<dl>
<dt><a href="#Config">Config</a></dt>
<dd></dd>
</dl>

## Functions

<dl>
<dt><a href="#inspectPath">inspectPath([options])</a> ⇒ <code><a href="#PathInfo">PathInfo</a></code></dt>
<dd><p>Returns information about the file or directory being loaded.</p>
</dd>
<dt><a href="#loadConfig">loadConfig([baseDir], [options])</a> ⇒ <code><a href="#Config">Config</a></code></dt>
<dd><p>Load config info. If within a supported project, also load project configuration.</p>
</dd>
<dt><a href="#loadProject">loadProject(basePath)</a> ⇒ <code><a href="#Artifacts">Promise.&lt;Artifacts&gt;</a></code></dt>
<dd><p>Given a file or directory path, return all product and swagger files found in that path.
If the path is a known project, uses project local <code>artifacts</code> configuration to try to resolve
product/swagger information.</p>
</dd>
</dl>

## Typedefs

<dl>
<dt><a href="#PathInfo">PathInfo</a> : <code>Object</code></dt>
<dd></dd>
<dt><a href="#Artifact">Artifact</a> : <code>Object</code></dt>
<dd></dd>
<dt><a href="#Artifacts">Artifacts</a> : <code><a href="#Artifact">Array.&lt;Artifact&gt;</a></code></dt>
<dd></dd>
</dl>

<a name="Config"></a>
## Config
**Kind**: global class  

* [Config](#Config)
    * _instance_
        * [.set(key/value, store)](#Config+set)
        * [.get(key, [store])](#Config+get) ⇒ <code>string</code> &#124; <code>object</code>
        * [.getOne(key, [store])](#Config+getOne) ⇒ <code>string</code> &#124; <code>object</code>
        * [.delete(key, store)](#Config+delete)
    * _static_
        * [.PROJECT_STORE](#Config.PROJECT_STORE) : <code>Store</code>
        * [.USER_STORE](#Config.USER_STORE) : <code>Store</code>
        * [.TOKEN_STORE](#Config.TOKEN_STORE) : <code>Store</code>

<a name="Config+set"></a>
### config.set(key/value, store)
Set config values.

**Kind**: instance method of <code>[Config](#Config)</code>  

| Param | Type | Description |
| --- | --- | --- |
| key/value | <code>object</code> | pairs to store. |
| store | <code>Store</code> | What level (project/common) to store the data for. |

<a name="Config+get"></a>
### config.get(key, [store]) ⇒ <code>string</code> &#124; <code>object</code>
Get config values.

**Kind**: instance method of <code>[Config](#Config)</code>  
**Returns**: <code>string</code> &#124; <code>object</code> - The value stored for keys matching the parameter passed in. If a URI and [Config](#Config) was
not setup with `shouldParseUris=false`, then parses the URI and returns an object with mapped values.  

| Param | Type | Description |
| --- | --- | --- |
| key | <code>string</code> &#124; <code>RegExp</code> | to look up. |
| [store] | <code>Store</code> | What level (project/common) to loopkup the value. Defaults to global value unless project level override was set. |

<a name="Config+getOne"></a>
### config.getOne(key, [store]) ⇒ <code>string</code> &#124; <code>object</code>
Similar to [get](#Config+get) but searches for an exact match.

**Kind**: instance method of <code>[Config](#Config)</code>  
**Returns**: <code>string</code> &#124; <code>object</code> - The value stored for keys matching the parameter passed in. If a URI and [Config](#Config) was
not setup with `shouldParseUris=false`, then parses the URI and returns an object with mapped values.  

| Param | Type | Description |
| --- | --- | --- |
| key | <code>string</code> | to look up. |
| [store] | <code>Store</code> | What level (project/common) to loopkup the value. Defaults to global value unless project level override was set. |

<a name="Config+delete"></a>
### config.delete(key, store)
Delete config values.

**Kind**: instance method of <code>[Config](#Config)</code>  

| Param | Type | Description |
| --- | --- | --- |
| key | <code>object</code> | to delete. |
| store | <code>Store</code> | What level (project/common) to delete the data from. |

<a name="Config.PROJECT_STORE"></a>
### Config.PROJECT_STORE : <code>Store</code>
Use when storing configuration for a specific project.

**Kind**: static constant of <code>[Config](#Config)</code>  
<a name="Config.USER_STORE"></a>
### Config.USER_STORE : <code>Store</code>
Use when storing configuration common to all projects.

**Kind**: static constant of <code>[Config](#Config)</code>  
<a name="Config.TOKEN_STORE"></a>
### Config.TOKEN_STORE : <code>Store</code>
Use when storing JWT tokens common to all projects.

**Kind**: static constant of <code>[Config](#Config)</code>  
<a name="inspectPath"></a>
## inspectPath([options]) ⇒ <code>[PathInfo](#PathInfo)</code>
Returns information about the file or directory being loaded.

**Kind**: global function  
**Returns**: <code>[PathInfo](#PathInfo)</code> - file/project information.  
**Throws**:

- Will throw an error if path is not a file or directory.


| Param | Type | Description |
| --- | --- | --- |
| searchPath. | <code>string</code> |  |
| [options] | <code>object</code> | options. |
| [options.incNodeProjects] | <code>boolean</code> | allow non-loopback node projects. |

<a name="loadConfig"></a>
## loadConfig([baseDir], [options]) ⇒ <code>[Config](#Config)</code>
Load config info. If within a supported project, also load project configuration.

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| [baseDir] | <code>string</code> | directory to load from. If not set, tried to load cwd. |
| [options] | <code>object</code> | config options. |
| [options.shouldParseUris] | <code>boolean</code> | Indicates if URIs in values should be parsed and returned as objects in |
| [options.loadFromEnv] | <code>boolean</code> | Indicated if process.env should also be searched when getting values. Env will override project and user level configuration. {@see Config@get} calls. |

<a name="loadProject"></a>
## loadProject(basePath) ⇒ <code>[Promise.&lt;Artifacts&gt;](#Artifacts)</code>
Given a file or directory path, return all product and swagger files found in that path.
If the path is a known project, uses project local `artifacts` configuration to try to resolve
product/swagger information.

**Kind**: global function  
**Throws**:

- Will throw an error if path is not a file or directory.


| Param | Type | Description |
| --- | --- | --- |
| basePath | <code>string</code> | Path to file or directory. |

<a name="PathInfo"></a>
## PathInfo : <code>Object</code>
**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| basePath | <code>string</code> | Resolved path to file or directory or project base dir. |
| type | <code>string</code> | `file`, `directory` or `project`. |
| projectType | <code>string</code> | Type of project. Currently only `loopback` is supported. |
| name | <code>string</code> | Project name. |
| version | <code>string</code> | Project version. |

<a name="Artifact"></a>
## Artifact : <code>Object</code>
**Kind**: global typedef  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| type | <code>string</code> | `product` or `swagger`. |
| filePath | <code>string</code> | Resolved path to product or swagger file. |
| refs | <code>[Artifacts](#Artifacts)</code> | List of resolved references in the product or swagger artifacts. |
| name | <code>string</code> |  |
| version | <code>string</code> |  |

<a name="Artifacts"></a>
## Artifacts : <code>[Array.&lt;Artifact&gt;](#Artifact)</code>
**Kind**: global typedef  
