UNPKG

@loopback/docs

Version:
2,001 lines (1,455 loc) 109 kB
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/code-themes/sl-theme.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">docs.strongloop.com</a> </div> <div id="modules"></div> </div> <div class="row"> <div class="col-lg-3 column scroll-spy-target"> <ul class="nav nav-pills nav-stacked"> <div id="versions"></div> <li class="depth-3"> <a href="#BootComponent">Class: BootComponent</a> </li> <li class="depth-4"> <a href="#BootComponent.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#BootComponent.prototype.booters">booters</a> </li> <li class="depth-3"> <a href="#BaseArtifactBooter">Class: BaseArtifactBooter</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.classes">classes</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.dirs">dirs</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.discovered">discovered</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.extensions">extensions</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.glob">glob</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.options">options</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.projectRoot">projectRoot</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.artifactName">&gt;artifactName</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.configure">configure()</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.discover">discover()</a> </li> <li class="depth-4"> <a href="#BaseArtifactBooter.prototype.load">load()</a> </li> <li class="depth-3"> <a href="#discoverFiles">discoverFiles()</a> </li> <li class="depth-3"> <a href="#isClass">isClass()</a> </li> <li class="depth-3"> <a href="#loadClassesFromFiles">loadClassesFromFiles()</a> </li> <li class="depth-3"> <a href="#ControllerBooter">Class: ControllerBooter</a> </li> <li class="depth-4"> <a href="#ControllerBooter.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#ControllerBooter.prototype.app">app</a> </li> <li class="depth-4"> <a href="#ControllerBooter.prototype.controllerConfig">controllerConfig</a> </li> <li class="depth-4"> <a href="#ControllerBooter.prototype.load">load()</a> </li> <li class="depth-3"> <a href="#ControllerDefaults">Object: ControllerDefaults</a> </li> <li class="depth-4"> <a href="#ControllerDefaults.dirs">dirs</a> </li> <li class="depth-4"> <a href="#ControllerDefaults.extensions">extensions</a> </li> <li class="depth-4"> <a href="#ControllerDefaults.nested">nested</a> </li> <li class="depth-3"> <a href="#DataSourceBooter">Class: DataSourceBooter</a> </li> <li class="depth-4"> <a href="#DataSourceBooter.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#DataSourceBooter.prototype.app">app</a> </li> <li class="depth-4"> <a href="#DataSourceBooter.prototype.datasourceConfig">datasourceConfig</a> </li> <li class="depth-4"> <a href="#DataSourceBooter.prototype.load">load()</a> </li> <li class="depth-3"> <a href="#DataSourceDefaults">Object: DataSourceDefaults</a> </li> <li class="depth-4"> <a href="#DataSourceDefaults.dirs">dirs</a> </li> <li class="depth-4"> <a href="#DataSourceDefaults.extensions">extensions</a> </li> <li class="depth-4"> <a href="#DataSourceDefaults.nested">nested</a> </li> <li class="depth-3"> <a href="#RepositoryBooter">Class: RepositoryBooter</a> </li> <li class="depth-4"> <a href="#RepositoryBooter.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#RepositoryBooter.prototype.app">app</a> </li> <li class="depth-4"> <a href="#RepositoryBooter.prototype.repositoryOptions">repositoryOptions</a> </li> <li class="depth-4"> <a href="#RepositoryBooter.prototype.load">load()</a> </li> <li class="depth-3"> <a href="#RepositoryDefaults">Object: RepositoryDefaults</a> </li> <li class="depth-4"> <a href="#RepositoryDefaults.dirs">dirs</a> </li> <li class="depth-4"> <a href="#RepositoryDefaults.extensions">extensions</a> </li> <li class="depth-4"> <a href="#RepositoryDefaults.nested">nested</a> </li> <li class="depth-3"> <a href="#ServiceBooter">Class: ServiceBooter</a> </li> <li class="depth-4"> <a href="#ServiceBooter.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#ServiceBooter.prototype.app">app</a> </li> <li class="depth-4"> <a href="#ServiceBooter.prototype.serviceConfig">serviceConfig</a> </li> <li class="depth-4"> <a href="#ServiceBooter.prototype.serviceProviders">serviceProviders</a> </li> <li class="depth-4"> <a href="#ServiceBooter.prototype.load">load()</a> </li> <li class="depth-3"> <a href="#ServiceDefaults">Object: ServiceDefaults</a> </li> <li class="depth-4"> <a href="#ServiceDefaults.dirs">dirs</a> </li> <li class="depth-4"> <a href="#ServiceDefaults.extensions">extensions</a> </li> <li class="depth-4"> <a href="#ServiceDefaults.nested">nested</a> </li> <li class="depth-3"> <a href="#Bootstrapper">Class: Bootstrapper</a> </li> <li class="depth-4"> <a href="#Bootstrapper.constructor">constructor()</a> </li> <li class="depth-4"> <a href="#Bootstrapper.prototype.boot">boot()</a> </li> <li class="depth-3"> <a href="#Bootable">Interface: Bootable</a> </li> <li class="depth-4"> <a href="#Bootable.prototype.bootOptions">bootOptions</a> </li> <li class="depth-4"> <a href="#Bootable.prototype.projectRoot">projectRoot</a> </li> <li class="depth-4"> <a href="#Bootable.prototype.boot">boot()</a> </li> <li class="depth-4"> <a href="#Bootable.prototype.booters">booters()</a> </li> <li class="depth-3"> <a href="#Booter">Interface: Booter</a> </li> <li class="depth-4"> <a href="#Booter.prototype.configure">configure()</a> </li> <li class="depth-4"> <a href="#Booter.prototype.discover">discover()</a> </li> <li class="depth-4"> <a href="#Booter.prototype.load">load()</a> </li> <li class="depth-3"> <a href="#ArtifactOptions">Type: ArtifactOptions</a> </li> <li class="depth-3"> <a href="#BootExecutionOptions">Type: BootExecutionOptions</a> </li> <li class="depth-3"> <a href="#BootOptions">Type: BootOptions</a> </li> <li class="depth-3"> <a href="#BOOTER_PHASES">BOOTER_PHASES</a> </li> <li class="depth-3"> <a href="#BootBindings">Namespace: BootBindings</a> </li> <li class="depth-4"> <a href="#BootBindings.BOOTER_PREFIX">BOOTER_PREFIX</a> </li> <li class="depth-4"> <a href="#BootBindings.BOOTER_TAG">BOOTER_TAG</a> </li> <li class="depth-4"> <a href="#BootBindings.BOOTSTRAPPER_KEY">BOOTSTRAPPER_KEY</a> </li> <li class="depth-4"> <a href="#BootBindings.BOOT_OPTIONS">BOOT_OPTIONS</a> </li> <li class="depth-4"> <a href="#BootBindings.PROJECT_ROOT">PROJECT_ROOT</a> </li> <li class="depth-3"> <a href="#BootMixin">BootMixin()</a> </li> <li class="depth-3"> <a href="#_bindBooter">_bindBooter()</a> </li> </ul> </div> <div class="col-lg-9 col-lg-offset-3 column" data-spy="scroll" data-target=".scroll-spy-target" data-offset="0"> <div class="readability"> <section class="code-doc "> <a name="BootComponent"></a> <h3 class="code-ref">Class: bootcomponent = new BootComponent()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>BootComponent is used to export the default list of Booter&#39;s made available by this module as well as bind the BootStrapper to the app so it can be used to run the Booters.</p> </p> <p></p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="BootComponent.prototype.booters"></a> <strong class="code-arg-name"> booters </strong> </td> <td class="code-arg-types"> <code>(<a href="#ControllerBooter">ControllerBooter</a> | <a href="#RepositoryBooter">RepositoryBooter</a> | <a href="#ServiceBooter">ServiceBooter</a> | <a href="#DataSourceBooter">DataSourceBooter</a>)[]</code> </td> <td class="code-arg-default-value"> [ ControllerBooter, RepositoryBooter, ServiceBooter, DataSourceBooter, ] </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>BootComponent is used to export the default list of Booter&#39;s made available by this module as well as bind the BootStrapper to the app so it can be used to run the Booters.</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="BootComponent.constructor"></a> <h4 class="code-ref">constructor(app: <a href="#Application">Application</a>) : <a href="#BootComponent">BootComponent</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> app </strong> </td> <td class="code-arg-types"> <code><a href="#Application">Application</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Application instance</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="BaseArtifactBooter"></a> <h3 class="code-ref">Class: baseartifactbooter = new BaseArtifactBooter()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="BaseArtifactBooter.prototype.classes"></a> <strong class="code-arg-name"> classes </strong> </td> <td class="code-arg-types"> <code><a href="#Array">Array</a>&lt;<a href="#Constructor">Constructor</a>&lt;<a href="#__type">__type</a>&gt;&gt;</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="BaseArtifactBooter.prototype.dirs"></a> <strong class="code-arg-name"> dirs </strong> </td> <td class="code-arg-types"> <code>string[]</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="BaseArtifactBooter.prototype.discovered"></a> <strong class="code-arg-name"> discovered </strong> </td> <td class="code-arg-types"> <code>string[]</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="BaseArtifactBooter.prototype.extensions"></a> <strong class="code-arg-name"> extensions </strong> </td> <td class="code-arg-types"> <code>string[]</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="BaseArtifactBooter.prototype.glob"></a> <strong class="code-arg-name"> glob </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="BaseArtifactBooter.prototype.options"></a> <strong class="code-arg-name"> options </strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Options being used by the Booter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="BaseArtifactBooter.prototype.projectRoot"></a> <strong class="code-arg-name"> projectRoot </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="BaseArtifactBooter.constructor"></a> <h4 class="code-ref">constructor(projectRoot: string, options: <a href="#ArtifactOptions">ArtifactOptions</a>) : <a href="#BaseArtifactBooter">BaseArtifactBooter</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> projectRoot </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> options </strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="BaseArtifactBooter.artifactName"></a> <h4 class="code-ref">artifactName() : string</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p>Get the name of the artifact loaded by this booter, e.g. "Controller". Subclasses can override the default logic based on the class name.</p> <p></p> </div> </section> <section class="code-doc "> <a name="BaseArtifactBooter.prototype.configure"></a> <h4 class="code-ref">configure() : <a href="#Promise">Promise</a>&lt;void&gt;</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Configure the Booter by initializing the &#39;dirs&#39;, &#39;extensions&#39; and &#39;glob&#39; properties.</p> </p> <p><p>NOTE: All properties are configured even if all aren&#39;t used.</p> </p> </div> </section> <section class="code-doc "> <a name="BaseArtifactBooter.prototype.discover"></a> <h4 class="code-ref">discover() : <a href="#Promise">Promise</a>&lt;void&gt;</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Discover files based on the &#39;glob&#39; property relative to the &#39;projectRoot&#39;. Discovered artifact files matching the pattern are saved to the &#39;discovered&#39; property.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="BaseArtifactBooter.prototype.load"></a> <h4 class="code-ref">load() : <a href="#Promise">Promise</a>&lt;void&gt;</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Filters the exports of &#39;discovered&#39; files to only be Classes (in case function / types are exported) as an artifact is a Class. The filtered artifact Classes are saved in the &#39;classes&#39; property.</p> </p> <p><p>NOTE: Booters extending this class should call this method (await super.load()) and then process the artifact classes as appropriate.</p> </p> </div> </section> <section class="code-doc "> <a name="discoverFiles"></a> <h3 class="code-ref">Function: discoverFiles</h3> <section class="code-doc "> <a name="discoverFiles"></a> <h4 class="code-ref">discoverFiles(pattern: string, root: string) : <a href="#Promise">Promise</a>&lt;string[]&gt;</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Returns all files matching the given glob pattern relative to root</p> </p> <p></p> </div> Returns: <p><p>Array of discovered files</p> </p> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> pattern </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>A glob pattern</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> root </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Root folder to start searching for matching files</p> </p> </div> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="isClass"></a> <h3 class="code-ref">Function: isClass</h3> <section class="code-doc "> <a name="isClass"></a> <h4 class="code-ref">isClass(target: any) : boolean</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Given a function, returns true if it is a class, false otherwise.</p> </p> <p></p> </div> Returns: <p><p>True if target is a class. False otherwise.</p> </p> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> target </strong> </td> <td class="code-arg-types"> <code>any</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>The function to check if it&#39;s a class or not.</p> </p> </div> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="loadClassesFromFiles"></a> <h3 class="code-ref">Function: loadClassesFromFiles</h3> <section class="code-doc "> <a name="loadClassesFromFiles"></a> <h4 class="code-ref">loadClassesFromFiles(files: string[], projectRootDir: string) : <a href="#Constructor">Constructor</a>&lt;<a href="#__type">__type</a>&gt;[]</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Returns an Array of Classes from given files. Works by requiring the file, identifying the exports from the file by getting the keys of the file and then testing each exported member to see if it&#39;s a class or not.</p> </p> <p></p> </div> Returns: <p><blockquote> <p>[]} An array of Class constructors from a file</p> </blockquote> </p> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> files </strong> </td> <td class="code-arg-types"> <code>string[]</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>An array of string of absolute file paths</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> projectRootDir </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="ControllerBooter"></a> <h3 class="code-ref">Class: controllerbooter = new ControllerBooter()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="ControllerBooter.prototype.app"></a> <strong class="code-arg-name"> app </strong> </td> <td class="code-arg-types"> <code><a href="#Application">Application</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> constructorProperty exported public </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="ControllerBooter.prototype.controllerConfig"></a> <strong class="code-arg-name"> controllerConfig </strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> constructorProperty exported public </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="ControllerBooter.constructor"></a> <h4 class="code-ref">constructor(app: <a href="#Application">Application</a>, projectRoot: string, controllerConfig: <a href="#ArtifactOptions">ArtifactOptions</a>) : <a href="#ControllerBooter">ControllerBooter</a></h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Parameters</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> app </strong> </td> <td class="code-arg-types"> <code><a href="#Application">Application</a></code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> projectRoot </strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-default-value"> </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name"> controllerConfig </strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-default-value"> {} </td> <td class="code-arg-flags"> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="ControllerBooter"></a> <h4 class="code-ref">artifactName() : string</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p>Get the name of the artifact loaded by this booter, e.g. "Controller". Subclasses can override the default logic based on the class name.</p> <p></p> </div> </section> <section class="code-doc "> <a name="ControllerBooter.prototype.load"></a> <h4 class="code-ref">load() : <a href="#Promise">Promise</a>&lt;void&gt;</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Uses super method to get a list of Artifact classes. Boot each class by binding it to the application using <code>app.controller(controller);</code>.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="ControllerDefaults"></a> <h3 class="code-ref">Object literal: ControllerDefaults</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Variables</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name="ControllerDefaults.dirs"></a> <strong class="code-arg-name"> dirs </strong> </td> <td class="code-arg-types"> <code>string[]</code> </td> <td class="code-arg-default-value"> ['controllers'] </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="ControllerDefaults.extensions"></a> <strong class="code-arg-name"> extensions </strong> </td> <td class="code-arg-types"> <code>string[]</code> </td> <td class="code-arg-default-value"> ['.controller.js'] </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name="ControllerDefaults.nested"></a> <strong class="code-arg-name"> nested </strong> </td> <td class="code-arg-types"> <code>true</code> </td> <td class="code-arg-default-value"> true </td> <td class="code-arg-flags"> exported </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="DataSourceBooter"></a> <h3 class="code-ref">Class: datasourcebooter = new DataSourceBooter()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;DataSource&#39; artifact type. Discovered DataSources are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </section> <section class="code-doc"> <!-- A table of members such as parameters/properties/variables --> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-default-value">Default Value</th> <th class="hdr-flags">Flags</th> <th class="hdr-desc">Description</th> </tr> <tr class="code