@jwn-js/common 2.0.2 → 2.0.6
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/Memcached.d.ts +18 -1
- package/Memcached.js +40 -0
- 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 +4 -4
- package/docs/classes/Jwt.html +1 -1
- package/docs/classes/Memcached.html +20 -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 +1 -1
- 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/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 +1 -1
- package/index.d.ts +39 -1
- package/index.js +5 -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.2</title><meta name="description" content="Documentation for @jwn-js/common - v2.0.2"/><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.2</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.2</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#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>Server<wbr/>Routes</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>helpers</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:37</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.6</title><meta name="description" content="Documentation for @jwn-js/common - v2.0.6"/><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.6</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.6</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#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>Server<wbr/>Routes</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>helpers</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:37</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">
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { HttpResponse, HttpRequest } from 'uWebSockets.js';
|
|
|
6
6
|
export { ApiError, ApiErrorMessage } from './ApiError';
|
|
7
7
|
export { Server, Handler as ServerHandler, Options as ServerOptions, Routes as ServerRoutes, WebSocket as ServerWebsocket, codeToStatus } from './Server';
|
|
8
8
|
export { Jwt } from './Jwt';
|
|
9
|
+
import { Memcached as Memcached$1 } from './Memcached';
|
|
9
10
|
export { Memcached } from './Memcached';
|
|
10
11
|
import { Client } from 'memjs';
|
|
11
12
|
import { Query } from 'buildmsql';
|
|
@@ -80,6 +81,23 @@ declare class Memcached {
|
|
|
80
81
|
constructor(memjs: Client, specialHeaders?: {
|
|
81
82
|
'x-cache': string;
|
|
82
83
|
}, maxKeyLength?: number, debug?: number);
|
|
84
|
+
/**
|
|
85
|
+
* Set value to memcache
|
|
86
|
+
* @param key string key
|
|
87
|
+
* @param value value
|
|
88
|
+
* @param expires expiers in second
|
|
89
|
+
*/
|
|
90
|
+
setValue(key: string, value: string | Buffer, expires: number | undefined | null): Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* Get value from memory
|
|
93
|
+
* @param key string key
|
|
94
|
+
*/
|
|
95
|
+
getValue(key: string): Promise<null | Buffer>;
|
|
96
|
+
/**
|
|
97
|
+
* Delete value
|
|
98
|
+
* @param key
|
|
99
|
+
*/
|
|
100
|
+
deleteValue(key: string): Promise<boolean>;
|
|
83
101
|
/**
|
|
84
102
|
* Set page to cache
|
|
85
103
|
* @param url https://yur.site.net
|
|
@@ -91,7 +109,7 @@ declare class Memcached {
|
|
|
91
109
|
/**
|
|
92
110
|
* Get Page and headers
|
|
93
111
|
* @param url https://your.site.net
|
|
94
|
-
* @
|
|
112
|
+
* @returns {data, headers}
|
|
95
113
|
*/
|
|
96
114
|
getPage(url: string): Promise<null | {
|
|
97
115
|
data: Buffer;
|
|
@@ -228,6 +246,11 @@ interface OptionsWeb {
|
|
|
228
246
|
readonly config: Config$1;
|
|
229
247
|
readonly db: Record<string, Query>;
|
|
230
248
|
readonly schema?: Schema;
|
|
249
|
+
readonly stack?: {
|
|
250
|
+
memcached?: Memcached;
|
|
251
|
+
redis?: any;
|
|
252
|
+
[key: string]: any;
|
|
253
|
+
};
|
|
231
254
|
readonly [key: string]: any;
|
|
232
255
|
}
|
|
233
256
|
interface Response$1 {
|
|
@@ -265,6 +288,11 @@ interface ActionsParmas$1 {
|
|
|
265
288
|
interface ContextWeb$1 extends ActionsParmas$1 {
|
|
266
289
|
readonly config: Config$1;
|
|
267
290
|
readonly db: Record<string, Query>;
|
|
291
|
+
readonly stack: {
|
|
292
|
+
memcached?: Memcached;
|
|
293
|
+
redis?: any;
|
|
294
|
+
[key: string]: any;
|
|
295
|
+
};
|
|
268
296
|
[key: string]: any;
|
|
269
297
|
}
|
|
270
298
|
/**
|
|
@@ -412,6 +440,11 @@ interface ActionsParmas {
|
|
|
412
440
|
interface ContextWeb extends ActionsParmas {
|
|
413
441
|
readonly config: Config;
|
|
414
442
|
readonly db: Record<string, Query>;
|
|
443
|
+
readonly stack: {
|
|
444
|
+
memcached?: Memcached;
|
|
445
|
+
redis?: any;
|
|
446
|
+
[key: string]: any;
|
|
447
|
+
};
|
|
415
448
|
[key: string]: any;
|
|
416
449
|
}
|
|
417
450
|
interface ContextWebController extends ContextWeb {
|
|
@@ -587,6 +620,11 @@ declare class Controller {
|
|
|
587
620
|
getSubaction(): ContextWebController["subaction"];
|
|
588
621
|
getHome(): Query;
|
|
589
622
|
getPool(key?: string): Query;
|
|
623
|
+
getStack(): {
|
|
624
|
+
[key: string]: any;
|
|
625
|
+
memcached?: Memcached$1 | undefined;
|
|
626
|
+
redis?: any;
|
|
627
|
+
};
|
|
590
628
|
setResponseHeader(key: string, value: string): void;
|
|
591
629
|
}
|
|
592
630
|
|
package/index.js
CHANGED
|
@@ -748,7 +748,8 @@ class Web {
|
|
|
748
748
|
hostname: this.req.getHeader("host"),
|
|
749
749
|
protocol: this.req.getHeader("x-forwarded-proto") || "http",
|
|
750
750
|
url: this.req.getUrl(),
|
|
751
|
-
headers: {}
|
|
751
|
+
headers: {},
|
|
752
|
+
stack: this.context.stack || {}
|
|
752
753
|
};
|
|
753
754
|
this.req.forEach((key, value) => this.contextWeb.headers[key] = value);
|
|
754
755
|
const type = this.contextWeb.headers["content-type"] || "application/json";
|
|
@@ -1096,6 +1097,9 @@ class Controller {
|
|
|
1096
1097
|
getPool(key = "home") {
|
|
1097
1098
|
return this.getDb()[key];
|
|
1098
1099
|
}
|
|
1100
|
+
getStack() {
|
|
1101
|
+
return this.$context.stack;
|
|
1102
|
+
}
|
|
1099
1103
|
setResponseHeader(key, value) {
|
|
1100
1104
|
if (this.responseHeaders.hasOwnProperty(key)) {
|
|
1101
1105
|
this.responseHeaders[key] = Array.isArray(this.responseHeaders[key]) ? this.responseHeaders[key] : [this.responseHeaders[key]];
|