@jwn-js/common 2.0.23 → 2.0.26
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/Server.d.ts +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ApiError.html +1 -1
- package/docs/classes/AsyncJwt.html +1 -1
- package/docs/classes/Controller.html +3 -3
- package/docs/classes/Jwt.html +1 -1
- package/docs/classes/Memcached.html +6 -6
- package/docs/classes/Model.html +1 -1
- package/docs/classes/Server.html +1 -1
- package/docs/classes/Ssr.html +1 -1
- package/docs/classes/Web.html +3 -3
- package/docs/index.html +2 -2
- package/docs/interfaces/ApiErrorMessage.html +1 -1
- package/docs/interfaces/ContextSsr.html +1 -1
- package/docs/interfaces/ContextWeb.html +1 -1
- package/docs/interfaces/OptionsSsr.html +1 -1
- package/docs/interfaces/OptionsWeb.html +1 -1
- package/docs/interfaces/ResponseOptions.html +1 -0
- package/docs/interfaces/Route.html +1 -1
- package/docs/interfaces/Schema.html +1 -1
- package/docs/interfaces/ServerHandler.html +1 -1
- package/docs/interfaces/ServerOptions.html +1 -1
- package/docs/interfaces/ServerWebsocket.html +1 -1
- package/docs/modules.html +2 -2
- package/index.d.ts +3 -2
- package/index.js +22 -1
- package/package.json +1 -1
package/docs/modules.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@jwn-js/common - v2.0.23</title><meta name="description" content="Documentation for @jwn-js/common - v2.0.23"/><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 async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@jwn-js/common - v2.0.23</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1>@jwn-js/common - v2.0.23 </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class"><a href="classes/ApiError.html" class="tsd-kind-icon">Api<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/AsyncJwt.html" class="tsd-kind-icon">Async<wbr/>Jwt</a></li><li class="tsd-kind-class"><a href="classes/Controller.html" class="tsd-kind-icon">Controller</a></li><li class="tsd-kind-class"><a href="classes/Jwt.html" class="tsd-kind-icon">Jwt</a></li><li class="tsd-kind-class"><a href="classes/Memcached.html" class="tsd-kind-icon">Memcached</a></li><li class="tsd-kind-class"><a href="classes/Model.html" class="tsd-kind-icon">Model</a></li><li class="tsd-kind-class"><a href="classes/Server.html" class="tsd-kind-icon">Server</a></li><li class="tsd-kind-class"><a href="classes/Ssr.html" class="tsd-kind-icon">Ssr</a></li><li class="tsd-kind-class"><a href="classes/Web.html" class="tsd-kind-icon">Web</a></li></ul></section><section class="tsd-index-section "><h3>Interfaces</h3><ul class="tsd-index-list"><li class="tsd-kind-interface"><a href="interfaces/ApiErrorMessage.html" class="tsd-kind-icon">Api<wbr/>Error<wbr/>Message</a></li><li class="tsd-kind-interface tsd-is-external"><a href="interfaces/ContextSsr.html" class="tsd-kind-icon">Context<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/ContextWeb.html" class="tsd-kind-icon">Context<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsSsr.html" class="tsd-kind-icon">Options<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsWeb.html" class="tsd-kind-icon">Options<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/Route.html" class="tsd-kind-icon">Route</a></li><li class="tsd-kind-interface"><a href="interfaces/Schema.html" class="tsd-kind-icon">Schema</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerHandler.html" class="tsd-kind-icon">Server<wbr/>Handler</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerOptions.html" class="tsd-kind-icon">Server<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerWebsocket.html" class="tsd-kind-icon">Server<wbr/>Websocket</a></li></ul></section><section class="tsd-index-section "><h3>Type aliases</h3><ul class="tsd-index-list"><li class="tsd-kind-type-alias"><a href="modules.html#ServerRoutes" class="tsd-kind-icon">Server<wbr/>Routes</a></li></ul></section><section class="tsd-index-section "><h3>Variables</h3><ul class="tsd-index-list"><li class="tsd-kind-variable"><a href="modules.html#helpers" class="tsd-kind-icon">helpers</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function"><a href="modules.html#action" class="tsd-kind-icon">action</a></li><li class="tsd-kind-function"><a href="modules.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-function"><a href="modules.html#codeToStatus" class="tsd-kind-icon">code<wbr/>To<wbr/>Status</a></li><li class="tsd-kind-function"><a href="modules.html#config" class="tsd-kind-icon">config</a></li><li class="tsd-kind-function"><a href="modules.html#connection" class="tsd-kind-icon">connection</a></li><li class="tsd-kind-function"><a href="modules.html#context" class="tsd-kind-icon">context</a></li><li class="tsd-kind-function"><a href="modules.html#controller" class="tsd-kind-icon">controller</a></li><li class="tsd-kind-function"><a href="modules.html#cookies" class="tsd-kind-icon">cookies</a></li><li class="tsd-kind-function"><a href="modules.html#db" class="tsd-kind-icon">db</a></li><li class="tsd-kind-function"><a href="modules.html#headers" class="tsd-kind-icon">headers</a></li><li class="tsd-kind-function"><a href="modules.html#home" class="tsd-kind-icon">home</a></li><li class="tsd-kind-function"><a href="modules.html#hostname" class="tsd-kind-icon">hostname</a></li><li class="tsd-kind-function"><a href="modules.html#http" class="tsd-kind-icon">http</a></li><li class="tsd-kind-function"><a href="modules.html#init" class="tsd-kind-icon">init</a></li><li class="tsd-kind-function"><a href="modules.html#json" class="tsd-kind-icon">json</a></li><li class="tsd-kind-function"><a href="modules.html#logerror" class="tsd-kind-icon">logerror</a></li><li class="tsd-kind-function"><a href="modules.html#method" class="tsd-kind-icon">method</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mixin" class="tsd-kind-icon">mixin</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mount" class="tsd-kind-icon">mount</a></li><li class="tsd-kind-function"><a href="modules.html#pool" class="tsd-kind-icon">pool</a></li><li class="tsd-kind-function"><a href="modules.html#protocol" class="tsd-kind-icon">protocol</a></li><li class="tsd-kind-function"><a href="modules.html#request" class="tsd-kind-icon">request</a></li><li class="tsd-kind-function"><a href="modules.html#selectControllersSchema" class="tsd-kind-icon">select<wbr/>Controllers<wbr/>Schema</a></li><li class="tsd-kind-function"><a href="modules.html#stream" class="tsd-kind-icon">stream</a></li><li class="tsd-kind-function"><a href="modules.html#subaction" class="tsd-kind-icon">subaction</a></li><li class="tsd-kind-function"><a href="modules.html#url" class="tsd-kind-icon">url</a></li><li class="tsd-kind-function"><a href="modules.html#xml" class="tsd-kind-icon">xml</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Type aliases</h2><section class="tsd-panel tsd-member tsd-kind-type-alias"><a id="ServerRoutes" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Server<wbr/>Routes<a href="#ServerRoutes" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">Server<wbr/>Routes<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><a href="interfaces/ServerHandler.html" class="tsd-signature-type" data-tsd-kind="Interface">ServerHandler</a><span class="tsd-signature-symbol"> | </span><a href="interfaces/ServerWebsocket.html" class="tsd-signature-type" data-tsd-kind="Interface">ServerWebsocket</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">CallableFunction</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></div><aside class="tsd-sources"><ul><li>Defined in src/Server/Server.ts:37</li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>types</dt><dd></dd></dl></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Variables</h2><section class="tsd-panel tsd-member tsd-kind-variable"><a id="helpers" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> helpers<a href="#helpers" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">helpers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>cookieParse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>str<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><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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>cookieString<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>extensions<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>getExt<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>path<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><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>jsonBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>jwtDecode<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>jwt<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><span class="tsd-signature-symbol">{ </span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>head<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>multipartBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Options</span><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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>rawBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><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><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>readConfig<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>jsonfile<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><span class="tsd-signature-type">Promise</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>readConfigSync<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>jsonfile<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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>staticBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span>, base<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><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>streamBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Stream</span><span class="tsd-signature-symbol">; </span>urlencodedBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in src/index.ts:38</li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>exports</dt><dd></dd></dl></div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>cookie<wbr/>Parse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>str<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><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>str<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><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"><div class="lead">
|
|
1
|
+
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@jwn-js/common - v2.0.26</title><meta name="description" content="Documentation for @jwn-js/common - v2.0.26"/><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 async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@jwn-js/common - v2.0.26</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1>@jwn-js/common - v2.0.26 </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class"><a href="classes/ApiError.html" class="tsd-kind-icon">Api<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/AsyncJwt.html" class="tsd-kind-icon">Async<wbr/>Jwt</a></li><li class="tsd-kind-class"><a href="classes/Controller.html" class="tsd-kind-icon">Controller</a></li><li class="tsd-kind-class"><a href="classes/Jwt.html" class="tsd-kind-icon">Jwt</a></li><li class="tsd-kind-class"><a href="classes/Memcached.html" class="tsd-kind-icon">Memcached</a></li><li class="tsd-kind-class"><a href="classes/Model.html" class="tsd-kind-icon">Model</a></li><li class="tsd-kind-class"><a href="classes/Server.html" class="tsd-kind-icon">Server</a></li><li class="tsd-kind-class"><a href="classes/Ssr.html" class="tsd-kind-icon">Ssr</a></li><li class="tsd-kind-class"><a href="classes/Web.html" class="tsd-kind-icon">Web</a></li></ul></section><section class="tsd-index-section "><h3>Interfaces</h3><ul class="tsd-index-list"><li class="tsd-kind-interface"><a href="interfaces/ApiErrorMessage.html" class="tsd-kind-icon">Api<wbr/>Error<wbr/>Message</a></li><li class="tsd-kind-interface tsd-is-external"><a href="interfaces/ContextSsr.html" class="tsd-kind-icon">Context<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/ContextWeb.html" class="tsd-kind-icon">Context<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsSsr.html" class="tsd-kind-icon">Options<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsWeb.html" class="tsd-kind-icon">Options<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/ResponseOptions.html" class="tsd-kind-icon">Response<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/Route.html" class="tsd-kind-icon">Route</a></li><li class="tsd-kind-interface"><a href="interfaces/Schema.html" class="tsd-kind-icon">Schema</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerHandler.html" class="tsd-kind-icon">Server<wbr/>Handler</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerOptions.html" class="tsd-kind-icon">Server<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerWebsocket.html" class="tsd-kind-icon">Server<wbr/>Websocket</a></li></ul></section><section class="tsd-index-section "><h3>Type aliases</h3><ul class="tsd-index-list"><li class="tsd-kind-type-alias"><a href="modules.html#ServerRoutes" class="tsd-kind-icon">Server<wbr/>Routes</a></li></ul></section><section class="tsd-index-section "><h3>Variables</h3><ul class="tsd-index-list"><li class="tsd-kind-variable"><a href="modules.html#helpers" class="tsd-kind-icon">helpers</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function"><a href="modules.html#action" class="tsd-kind-icon">action</a></li><li class="tsd-kind-function"><a href="modules.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-function"><a href="modules.html#codeToStatus" class="tsd-kind-icon">code<wbr/>To<wbr/>Status</a></li><li class="tsd-kind-function"><a href="modules.html#config" class="tsd-kind-icon">config</a></li><li class="tsd-kind-function"><a href="modules.html#connection" class="tsd-kind-icon">connection</a></li><li class="tsd-kind-function"><a href="modules.html#context" class="tsd-kind-icon">context</a></li><li class="tsd-kind-function"><a href="modules.html#controller" class="tsd-kind-icon">controller</a></li><li class="tsd-kind-function"><a href="modules.html#cookies" class="tsd-kind-icon">cookies</a></li><li class="tsd-kind-function"><a href="modules.html#db" class="tsd-kind-icon">db</a></li><li class="tsd-kind-function"><a href="modules.html#headers" class="tsd-kind-icon">headers</a></li><li class="tsd-kind-function"><a href="modules.html#home" class="tsd-kind-icon">home</a></li><li class="tsd-kind-function"><a href="modules.html#hostname" class="tsd-kind-icon">hostname</a></li><li class="tsd-kind-function"><a href="modules.html#http" class="tsd-kind-icon">http</a></li><li class="tsd-kind-function"><a href="modules.html#init" class="tsd-kind-icon">init</a></li><li class="tsd-kind-function"><a href="modules.html#json" class="tsd-kind-icon">json</a></li><li class="tsd-kind-function"><a href="modules.html#logerror" class="tsd-kind-icon">logerror</a></li><li class="tsd-kind-function"><a href="modules.html#method" class="tsd-kind-icon">method</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mixin" class="tsd-kind-icon">mixin</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mount" class="tsd-kind-icon">mount</a></li><li class="tsd-kind-function"><a href="modules.html#pool" class="tsd-kind-icon">pool</a></li><li class="tsd-kind-function"><a href="modules.html#protocol" class="tsd-kind-icon">protocol</a></li><li class="tsd-kind-function"><a href="modules.html#request" class="tsd-kind-icon">request</a></li><li class="tsd-kind-function"><a href="modules.html#selectControllersSchema" class="tsd-kind-icon">select<wbr/>Controllers<wbr/>Schema</a></li><li class="tsd-kind-function"><a href="modules.html#stream" class="tsd-kind-icon">stream</a></li><li class="tsd-kind-function"><a href="modules.html#subaction" class="tsd-kind-icon">subaction</a></li><li class="tsd-kind-function"><a href="modules.html#url" class="tsd-kind-icon">url</a></li><li class="tsd-kind-function"><a href="modules.html#xml" class="tsd-kind-icon">xml</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Type aliases</h2><section class="tsd-panel tsd-member tsd-kind-type-alias"><a id="ServerRoutes" class="tsd-anchor"></a><h3 class="tsd-anchor-link">Server<wbr/>Routes<a href="#ServerRoutes" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">Server<wbr/>Routes<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><a href="interfaces/ServerHandler.html" class="tsd-signature-type" data-tsd-kind="Interface">ServerHandler</a><span class="tsd-signature-symbol"> | </span><a href="interfaces/ServerWebsocket.html" class="tsd-signature-type" data-tsd-kind="Interface">ServerWebsocket</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">CallableFunction</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></div><aside class="tsd-sources"><ul><li>Defined in src/Server/Server.ts:37</li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>types</dt><dd></dd></dl></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Variables</h2><section class="tsd-panel tsd-member tsd-kind-variable"><a id="helpers" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="tsd-flag ts-flagConst">Const</span> helpers<a href="#helpers" aria-label="Permalink" class="tsd-anchor-icon"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></svg></a></h3><div class="tsd-signature tsd-kind-icon">helpers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>cookieParse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>str<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><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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>cookieString<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>extensions<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>getExt<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>path<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><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>jsonBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>jwtDecode<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>jwt<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><span class="tsd-signature-symbol">{ </span>body<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>head<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>multipartBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Options</span><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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>rawBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><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><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>readConfig<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>jsonfile<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><span class="tsd-signature-type">Promise</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>readConfigSync<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>jsonfile<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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>staticBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span>, base<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><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>streamBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Stream</span><span class="tsd-signature-symbol">; </span>urlencodedBody<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>res<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpResponse</span>, req<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HttpRequest</span><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><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in src/index.ts:39</li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>exports</dt><dd></dd></dl></div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>cookie<wbr/>Parse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>str<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><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>str<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><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"><div class="lead">
|
|
2
2
|
<p>Parse coockie string to object</p>
|
|
3
3
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>str: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
4
4
|
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>cookie<wbr/>String<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">string</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, value<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</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><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><div class="tsd-comment tsd-typography"><div class="lead">
|
|
@@ -84,4 +84,4 @@ setCookie('user', 'John', {secure: true, 'max-age': 3600
|
|
|
84
84
|
<p>Xml response</p>
|
|
85
85
|
</div></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>opt: <span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol"> = {}</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
|
|
86
86
|
<p>response options</p>
|
|
87
|
-
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, propertyKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, descriptor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TypedPropertyDescriptor</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CallbackFunctionAny</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, propertyKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, descriptor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TypedPropertyDescriptor</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CallbackFunctionAny</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>target: <span class="tsd-signature-type">any</span></h5></li><li><h5>propertyKey: <span class="tsd-signature-type">string</span></h5></li><li><h5>descriptor: <span class="tsd-signature-type">TypedPropertyDescriptor</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CallbackFunctionAny</span><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class"><a href="classes/ApiError.html" class="tsd-kind-icon">Api<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/AsyncJwt.html" class="tsd-kind-icon">Async<wbr/>Jwt</a></li><li class="tsd-kind-class"><a href="classes/Controller.html" class="tsd-kind-icon">Controller</a></li><li class="tsd-kind-class"><a href="classes/Jwt.html" class="tsd-kind-icon">Jwt</a></li><li class="tsd-kind-class"><a href="classes/Memcached.html" class="tsd-kind-icon">Memcached</a></li><li class="tsd-kind-class"><a href="classes/Model.html" class="tsd-kind-icon">Model</a></li><li class="tsd-kind-class"><a href="classes/Server.html" class="tsd-kind-icon">Server</a></li><li class="tsd-kind-class"><a href="classes/Ssr.html" class="tsd-kind-icon">Ssr</a></li><li class="tsd-kind-class"><a href="classes/Web.html" class="tsd-kind-icon">Web</a></li><li class="tsd-kind-interface"><a href="interfaces/ApiErrorMessage.html" class="tsd-kind-icon">Api<wbr/>Error<wbr/>Message</a></li><li class="tsd-kind-interface tsd-is-external"><a href="interfaces/ContextSsr.html" class="tsd-kind-icon">Context<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/ContextWeb.html" class="tsd-kind-icon">Context<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsSsr.html" class="tsd-kind-icon">Options<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsWeb.html" class="tsd-kind-icon">Options<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/Route.html" class="tsd-kind-icon">Route</a></li><li class="tsd-kind-interface"><a href="interfaces/Schema.html" class="tsd-kind-icon">Schema</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerHandler.html" class="tsd-kind-icon">Server<wbr/>Handler</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerOptions.html" class="tsd-kind-icon">Server<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerWebsocket.html" class="tsd-kind-icon">Server<wbr/>Websocket</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerRoutes" class="tsd-kind-icon">Server<wbr/>Routes</a></li><li class="tsd-kind-variable"><a href="modules.html#helpers" class="tsd-kind-icon">helpers</a></li><li class="tsd-kind-function"><a href="modules.html#action" class="tsd-kind-icon">action</a></li><li class="tsd-kind-function"><a href="modules.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-function"><a href="modules.html#codeToStatus" class="tsd-kind-icon">code<wbr/>To<wbr/>Status</a></li><li class="tsd-kind-function"><a href="modules.html#config" class="tsd-kind-icon">config</a></li><li class="tsd-kind-function"><a href="modules.html#connection" class="tsd-kind-icon">connection</a></li><li class="tsd-kind-function"><a href="modules.html#context" class="tsd-kind-icon">context</a></li><li class="tsd-kind-function"><a href="modules.html#controller" class="tsd-kind-icon">controller</a></li><li class="tsd-kind-function"><a href="modules.html#cookies" class="tsd-kind-icon">cookies</a></li><li class="tsd-kind-function"><a href="modules.html#db" class="tsd-kind-icon">db</a></li><li class="tsd-kind-function"><a href="modules.html#headers" class="tsd-kind-icon">headers</a></li><li class="tsd-kind-function"><a href="modules.html#home" class="tsd-kind-icon">home</a></li><li class="tsd-kind-function"><a href="modules.html#hostname" class="tsd-kind-icon">hostname</a></li><li class="tsd-kind-function"><a href="modules.html#http" class="tsd-kind-icon">http</a></li><li class="tsd-kind-function"><a href="modules.html#init" class="tsd-kind-icon">init</a></li><li class="tsd-kind-function"><a href="modules.html#json" class="tsd-kind-icon">json</a></li><li class="tsd-kind-function"><a href="modules.html#logerror" class="tsd-kind-icon">logerror</a></li><li class="tsd-kind-function"><a href="modules.html#method" class="tsd-kind-icon">method</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mixin" class="tsd-kind-icon">mixin</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mount" class="tsd-kind-icon">mount</a></li><li class="tsd-kind-function"><a href="modules.html#pool" class="tsd-kind-icon">pool</a></li><li class="tsd-kind-function"><a href="modules.html#protocol" class="tsd-kind-icon">protocol</a></li><li class="tsd-kind-function"><a href="modules.html#request" class="tsd-kind-icon">request</a></li><li class="tsd-kind-function"><a href="modules.html#selectControllersSchema" class="tsd-kind-icon">select<wbr/>Controllers<wbr/>Schema</a></li><li class="tsd-kind-function"><a href="modules.html#stream" class="tsd-kind-icon">stream</a></li><li class="tsd-kind-function"><a href="modules.html#subaction" class="tsd-kind-icon">subaction</a></li><li class="tsd-kind-function"><a href="modules.html#url" class="tsd-kind-icon">url</a></li><li class="tsd-kind-function"><a href="modules.html#xml" class="tsd-kind-icon">xml</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>
|
|
87
|
+
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, propertyKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, descriptor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TypedPropertyDescriptor</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CallbackFunctionAny</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, propertyKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, descriptor<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">TypedPropertyDescriptor</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CallbackFunctionAny</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>target: <span class="tsd-signature-type">any</span></h5></li><li><h5>propertyKey: <span class="tsd-signature-type">string</span></h5></li><li><h5>descriptor: <span class="tsd-signature-type">TypedPropertyDescriptor</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CallbackFunctionAny</span><span class="tsd-signature-symbol">></span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Exports</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class"><a href="classes/ApiError.html" class="tsd-kind-icon">Api<wbr/>Error</a></li><li class="tsd-kind-class"><a href="classes/AsyncJwt.html" class="tsd-kind-icon">Async<wbr/>Jwt</a></li><li class="tsd-kind-class"><a href="classes/Controller.html" class="tsd-kind-icon">Controller</a></li><li class="tsd-kind-class"><a href="classes/Jwt.html" class="tsd-kind-icon">Jwt</a></li><li class="tsd-kind-class"><a href="classes/Memcached.html" class="tsd-kind-icon">Memcached</a></li><li class="tsd-kind-class"><a href="classes/Model.html" class="tsd-kind-icon">Model</a></li><li class="tsd-kind-class"><a href="classes/Server.html" class="tsd-kind-icon">Server</a></li><li class="tsd-kind-class"><a href="classes/Ssr.html" class="tsd-kind-icon">Ssr</a></li><li class="tsd-kind-class"><a href="classes/Web.html" class="tsd-kind-icon">Web</a></li><li class="tsd-kind-interface"><a href="interfaces/ApiErrorMessage.html" class="tsd-kind-icon">Api<wbr/>Error<wbr/>Message</a></li><li class="tsd-kind-interface tsd-is-external"><a href="interfaces/ContextSsr.html" class="tsd-kind-icon">Context<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/ContextWeb.html" class="tsd-kind-icon">Context<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsSsr.html" class="tsd-kind-icon">Options<wbr/>Ssr</a></li><li class="tsd-kind-interface"><a href="interfaces/OptionsWeb.html" class="tsd-kind-icon">Options<wbr/>Web</a></li><li class="tsd-kind-interface"><a href="interfaces/ResponseOptions.html" class="tsd-kind-icon">Response<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/Route.html" class="tsd-kind-icon">Route</a></li><li class="tsd-kind-interface"><a href="interfaces/Schema.html" class="tsd-kind-icon">Schema</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerHandler.html" class="tsd-kind-icon">Server<wbr/>Handler</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerOptions.html" class="tsd-kind-icon">Server<wbr/>Options</a></li><li class="tsd-kind-interface"><a href="interfaces/ServerWebsocket.html" class="tsd-kind-icon">Server<wbr/>Websocket</a></li><li class="tsd-kind-type-alias"><a href="modules.html#ServerRoutes" class="tsd-kind-icon">Server<wbr/>Routes</a></li><li class="tsd-kind-variable"><a href="modules.html#helpers" class="tsd-kind-icon">helpers</a></li><li class="tsd-kind-function"><a href="modules.html#action" class="tsd-kind-icon">action</a></li><li class="tsd-kind-function"><a href="modules.html#body" class="tsd-kind-icon">body</a></li><li class="tsd-kind-function"><a href="modules.html#codeToStatus" class="tsd-kind-icon">code<wbr/>To<wbr/>Status</a></li><li class="tsd-kind-function"><a href="modules.html#config" class="tsd-kind-icon">config</a></li><li class="tsd-kind-function"><a href="modules.html#connection" class="tsd-kind-icon">connection</a></li><li class="tsd-kind-function"><a href="modules.html#context" class="tsd-kind-icon">context</a></li><li class="tsd-kind-function"><a href="modules.html#controller" class="tsd-kind-icon">controller</a></li><li class="tsd-kind-function"><a href="modules.html#cookies" class="tsd-kind-icon">cookies</a></li><li class="tsd-kind-function"><a href="modules.html#db" class="tsd-kind-icon">db</a></li><li class="tsd-kind-function"><a href="modules.html#headers" class="tsd-kind-icon">headers</a></li><li class="tsd-kind-function"><a href="modules.html#home" class="tsd-kind-icon">home</a></li><li class="tsd-kind-function"><a href="modules.html#hostname" class="tsd-kind-icon">hostname</a></li><li class="tsd-kind-function"><a href="modules.html#http" class="tsd-kind-icon">http</a></li><li class="tsd-kind-function"><a href="modules.html#init" class="tsd-kind-icon">init</a></li><li class="tsd-kind-function"><a href="modules.html#json" class="tsd-kind-icon">json</a></li><li class="tsd-kind-function"><a href="modules.html#logerror" class="tsd-kind-icon">logerror</a></li><li class="tsd-kind-function"><a href="modules.html#method" class="tsd-kind-icon">method</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mixin" class="tsd-kind-icon">mixin</a></li><li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mount" class="tsd-kind-icon">mount</a></li><li class="tsd-kind-function"><a href="modules.html#pool" class="tsd-kind-icon">pool</a></li><li class="tsd-kind-function"><a href="modules.html#protocol" class="tsd-kind-icon">protocol</a></li><li class="tsd-kind-function"><a href="modules.html#request" class="tsd-kind-icon">request</a></li><li class="tsd-kind-function"><a href="modules.html#selectControllersSchema" class="tsd-kind-icon">select<wbr/>Controllers<wbr/>Schema</a></li><li class="tsd-kind-function"><a href="modules.html#stream" class="tsd-kind-icon">stream</a></li><li class="tsd-kind-function"><a href="modules.html#subaction" class="tsd-kind-icon">subaction</a></li><li class="tsd-kind-function"><a href="modules.html#url" class="tsd-kind-icon">url</a></li><li class="tsd-kind-function"><a href="modules.html#xml" class="tsd-kind-icon">xml</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li><li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li><li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>
|
package/index.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ declare const codeToStatus: (code: number) => any;
|
|
|
89
89
|
* Create server
|
|
90
90
|
*/
|
|
91
91
|
declare class Server {
|
|
92
|
-
private _logLevel;
|
|
92
|
+
private readonly _logLevel;
|
|
93
93
|
/**
|
|
94
94
|
* Listen socket
|
|
95
95
|
* @private
|
|
@@ -462,6 +462,7 @@ interface Response$1 {
|
|
|
462
462
|
statusCode: number;
|
|
463
463
|
headers: Record<string, any>;
|
|
464
464
|
body: any;
|
|
465
|
+
memcache?: number | null;
|
|
465
466
|
}
|
|
466
467
|
interface Config {
|
|
467
468
|
server: Record<string, any>;
|
|
@@ -955,4 +956,4 @@ declare const helpers: {
|
|
|
955
956
|
};
|
|
956
957
|
};
|
|
957
958
|
|
|
958
|
-
export { ApiError, ApiErrorMessage, AsyncJwt, ContextWeb, Controller$1 as Controller, Jwt, Memcached, Model, OptionsSsr, OptionsWeb, Route, Schema, Server, Handler as ServerHandler, Options as ServerOptions, Routes as ServerRoutes, WebSocket as ServerWebsocket, Ssr, Web, action, body, codeToStatus, config, connection, context, controller, cookies, db, headers, helpers, home, hostname, http, init, json, logerror, method, mixin, mountWithContext as mount, pool, protocol, request, selectControllersSchema, stream, subaction, url, xml };
|
|
959
|
+
export { ApiError, ApiErrorMessage, AsyncJwt, ContextWeb, Controller$1 as Controller, Jwt, Memcached, Model, OptionsSsr, OptionsWeb, ResponseOptions, Route, Schema, Server, Handler as ServerHandler, Options as ServerOptions, Routes as ServerRoutes, WebSocket as ServerWebsocket, Ssr, Web, action, body, codeToStatus, config, connection, context, controller, cookies, db, headers, helpers, home, hostname, http, init, json, logerror, method, mixin, mountWithContext as mount, pool, protocol, request, selectControllersSchema, stream, subaction, url, xml };
|
package/index.js
CHANGED
|
@@ -1104,6 +1104,7 @@ class Web {
|
|
|
1104
1104
|
};
|
|
1105
1105
|
this.res = res;
|
|
1106
1106
|
this.req = req;
|
|
1107
|
+
this.res.onAborted(() => new ApiError.ApiError({ message: "The connection was close", code: 1, statusCode: 404 }));
|
|
1107
1108
|
this.context = context;
|
|
1108
1109
|
}
|
|
1109
1110
|
async request(input = {}) {
|
|
@@ -1125,6 +1126,21 @@ class Web {
|
|
|
1125
1126
|
req: this.req,
|
|
1126
1127
|
res: this.res
|
|
1127
1128
|
};
|
|
1129
|
+
if (["get", "head"].includes(this.contextWeb.method) && this.contextWeb?.stack?.memcached instanceof Memcached) {
|
|
1130
|
+
const memcached = this.contextWeb.stack.memcached;
|
|
1131
|
+
if (memcached.isConnectedServers()) {
|
|
1132
|
+
const cache = await memcached.getPage(this.contextWeb.url);
|
|
1133
|
+
if (cache) {
|
|
1134
|
+
const { data, headers } = cache;
|
|
1135
|
+
this.success({
|
|
1136
|
+
body: data.toString(),
|
|
1137
|
+
headers,
|
|
1138
|
+
statusCode: 200
|
|
1139
|
+
});
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1128
1144
|
this.req.forEach((key, value) => this.contextWeb.headers[key] = value);
|
|
1129
1145
|
const type = this.contextWeb.headers["content-type"] || "application/json";
|
|
1130
1146
|
if (request.controller && request.subaction && this.context.schema) {
|
|
@@ -1267,8 +1283,13 @@ class Web {
|
|
|
1267
1283
|
}
|
|
1268
1284
|
}
|
|
1269
1285
|
success(response) {
|
|
1270
|
-
const
|
|
1286
|
+
const code = response.statusCode || 200;
|
|
1287
|
+
const status = codeToStatus(code);
|
|
1271
1288
|
const body = easyAsh.isObject(response.body) ? JSON.stringify(response.body) : response.body;
|
|
1289
|
+
if (["get", "head"].includes(this.contextWeb.method) && code === 200 && response.memcache && this.contextWeb?.stack?.memcached instanceof Memcached) {
|
|
1290
|
+
const memcached = this.contextWeb.stack.memcached;
|
|
1291
|
+
memcached.setPage(this.contextWeb.url, response.headers, body, response.memcache).then();
|
|
1292
|
+
}
|
|
1272
1293
|
this.res.writeStatus(status);
|
|
1273
1294
|
Object.entries(response.headers).map(([key, value]) => this.res.writeHeader(key, value));
|
|
1274
1295
|
this.res.end(body);
|