@breautek/storm 8.6.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Application.html +37 -38
- package/docs/classes/ConfigLoader.html +3 -3
- package/docs/classes/Database.html +2 -2
- package/docs/classes/DatabaseCastObject.html +2 -2
- package/docs/classes/DatabaseConnection.html +24 -21
- package/docs/classes/DatabaseQueryError.html +30 -9
- package/docs/classes/DeadLockError.html +30 -9
- package/docs/classes/DiskSpaceError.html +29 -8
- package/docs/classes/DropTemporaryTableQuery.html +7 -7
- package/docs/classes/DuplicateEntryError.html +29 -8
- package/docs/classes/EntityNotFoundError.html +29 -8
- package/docs/classes/ExpiredTokenError.html +29 -8
- package/docs/classes/Handler.html +4 -4
- package/docs/classes/InternalError.html +29 -8
- package/docs/classes/InvalidCredentialsError.html +29 -8
- package/docs/classes/InvalidValueError.html +29 -8
- package/docs/classes/LineString.html +2 -2
- package/docs/classes/LockWaitTimeoutError.html +30 -9
- package/docs/classes/ManagedDatabaseConnection.html +8 -5
- package/docs/classes/Middleware.html +5 -4
- package/docs/classes/MissingConfigError.html +29 -8
- package/docs/classes/MissingParameterError.html +29 -8
- package/docs/classes/MySQLConnection.html +27 -22
- package/docs/classes/MySQLDatabase.html +2 -2
- package/docs/classes/NotImplementedError.html +29 -8
- package/docs/classes/Point.html +2 -2
- package/docs/classes/Polygon.html +2 -2
- package/docs/classes/Query.html +7 -7
- package/docs/classes/RawError.html +29 -8
- package/docs/classes/RawQuery.html +7 -7
- package/docs/classes/Request.html +2 -2
- package/docs/classes/Response.html +2 -2
- package/docs/classes/ResponseData.html +2 -2
- package/docs/classes/ServiceProvider.html +2 -2
- package/docs/classes/ServiceResponse.html +2 -2
- package/docs/classes/SetSessionVariableQuery.html +7 -7
- package/docs/classes/StormError.html +29 -8
- package/docs/classes/TemporaryTableQuery.html +7 -7
- package/docs/classes/TimeoutError.html +29 -8
- package/docs/classes/Token.html +2 -2
- package/docs/classes/TokenManager.html +2 -2
- package/docs/classes/Transaction.html +2 -2
- package/docs/classes/UnauthorizedAccessError.html +29 -8
- package/docs/enums/ErrorCode.html +2 -2
- package/docs/enums/ExitCode.html +2 -2
- package/docs/enums/HTTPMethod.html +2 -2
- package/docs/enums/IsolationLevel.html +2 -2
- package/docs/enums/JWTError.html +2 -2
- package/docs/enums/StatusCode.html +2 -2
- package/docs/enums/TransactionAccessLevel.html +2 -2
- package/docs/functions/getInstance.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/IAdditionalErrorDetails.html +1 -1
- package/docs/interfaces/ICloudwatchConfig.html +2 -2
- package/docs/interfaces/ICloudwatchCredentials.html +2 -2
- package/docs/interfaces/ICloudwatchStreamConfig.html +2 -2
- package/docs/interfaces/IConfig.html +2 -2
- package/docs/interfaces/IDatabaseConfig.html +2 -2
- package/docs/interfaces/IDatabaseConnection.html +8 -5
- package/docs/interfaces/IDatabasePosition.html +2 -2
- package/docs/interfaces/IErrorResponse.html +2 -2
- package/docs/interfaces/IFormData.html +2 -2
- package/docs/interfaces/IInsertQueryResult.html +2 -2
- package/docs/interfaces/IJWTVerifyOptions.html +2 -2
- package/docs/interfaces/IOKPacket.html +2 -2
- package/docs/interfaces/IParameterMap.html +1 -1
- package/docs/interfaces/IQueryable.html +2 -2
- package/docs/interfaces/IRequestResponse.html +2 -2
- package/docs/interfaces/ISetSessionVariableQueryInput.html +2 -2
- package/docs/interfaces/IStormCLIArgs.html +2 -2
- package/docs/interfaces/ITemporaryTableQueryInput.html +2 -2
- package/docs/interfaces/IUpdateQueryResult.html +2 -2
- package/docs/interfaces/formidable.FileJSON.html +1 -1
- package/docs/interfaces/formidable.Part.html +16 -16
- package/docs/types/IDeleteQueryResult.html +1 -1
- package/docs/types/IStoredProcedureResult.html +1 -1
- package/docs/types/TCoordinate.html +1 -1
- package/lib/Application.d.ts +2 -3
- package/lib/Application.js +22 -9
- package/lib/Application.js.map +1 -1
- package/lib/DatabaseConnection.d.ts +3 -0
- package/lib/DatabaseConnection.js.map +1 -1
- package/lib/Handler.d.ts +25 -28
- package/lib/Handler.js +18 -4
- package/lib/Handler.js.map +1 -1
- package/lib/IDatabaseConnection.d.ts +3 -0
- package/lib/IRequestResponse.d.ts +2 -2
- package/lib/IRequestResponse.js +1 -1
- package/lib/ManagedDatabaseConnection.d.ts +3 -0
- package/lib/ManagedDatabaseConnection.js +9 -0
- package/lib/ManagedDatabaseConnection.js.map +1 -1
- package/lib/Middleware.d.ts +8 -2
- package/lib/Middleware.js +9 -1
- package/lib/Middleware.js.map +1 -1
- package/lib/MySQLConnection.d.ts +12 -0
- package/lib/MySQLConnection.js +30 -1
- package/lib/MySQLConnection.js.map +1 -1
- package/lib/MySQLDatabase.js +8 -10
- package/lib/MySQLDatabase.js.map +1 -1
- package/lib/Response.d.ts +8 -5
- package/lib/Response.js +4 -3
- package/lib/Response.js.map +1 -1
- package/lib/ServiceProvider.d.ts +6 -6
- package/lib/ServiceProvider.js +8 -5
- package/lib/ServiceProvider.js.map +1 -1
- package/lib/TokenManager.d.ts +2 -1
- package/lib/TokenManager.js.map +1 -1
- package/lib/api.d.ts +1 -5
- package/lib/api.js +2 -6
- package/lib/api.js.map +1 -1
- package/lib/private/ConnectionReplicationWaiter.js +1 -1
- package/lib/private/ConnectionReplicationWaiter.js.map +1 -1
- package/lib/private/GetProcessList.d.ts +15 -0
- package/lib/private/GetProcessList.js +11 -0
- package/lib/private/GetProcessList.js.map +1 -0
- package/package.json +10 -9
- package/src/Application.ts +23 -10
- package/src/DatabaseConnection.ts +6 -0
- package/src/Handler.ts +41 -46
- package/src/IDatabaseConnection.ts +3 -0
- package/src/IRequestResponse.ts +3 -3
- package/src/ManagedDatabaseConnection.ts +12 -0
- package/src/Middleware.ts +14 -2
- package/src/MySQLConnection.ts +34 -1
- package/src/MySQLDatabase.ts +8 -10
- package/src/Response.ts +20 -7
- package/src/ServiceProvider.ts +17 -13
- package/src/TokenManager.ts +2 -1
- package/src/api.ts +1 -5
- package/src/private/ConnectionReplicationWaiter.ts +1 -1
- package/src/private/GetProcessList.ts +20 -0
- package/docs/classes/BackendAuthenticationMiddleware.html +0 -8
- package/docs/classes/CORSMiddleware.html +0 -14
- package/docs/interfaces/IHandler.html +0 -2
- package/docs/interfaces/IServiceHeaders.html +0 -1
- package/docs/types/IHandlerError.html +0 -5
- package/docs/types/IHandlerResponse.html +0 -11
- package/lib/BackendAuthenticationMiddleware.d.ts +0 -18
- package/lib/BackendAuthenticationMiddleware.js +0 -67
- package/lib/BackendAuthenticationMiddleware.js.map +0 -1
- package/lib/CORSMiddleware.d.ts +0 -28
- package/lib/CORSMiddleware.js +0 -81
- package/lib/CORSMiddleware.js.map +0 -1
- package/lib/IHandler.d.ts +0 -5
- package/lib/IHandler.js +0 -18
- package/lib/IHandler.js.map +0 -1
- package/lib/IServiceHeaders.d.ts +0 -3
- package/lib/IServiceHeaders.js +0 -18
- package/lib/IServiceHeaders.js.map +0 -1
- package/src/BackendAuthenticationMiddleware.ts +0 -75
- package/src/CORSMiddleware.ts +0 -90
- package/src/IHandler.ts +0 -22
- package/src/IServiceHeaders.ts +0 -19
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CORSMiddleware | @breautek/storm</title><meta name="description" content="Documentation for @breautek/storm"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@breautek/storm</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">CORSMiddleware</a></li></ul><h1>Class CORSMiddleware</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>CORSMiddleware is used to enable CORS on APIs.
|
|
2
|
-
It will automatically add the necessary headers necessary to
|
|
3
|
-
communicate with CORS enabled clients.</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></section><section class="tsd-panel tsd-hierarchy" data-refl="1730"><h4>Hierarchy (<a href="../hierarchy.html#CORSMiddleware">View Summary</a>)</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><a href="Middleware.html" class="tsd-signature-type tsd-kind-class">Middleware</a><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">CORSMiddleware</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/CORSMiddleware.ts#L28">src/CORSMiddleware.ts:28</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
5
|
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="#_execute" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_<wbr/>execute</span></a>
|
|
6
|
-
<a href="#execute" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>execute</span></a>
|
|
7
|
-
<a href="#getdefaultallowedheaders" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Default<wbr/>Allowed<wbr/>Headers</span></a>
|
|
8
|
-
<a href="#getdefaultallowedmethods" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Default<wbr/>Allowed<wbr/>Methods</span></a>
|
|
9
|
-
<a href="#getdefaultallowedorigin" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Default<wbr/>Allowed<wbr/>Origin</span></a>
|
|
10
|
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorcorsmiddleware"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">CORSMiddleware</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">allowedOrigin</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">allowedHeaders</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">allowedMethods</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">CORSMiddleware</a><a href="#constructorcorsmiddleware" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">allowedOrigin</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The allowed origin. By default it will use the request origin.</p>
|
|
11
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">allowedHeaders</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>Array of allowed headers.</p>
|
|
12
|
-
</div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">allowedMethods</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>Array of allowed HTTP methods.</p>
|
|
13
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">CORSMiddleware</a></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides <a href="Middleware.html">Middleware</a>.<a href="Middleware.html#constructor">constructor</a></p><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/CORSMiddleware.ts#L39">src/CORSMiddleware.ts:39</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="_execute"><code class="tsd-tag">Protected</code><span>_<wbr/>execute</span><a href="#_execute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-protected"><li class=""><div class="tsd-signature tsd-anchor-link" id="_execute-1"><span class="tsd-kind-call-signature">_execute</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">request</span><span class="tsd-signature-symbol">:</span> <a href="Request.html" class="tsd-signature-type tsd-kind-class">Request</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">response</span><span class="tsd-signature-symbol">:</span> <a href="Response.html" class="tsd-signature-type tsd-kind-class">Response</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/IRequestResponse.html" class="tsd-signature-type tsd-kind-interface">IRequestResponse</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#_execute-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">request</span>: <a href="Request.html" class="tsd-signature-type tsd-kind-class">Request</a></span></li><li><span><span class="tsd-kind-parameter">response</span>: <a href="Response.html" class="tsd-signature-type tsd-kind-class">Response</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/IRequestResponse.html" class="tsd-signature-type tsd-kind-interface">IRequestResponse</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><p>Overrides <a href="Middleware.html">Middleware</a>.<a href="Middleware.html#_execute">_execute</a></p><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/CORSMiddleware.ts#L75">src/CORSMiddleware.ts:75</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><h3 class="tsd-anchor-link" id="execute"><span>execute</span><a href="#execute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited"><li class="tsd-is-inherited"><div class="tsd-signature tsd-anchor-link" id="execute-1"><span class="tsd-kind-call-signature">execute</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">request</span><span class="tsd-signature-symbol">:</span> <a href="Request.html" class="tsd-signature-type tsd-kind-class">Request</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">response</span><span class="tsd-signature-symbol">:</span> <a href="Response.html" class="tsd-signature-type tsd-kind-class">Response</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/IRequestResponse.html" class="tsd-signature-type tsd-kind-interface">IRequestResponse</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#execute-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">request</span>: <a href="Request.html" class="tsd-signature-type tsd-kind-class">Request</a></span></li><li><span><span class="tsd-kind-parameter">response</span>: <a href="Response.html" class="tsd-signature-type tsd-kind-class">Response</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/IRequestResponse.html" class="tsd-signature-type tsd-kind-interface">IRequestResponse</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><p>Inherited from <a href="Middleware.html">Middleware</a>.<a href="Middleware.html#execute">execute</a></p><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/Middleware.ts#L26">src/Middleware.ts:26</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getdefaultallowedheaders"><span>get<wbr/>Default<wbr/>Allowed<wbr/>Headers</span><a href="#getdefaultallowedheaders" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getdefaultallowedheaders-1"><span class="tsd-kind-call-signature">getDefaultAllowedHeaders</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><a href="#getdefaultallowedheaders-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/CORSMiddleware.ts#L54">src/CORSMiddleware.ts:54</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getdefaultallowedmethods"><span>get<wbr/>Default<wbr/>Allowed<wbr/>Methods</span><a href="#getdefaultallowedmethods" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getdefaultallowedmethods-1"><span class="tsd-kind-call-signature">getDefaultAllowedMethods</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><a href="#getdefaultallowedmethods-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/CORSMiddleware.ts#L64">src/CORSMiddleware.ts:64</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="getdefaultallowedorigin"><span>get<wbr/>Default<wbr/>Allowed<wbr/>Origin</span><a href="#getdefaultallowedorigin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="getdefaultallowedorigin-1"><span class="tsd-kind-call-signature">getDefaultAllowedOrigin</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><a href="#getdefaultallowedorigin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the allowed origin. By default,</p>
|
|
14
|
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/CORSMiddleware.ts#L50">src/CORSMiddleware.ts:50</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#_execute" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>_<wbr/>execute</span></a><a href="#execute" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>execute</span></a><a href="#getdefaultallowedheaders"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Default<wbr/>Allowed<wbr/>Headers</span></a><a href="#getdefaultallowedmethods"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Default<wbr/>Allowed<wbr/>Methods</span></a><a href="#getdefaultallowedorigin"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Default<wbr/>Allowed<wbr/>Origin</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html">@breautek/storm</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IHandler | @breautek/storm</title><meta name="description" content="Documentation for @breautek/storm"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@breautek/storm</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">IHandler</a></li></ul><h1>Interface IHandler<TApplication></h1></div><div class="tsd-signature"><span class="tsd-signature-keyword">interface</span> <span class="tsd-kind-interface">IHandler</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#tapplication">TApplication</a> <span class="tsd-signature-keyword">extends</span> <a href="../classes/Application.html" class="tsd-signature-type tsd-kind-class">Application</a> <span class="tsd-signature-symbol">=</span> <a href="../classes/Application.html" class="tsd-signature-type tsd-kind-class">Application</a><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-keyword">new</span> <a class="tsd-kind-constructor-signature" href="#constructorihandler">IHandler</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">app</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tapplication">TApplication</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="../classes/Handler.html" class="tsd-signature-type tsd-kind-class">Handler</a><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="tapplication"><span class="tsd-kind-type-parameter">TApplication</span> <span class="tsd-signature-keyword">extends</span> <a href="../classes/Application.html" class="tsd-signature-type tsd-kind-class">Application</a> = <a href="../classes/Application.html" class="tsd-signature-type tsd-kind-class">Application</a></span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/IHandler.ts#L20">src/IHandler.ts:20</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
2
|
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorihandler"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">IHandler</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">app</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tapplication">TApplication</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="../classes/Handler.html" class="tsd-signature-type tsd-kind-class">Handler</a><a href="#constructorihandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">app</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#tapplication">TApplication</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../classes/Handler.html" class="tsd-signature-type tsd-kind-class">Handler</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/IHandler.ts#L21">src/IHandler.ts:21</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html">@breautek/storm</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IServiceHeaders | @breautek/storm</title><meta name="description" content="Documentation for @breautek/storm"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@breautek/storm</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">IServiceHeaders</a></li></ul><h1>Interface IServiceHeaders</h1></div><section class="tsd-panel"><h4 class="tsd-before-signature">Indexable</h4><ul class="tsd-signatures"><li class="tsd-index-signature"><div class="tsd-signature"><span class="tsd-signature-symbol">[</span><span class="tsd-kind-parameter">key</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]:</span> <span class="tsd-signature-type">string</span></div></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/IServiceHeaders.ts#L17">src/IServiceHeaders.ts:17</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html">@breautek/storm</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IHandlerError | @breautek/storm</title><meta name="description" content="Documentation for @breautek/storm"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@breautek/storm</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">IHandlerError</a></li></ul><h1>Type Alias IHandlerError</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">IHandlerError</span><span class="tsd-signature-symbol">:</span> <a href="../classes/StormError.html" class="tsd-signature-type tsd-kind-class">StormError</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Error</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">any</span></div><div class="tsd-comment tsd-typography"><p>Like IHandlerResponse, an IHandlerError can be any arbitrary type of object,
|
|
2
|
-
however it's recommended that the type be of a StormError.</p>
|
|
3
|
-
<p>If the type is not a StormError, the error will be wrapped in an InternalError object.
|
|
4
|
-
This is to avoid accidental leakage of privilege data (e.g. snippets of database queries with sensitive information)</p>
|
|
5
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/Handler.ts#L54">src/Handler.ts:54</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html">@breautek/storm</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IHandlerResponse | @breautek/storm</title><meta name="description" content="Documentation for @breautek/storm"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@breautek/storm</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">IHandlerResponse</a></li></ul><h1>Type Alias IHandlerResponse</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">IHandlerResponse</span><span class="tsd-signature-symbol">:</span> <a href="../classes/ResponseData.html" class="tsd-signature-type tsd-kind-class">ResponseData</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">ReadableStream</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">ReadStream</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">any</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">void</span></div><div class="tsd-comment tsd-typography"><p>IHandlerResponse can actually accept any arbitrary object, however it may do
|
|
2
|
-
certain things depending on the type of object it receives.</p>
|
|
3
|
-
<ul>
|
|
4
|
-
<li>If the response object is a stream, it will pipe the stream to stream the HTTP response.</li>
|
|
5
|
-
<li>If the response is ResponseData, the status code and response data will be passed as the HTTP response.</li>
|
|
6
|
-
<li>Passing nothing/undefined will return a status code of 204 with no body content</li>
|
|
7
|
-
<li>Primitive data types will be passed as is</li>
|
|
8
|
-
<li>Buffers will be passed through</li>
|
|
9
|
-
<li>Any other object will be passed through JSON.stringify</li>
|
|
10
|
-
</ul>
|
|
11
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/breautek/storm/blob/aee41fe79c42b214a44357bedb97b86fde2c357f/src/Handler.ts#L45">src/Handler.ts:45</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html">@breautek/storm</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Request } from './Request';
|
|
2
|
-
/**
|
|
3
|
-
* A base authentication strategy that handles 90% of the authentication process.
|
|
4
|
-
* This will verify that the token hasn't been manipulated or tainted.
|
|
5
|
-
* The authenticate API must be implemented by subclasses to further validate the token data
|
|
6
|
-
* for their specific use cases.
|
|
7
|
-
*/
|
|
8
|
-
export declare class BackendAuthenticationMiddleware {
|
|
9
|
-
private $logger;
|
|
10
|
-
constructor();
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param request
|
|
14
|
-
* @param response
|
|
15
|
-
* @param options Arbituary object containing any relevant information used for authentication.
|
|
16
|
-
*/
|
|
17
|
-
execute(request: Request, options?: any): Promise<any>;
|
|
18
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2017-2021 Norman Breau
|
|
4
|
-
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
See the License for the specific language governing permissions and
|
|
15
|
-
limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.BackendAuthenticationMiddleware = void 0;
|
|
19
|
-
const StatusCode_1 = require("./StatusCode");
|
|
20
|
-
const ResponseData_1 = require("./ResponseData");
|
|
21
|
-
const instance_1 = require("./instance");
|
|
22
|
-
const TAG = 'BackendAuthenticationMiddleware';
|
|
23
|
-
/**
|
|
24
|
-
* A base authentication strategy that handles 90% of the authentication process.
|
|
25
|
-
* This will verify that the token hasn't been manipulated or tainted.
|
|
26
|
-
* The authenticate API must be implemented by subclasses to further validate the token data
|
|
27
|
-
* for their specific use cases.
|
|
28
|
-
*/
|
|
29
|
-
class BackendAuthenticationMiddleware {
|
|
30
|
-
constructor() {
|
|
31
|
-
this.$logger = (0, instance_1.getInstance)().getLogger();
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param request
|
|
36
|
-
* @param response
|
|
37
|
-
* @param options Arbituary object containing any relevant information used for authentication.
|
|
38
|
-
*/
|
|
39
|
-
execute(request, options) {
|
|
40
|
-
let config = (0, instance_1.getInstance)().getConfig();
|
|
41
|
-
let backendAuthHeader = config.backend_authentication_header;
|
|
42
|
-
let backend = request.getHeader(backendAuthHeader);
|
|
43
|
-
if (backend) {
|
|
44
|
-
if (config.backend_authentication_secret === null) {
|
|
45
|
-
this.$logger.warn(TAG, 'Backend secret not implemented.');
|
|
46
|
-
return Promise.reject(new ResponseData_1.ResponseData(StatusCode_1.StatusCode.INTERNAL_ERROR));
|
|
47
|
-
}
|
|
48
|
-
if (backend === config.backend_authentication_secret) {
|
|
49
|
-
return Promise.resolve(null);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return Promise.reject(new ResponseData_1.ResponseData(StatusCode_1.StatusCode.ERR_UNAUTHORIZED, {
|
|
53
|
-
code: 0,
|
|
54
|
-
reason: 'Missing secret'
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
return Promise.reject(new ResponseData_1.ResponseData(StatusCode_1.StatusCode.ERR_UNAUTHORIZED, {
|
|
60
|
-
code: 0,
|
|
61
|
-
reason: 'Missing secret'
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.BackendAuthenticationMiddleware = BackendAuthenticationMiddleware;
|
|
67
|
-
//# sourceMappingURL=BackendAuthenticationMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackendAuthenticationMiddleware.js","sourceRoot":"","sources":["../src/BackendAuthenticationMiddleware.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AAExC,iDAA4C;AAE5C,yCAAuC;AAGvC,MAAM,GAAG,GAAW,iCAAiC,CAAC;AAEtD;;;;;GAKG;AACH,MAAa,+BAA+B;IAGxC;QACI,IAAI,CAAC,OAAO,GAAG,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACI,OAAO,CAAC,OAAgB,EAAE,OAAa;QAC1C,IAAI,MAAM,GAAY,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC;QAEhD,IAAI,iBAAiB,GAAW,MAAM,CAAC,6BAA6B,CAAC;QAErE,IAAI,OAAO,GAAW,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;QAE3D,IAAI,OAAO,EAAE,CAAC;YACV,IAAI,MAAM,CAAC,6BAA6B,KAAK,IAAI,EAAE,CAAC;gBAChD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,iCAAiC,CAAC,CAAC;gBAC1D,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,2BAAY,CAAC,uBAAU,CAAC,cAAc,CAAC,CAAC,CAAC;YACvE,CAAC;YAED,IAAI,OAAO,KAAK,MAAM,CAAC,6BAA6B,EAAE,CAAC;gBACnD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;iBACI,CAAC;gBACF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,2BAAY,CAAC,uBAAU,CAAC,gBAAgB,EAAE;oBAChE,IAAI,EAAE,CAAC;oBACP,MAAM,EAAE,gBAAgB;iBAC3B,CAAC,CAAC,CAAC;YACR,CAAC;QACL,CAAC;aACI,CAAC;YACF,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,2BAAY,CAAC,uBAAU,CAAC,gBAAgB,EAAE;gBAChE,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,gBAAgB;aAC3B,CAAC,CAAC,CAAC;QACR,CAAC;IACL,CAAC;CACJ;AA3CD,0EA2CC"}
|
package/lib/CORSMiddleware.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Middleware } from './Middleware';
|
|
2
|
-
import { Request } from './Request';
|
|
3
|
-
import { Response } from './Response';
|
|
4
|
-
import { IRequestResponse } from './IRequestResponse';
|
|
5
|
-
/**
|
|
6
|
-
* CORSMiddleware is used to enable CORS on APIs.
|
|
7
|
-
* It will automatically add the necessary headers necessary to
|
|
8
|
-
* communicate with CORS enabled clients.
|
|
9
|
-
*/
|
|
10
|
-
export declare class CORSMiddleware extends Middleware {
|
|
11
|
-
private $allowedOrigin;
|
|
12
|
-
private $allowedHeaders;
|
|
13
|
-
private $allowedMethods;
|
|
14
|
-
/**
|
|
15
|
-
* @constructor
|
|
16
|
-
* @param allowedOrigin The allowed origin. By default it will use the request origin.
|
|
17
|
-
* @param allowedHeaders Array of allowed headers.
|
|
18
|
-
* @param allowedMethods Array of allowed HTTP methods.
|
|
19
|
-
*/
|
|
20
|
-
constructor(allowedOrigin?: string, allowedHeaders?: string[], allowedMethods?: string[]);
|
|
21
|
-
/**
|
|
22
|
-
* Sets the allowed origin. By default,
|
|
23
|
-
*/
|
|
24
|
-
getDefaultAllowedOrigin(): string;
|
|
25
|
-
getDefaultAllowedHeaders(): string[];
|
|
26
|
-
getDefaultAllowedMethods(): string[];
|
|
27
|
-
protected _execute(request: Request, response: Response): Promise<IRequestResponse>;
|
|
28
|
-
}
|
package/lib/CORSMiddleware.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2017-2021 Norman Breau
|
|
4
|
-
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
See the License for the specific language governing permissions and
|
|
15
|
-
limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.CORSMiddleware = void 0;
|
|
19
|
-
const Middleware_1 = require("./Middleware");
|
|
20
|
-
const instance_1 = require("./instance");
|
|
21
|
-
/**
|
|
22
|
-
* CORSMiddleware is used to enable CORS on APIs.
|
|
23
|
-
* It will automatically add the necessary headers necessary to
|
|
24
|
-
* communicate with CORS enabled clients.
|
|
25
|
-
*/
|
|
26
|
-
class CORSMiddleware extends Middleware_1.Middleware {
|
|
27
|
-
/**
|
|
28
|
-
* @constructor
|
|
29
|
-
* @param allowedOrigin The allowed origin. By default it will use the request origin.
|
|
30
|
-
* @param allowedHeaders Array of allowed headers.
|
|
31
|
-
* @param allowedMethods Array of allowed HTTP methods.
|
|
32
|
-
*/
|
|
33
|
-
constructor(allowedOrigin, allowedHeaders, allowedMethods) {
|
|
34
|
-
super();
|
|
35
|
-
this.$allowedOrigin = (!allowedOrigin) ? this.getDefaultAllowedOrigin() : allowedOrigin;
|
|
36
|
-
this.$allowedHeaders = (!allowedHeaders) ? this.getDefaultAllowedHeaders() : allowedHeaders;
|
|
37
|
-
this.$allowedMethods = (!allowedMethods) ? this.getDefaultAllowedMethods() : allowedMethods;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Sets the allowed origin. By default,
|
|
41
|
-
*/
|
|
42
|
-
getDefaultAllowedOrigin() {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
getDefaultAllowedHeaders() {
|
|
46
|
-
return [
|
|
47
|
-
'Accept',
|
|
48
|
-
(0, instance_1.getInstance)().getConfig().authentication_header,
|
|
49
|
-
'X-Requested-With',
|
|
50
|
-
'Content-Type',
|
|
51
|
-
'Access-Control-Allow-Origin'
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
getDefaultAllowedMethods() {
|
|
55
|
-
return [
|
|
56
|
-
'GET',
|
|
57
|
-
'POST',
|
|
58
|
-
'HEAD',
|
|
59
|
-
'OPTIONS',
|
|
60
|
-
'DELETE',
|
|
61
|
-
'PUT'
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
_execute(request, response) {
|
|
65
|
-
if (this.$allowedOrigin) {
|
|
66
|
-
response.setHeader('Access-Control-Allow-Origin', this.$allowedOrigin);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
response.setHeader('Access-Control-Allow-Origin', request.getHeader('Origin'));
|
|
70
|
-
}
|
|
71
|
-
response.setHeader('Access-Control-Allow-Headers', this.$allowedHeaders.join(', '));
|
|
72
|
-
response.setHeader('Access-Control-Allow-Methods', this.$allowedMethods.join(', '));
|
|
73
|
-
response.setHeader('Vary', 'Origin');
|
|
74
|
-
return Promise.resolve({
|
|
75
|
-
request: request,
|
|
76
|
-
response: response
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.CORSMiddleware = CORSMiddleware;
|
|
81
|
-
//# sourceMappingURL=CORSMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CORSMiddleware.js","sourceRoot":"","sources":["../src/CORSMiddleware.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE;;;AAEF,6CAAwC;AAIxC,yCAAuC;AAEvC;;;;GAIG;AACH,MAAa,cAAe,SAAQ,uBAAU;IAK1C;;;;;OAKG;IACH,YAAmB,aAAsB,EAAE,cAAyB,EAAE,cAAyB;QAC3F,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;QACxF,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;QAC5F,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;IAChG,CAAC;IAED;;OAEG;IACI,uBAAuB;QAC1B,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,wBAAwB;QAC3B,OAAO;YACH,QAAQ;YACR,IAAA,sBAAW,GAAE,CAAC,SAAS,EAAE,CAAC,qBAAqB;YAC/C,kBAAkB;YAClB,cAAc;YACd,6BAA6B;SAChC,CAAC;IACN,CAAC;IAEM,wBAAwB;QAC3B,OAAO;YACH,KAAK;YACL,MAAM;YACN,MAAM;YACN,SAAS;YACT,QAAQ;YACR,KAAK;SACR,CAAC;IACN,CAAC;IAES,QAAQ,CAAC,OAAgB,EAAE,QAAkB;QACnD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,QAAQ,CAAC,SAAS,CAAC,6BAA6B,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3E,CAAC;aACI,CAAC;YACF,QAAQ,CAAC,SAAS,CAAC,6BAA6B,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QACnF,CAAC;QACD,QAAQ,CAAC,SAAS,CAAC,8BAA8B,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpF,QAAQ,CAAC,SAAS,CAAC,8BAA8B,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpF,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC;YACnB,OAAO,EAAE,OAAO;YAChB,QAAQ,EAAE,QAAQ;SACrB,CAAC,CAAC;IACP,CAAC;CACJ;AA9DD,wCA8DC"}
|
package/lib/IHandler.d.ts
DELETED
package/lib/IHandler.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2017-2021 Norman Breau
|
|
4
|
-
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
See the License for the specific language governing permissions and
|
|
15
|
-
limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
//# sourceMappingURL=IHandler.js.map
|
package/lib/IHandler.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IHandler.js","sourceRoot":"","sources":["../src/IHandler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE"}
|
package/lib/IServiceHeaders.d.ts
DELETED
package/lib/IServiceHeaders.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2017-2021 Norman Breau
|
|
4
|
-
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
See the License for the specific language governing permissions and
|
|
15
|
-
limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
//# sourceMappingURL=IServiceHeaders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IServiceHeaders.js","sourceRoot":"","sources":["../src/IServiceHeaders.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;EAcE"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2017-2021 Norman Breau
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import {StatusCode} from './StatusCode';
|
|
18
|
-
import {Request} from './Request';
|
|
19
|
-
import {ResponseData} from './ResponseData';
|
|
20
|
-
import {BaseLogger} from '@arashi/logger';
|
|
21
|
-
import {getInstance} from './instance';
|
|
22
|
-
import {IConfig} from './IConfig';
|
|
23
|
-
|
|
24
|
-
const TAG: string = 'BackendAuthenticationMiddleware';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* A base authentication strategy that handles 90% of the authentication process.
|
|
28
|
-
* This will verify that the token hasn't been manipulated or tainted.
|
|
29
|
-
* The authenticate API must be implemented by subclasses to further validate the token data
|
|
30
|
-
* for their specific use cases.
|
|
31
|
-
*/
|
|
32
|
-
export class BackendAuthenticationMiddleware {
|
|
33
|
-
private $logger: BaseLogger;
|
|
34
|
-
|
|
35
|
-
public constructor() {
|
|
36
|
-
this.$logger = getInstance().getLogger();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @param request
|
|
42
|
-
* @param response
|
|
43
|
-
* @param options Arbituary object containing any relevant information used for authentication.
|
|
44
|
-
*/
|
|
45
|
-
public execute(request: Request, options?: any): Promise<any> {
|
|
46
|
-
let config: IConfig = getInstance().getConfig();
|
|
47
|
-
|
|
48
|
-
let backendAuthHeader: string = config.backend_authentication_header;
|
|
49
|
-
|
|
50
|
-
let backend: string = request.getHeader(backendAuthHeader);
|
|
51
|
-
|
|
52
|
-
if (backend) {
|
|
53
|
-
if (config.backend_authentication_secret === null) {
|
|
54
|
-
this.$logger.warn(TAG, 'Backend secret not implemented.');
|
|
55
|
-
return Promise.reject(new ResponseData(StatusCode.INTERNAL_ERROR));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (backend === config.backend_authentication_secret) {
|
|
59
|
-
return Promise.resolve(null);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return Promise.reject(new ResponseData(StatusCode.ERR_UNAUTHORIZED, {
|
|
63
|
-
code: 0,
|
|
64
|
-
reason: 'Missing secret'
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
return Promise.reject(new ResponseData(StatusCode.ERR_UNAUTHORIZED, {
|
|
70
|
-
code: 0,
|
|
71
|
-
reason: 'Missing secret'
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|