@jwn-js/common 1.3.20 → 1.3.24

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.
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>Route | @jwn-js/common - v1.3.20</title>
7
- <meta name="description" content="Documentation for @jwn-js/common - v1.3.20">
6
+ <title>Route | @jwn-js/common - v1.3.24</title>
7
+ <meta name="description" content="Documentation for @jwn-js/common - v1.3.24">
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1">
9
9
  <link rel="stylesheet" href="../assets/css/main.css">
10
10
  <script async src="../assets/js/search.js" id="search-script"></script>
@@ -23,7 +23,7 @@
23
23
  <li class="state loading">Preparing search index...</li>
24
24
  <li class="state failure">The search index is not available</li>
25
25
  </ul>
26
- <a href="../index.html" class="title">@jwn-js/common - v1.3.20</a>
26
+ <a href="../index.html" class="title">@jwn-js/common - v1.3.24</a>
27
27
  </div>
28
28
  <div class="table-cell" id="tsd-widgets">
29
29
  <div id="tsd-filter">
@@ -52,7 +52,7 @@
52
52
  <div class="container">
53
53
  <ul class="tsd-breadcrumb">
54
54
  <li>
55
- <a href="../modules.html">@jwn-js/common - v1.3.20</a>
55
+ <a href="../modules.html">@jwn-js/common - v1.3.24</a>
56
56
  </li>
57
57
  <li>
58
58
  <a href="Route.html">Route</a>
@@ -179,9 +179,6 @@
179
179
  <ul class="tsd-legend">
180
180
  <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
181
181
  </ul>
182
- <ul class="tsd-legend">
183
- <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
184
- </ul>
185
182
  </div>
186
183
  </div>
187
184
  </footer>
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>Schema | @jwn-js/common - v1.3.20</title>
7
- <meta name="description" content="Documentation for @jwn-js/common - v1.3.20">
6
+ <title>Schema | @jwn-js/common - v1.3.24</title>
7
+ <meta name="description" content="Documentation for @jwn-js/common - v1.3.24">
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1">
9
9
  <link rel="stylesheet" href="../assets/css/main.css">
10
10
  <script async src="../assets/js/search.js" id="search-script"></script>
@@ -23,7 +23,7 @@
23
23
  <li class="state loading">Preparing search index...</li>
24
24
  <li class="state failure">The search index is not available</li>
25
25
  </ul>
26
- <a href="../index.html" class="title">@jwn-js/common - v1.3.20</a>
26
+ <a href="../index.html" class="title">@jwn-js/common - v1.3.24</a>
27
27
  </div>
28
28
  <div class="table-cell" id="tsd-widgets">
29
29
  <div id="tsd-filter">
@@ -52,7 +52,7 @@
52
52
  <div class="container">
53
53
  <ul class="tsd-breadcrumb">
54
54
  <li>
55
- <a href="../modules.html">@jwn-js/common - v1.3.20</a>
55
+ <a href="../modules.html">@jwn-js/common - v1.3.24</a>
56
56
  </li>
57
57
  <li>
58
58
  <a href="Schema.html">Schema</a>
@@ -165,9 +165,6 @@
165
165
  <ul class="tsd-legend">
166
166
  <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
167
167
  </ul>
168
- <ul class="tsd-legend">
169
- <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
170
- </ul>
171
168
  </div>
172
169
  </div>
173
170
  </footer>
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>ServerHandler | @jwn-js/common - v1.3.20</title>
7
- <meta name="description" content="Documentation for @jwn-js/common - v1.3.20">
6
+ <title>ServerHandler | @jwn-js/common - v1.3.24</title>
7
+ <meta name="description" content="Documentation for @jwn-js/common - v1.3.24">
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1">
9
9
  <link rel="stylesheet" href="../assets/css/main.css">
10
10
  <script async src="../assets/js/search.js" id="search-script"></script>
@@ -23,7 +23,7 @@
23
23
  <li class="state loading">Preparing search index...</li>
24
24
  <li class="state failure">The search index is not available</li>
25
25
  </ul>
26
- <a href="../index.html" class="title">@jwn-js/common - v1.3.20</a>
26
+ <a href="../index.html" class="title">@jwn-js/common - v1.3.24</a>
27
27
  </div>
28
28
  <div class="table-cell" id="tsd-widgets">
29
29
  <div id="tsd-filter">
@@ -52,7 +52,7 @@
52
52
  <div class="container">
53
53
  <ul class="tsd-breadcrumb">
54
54
  <li>
55
- <a href="../modules.html">@jwn-js/common - v1.3.20</a>
55
+ <a href="../modules.html">@jwn-js/common - v1.3.24</a>
56
56
  </li>
57
57
  <li>
58
58
  <a href="ServerHandler.html">ServerHandler</a>
@@ -206,9 +206,6 @@
206
206
  <ul class="tsd-legend">
207
207
  <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
208
208
  </ul>
209
- <ul class="tsd-legend">
210
- <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
211
- </ul>
212
209
  </div>
213
210
  </div>
214
211
  </footer>
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>ServerOptions | @jwn-js/common - v1.3.20</title>
7
- <meta name="description" content="Documentation for @jwn-js/common - v1.3.20">
6
+ <title>ServerOptions | @jwn-js/common - v1.3.24</title>
7
+ <meta name="description" content="Documentation for @jwn-js/common - v1.3.24">
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1">
9
9
  <link rel="stylesheet" href="../assets/css/main.css">
10
10
  <script async src="../assets/js/search.js" id="search-script"></script>
@@ -23,7 +23,7 @@
23
23
  <li class="state loading">Preparing search index...</li>
24
24
  <li class="state failure">The search index is not available</li>
25
25
  </ul>
26
- <a href="../index.html" class="title">@jwn-js/common - v1.3.20</a>
26
+ <a href="../index.html" class="title">@jwn-js/common - v1.3.24</a>
27
27
  </div>
28
28
  <div class="table-cell" id="tsd-widgets">
29
29
  <div id="tsd-filter">
@@ -52,7 +52,7 @@
52
52
  <div class="container">
53
53
  <ul class="tsd-breadcrumb">
54
54
  <li>
55
- <a href="../modules.html">@jwn-js/common - v1.3.20</a>
55
+ <a href="../modules.html">@jwn-js/common - v1.3.24</a>
56
56
  </li>
57
57
  <li>
58
58
  <a href="ServerOptions.html">ServerOptions</a>
@@ -221,9 +221,6 @@
221
221
  <ul class="tsd-legend">
222
222
  <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
223
223
  </ul>
224
- <ul class="tsd-legend">
225
- <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
226
- </ul>
227
224
  </div>
228
225
  </div>
229
226
  </footer>
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>ServerWebsocket | @jwn-js/common - v1.3.20</title>
7
- <meta name="description" content="Documentation for @jwn-js/common - v1.3.20">
6
+ <title>ServerWebsocket | @jwn-js/common - v1.3.24</title>
7
+ <meta name="description" content="Documentation for @jwn-js/common - v1.3.24">
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1">
9
9
  <link rel="stylesheet" href="../assets/css/main.css">
10
10
  <script async src="../assets/js/search.js" id="search-script"></script>
@@ -23,7 +23,7 @@
23
23
  <li class="state loading">Preparing search index...</li>
24
24
  <li class="state failure">The search index is not available</li>
25
25
  </ul>
26
- <a href="../index.html" class="title">@jwn-js/common - v1.3.20</a>
26
+ <a href="../index.html" class="title">@jwn-js/common - v1.3.24</a>
27
27
  </div>
28
28
  <div class="table-cell" id="tsd-widgets">
29
29
  <div id="tsd-filter">
@@ -52,7 +52,7 @@
52
52
  <div class="container">
53
53
  <ul class="tsd-breadcrumb">
54
54
  <li>
55
- <a href="../modules.html">@jwn-js/common - v1.3.20</a>
55
+ <a href="../modules.html">@jwn-js/common - v1.3.24</a>
56
56
  </li>
57
57
  <li>
58
58
  <a href="ServerWebsocket.html">ServerWebsocket</a>
@@ -179,9 +179,6 @@
179
179
  <ul class="tsd-legend">
180
180
  <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
181
181
  </ul>
182
- <ul class="tsd-legend">
183
- <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
184
- </ul>
185
182
  </div>
186
183
  </div>
187
184
  </footer>
package/docs/modules.html CHANGED
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <title>@jwn-js/common - v1.3.20</title>
7
- <meta name="description" content="Documentation for @jwn-js/common - v1.3.20">
6
+ <title>@jwn-js/common - v1.3.24</title>
7
+ <meta name="description" content="Documentation for @jwn-js/common - v1.3.24">
8
8
  <meta name="viewport" content="width=device-width, initial-scale=1">
9
9
  <link rel="stylesheet" href="assets/css/main.css">
10
10
  <script async src="assets/js/search.js" id="search-script"></script>
@@ -23,7 +23,7 @@
23
23
  <li class="state loading">Preparing search index...</li>
24
24
  <li class="state failure">The search index is not available</li>
25
25
  </ul>
26
- <a href="index.html" class="title">@jwn-js/common - v1.3.20</a>
26
+ <a href="index.html" class="title">@jwn-js/common - v1.3.24</a>
27
27
  </div>
28
28
  <div class="table-cell" id="tsd-widgets">
29
29
  <div id="tsd-filter">
@@ -50,7 +50,7 @@
50
50
  </div>
51
51
  <div class="tsd-page-title">
52
52
  <div class="container">
53
- <h1>@jwn-js/common - v1.3.20</h1>
53
+ <h1>@jwn-js/common - v1.3.24</h1>
54
54
  </div>
55
55
  </div>
56
56
  </header>
@@ -65,6 +65,7 @@
65
65
  <h3>Classes</h3>
66
66
  <ul class="tsd-index-list">
67
67
  <li class="tsd-kind-class"><a href="classes/ApiError.html" class="tsd-kind-icon">Api<wbr>Error</a></li>
68
+ <li class="tsd-kind-class"><a href="classes/AsyncJwt.html" class="tsd-kind-icon">Async<wbr>Jwt</a></li>
68
69
  <li class="tsd-kind-class"><a href="classes/Controller.html" class="tsd-kind-icon">Controller</a></li>
69
70
  <li class="tsd-kind-class"><a href="classes/Jwt.html" class="tsd-kind-icon">Jwt</a></li>
70
71
  <li class="tsd-kind-class"><a href="classes/Memcached.html" class="tsd-kind-icon">Memcached</a></li>
@@ -162,7 +163,7 @@
162
163
  <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"> =&gt; </span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</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">&gt;</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">&lt;</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">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </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"> =&gt; </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"> =&gt; </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</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"> =&gt; </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</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"> =&gt; </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Buffer</span><span class="tsd-signature-symbol">&gt;</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"> =&gt; </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</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"> =&gt; </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"> =&gt; </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</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"> =&gt; </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"> =&gt; </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
163
164
  <aside class="tsd-sources">
164
165
  <ul>
165
- <li>Defined in src/index.ts:35</li>
166
+ <li>Defined in src/index.ts:36</li>
166
167
  </ul>
167
168
  </aside>
168
169
  <div class="tsd-comment tsd-typography">
@@ -546,7 +547,7 @@
546
547
  <li class="tsd-description">
547
548
  <aside class="tsd-sources">
548
549
  <ul>
549
- <li>Defined in src/Web/decorators.ts:216</li>
550
+ <li>Defined in src/Web/decorators.ts:217</li>
550
551
  </ul>
551
552
  </aside>
552
553
  <div class="tsd-comment tsd-typography">
@@ -594,7 +595,7 @@
594
595
  <li class="tsd-description">
595
596
  <aside class="tsd-sources">
596
597
  <ul>
597
- <li>Defined in src/Web/decorators.ts:236</li>
598
+ <li>Defined in src/Web/decorators.ts:237</li>
598
599
  </ul>
599
600
  </aside>
600
601
  <div class="tsd-comment tsd-typography">
@@ -670,7 +671,7 @@
670
671
  <li class="tsd-description">
671
672
  <aside class="tsd-sources">
672
673
  <ul>
673
- <li>Defined in src/Web/decorators.ts:126</li>
674
+ <li>Defined in src/Web/decorators.ts:127</li>
674
675
  </ul>
675
676
  </aside>
676
677
  <div class="tsd-comment tsd-typography">
@@ -718,7 +719,7 @@
718
719
  <li class="tsd-description">
719
720
  <aside class="tsd-sources">
720
721
  <ul>
721
- <li>Defined in src/Web/decorators.ts:276</li>
722
+ <li>Defined in src/Web/decorators.ts:277</li>
722
723
  </ul>
723
724
  </aside>
724
725
  <div class="tsd-comment tsd-typography">
@@ -772,7 +773,7 @@
772
773
  <li class="tsd-description">
773
774
  <aside class="tsd-sources">
774
775
  <ul>
775
- <li>Defined in src/Web/decorators.ts:116</li>
776
+ <li>Defined in src/Web/decorators.ts:117</li>
776
777
  </ul>
777
778
  </aside>
778
779
  <div class="tsd-comment tsd-typography">
@@ -820,7 +821,7 @@
820
821
  <li class="tsd-description">
821
822
  <aside class="tsd-sources">
822
823
  <ul>
823
- <li>Defined in src/Web/decorators.ts:206</li>
824
+ <li>Defined in src/Web/decorators.ts:207</li>
824
825
  </ul>
825
826
  </aside>
826
827
  <div class="tsd-comment tsd-typography">
@@ -868,7 +869,7 @@
868
869
  <li class="tsd-description">
869
870
  <aside class="tsd-sources">
870
871
  <ul>
871
- <li>Defined in src/Web/decorators.ts:146</li>
872
+ <li>Defined in src/Web/decorators.ts:147</li>
872
873
  </ul>
873
874
  </aside>
874
875
  <div class="tsd-comment tsd-typography">
@@ -916,7 +917,7 @@
916
917
  <li class="tsd-description">
917
918
  <aside class="tsd-sources">
918
919
  <ul>
919
- <li>Defined in src/Web/decorators.ts:186</li>
920
+ <li>Defined in src/Web/decorators.ts:187</li>
920
921
  </ul>
921
922
  </aside>
922
923
  <div class="tsd-comment tsd-typography">
@@ -964,7 +965,7 @@
964
965
  <li class="tsd-description">
965
966
  <aside class="tsd-sources">
966
967
  <ul>
967
- <li>Defined in src/Web/decorators.ts:196</li>
968
+ <li>Defined in src/Web/decorators.ts:197</li>
968
969
  </ul>
969
970
  </aside>
970
971
  <div class="tsd-comment tsd-typography">
@@ -1012,7 +1013,7 @@
1012
1013
  <li class="tsd-description">
1013
1014
  <aside class="tsd-sources">
1014
1015
  <ul>
1015
- <li>Defined in src/Web/decorators.ts:256</li>
1016
+ <li>Defined in src/Web/decorators.ts:257</li>
1016
1017
  </ul>
1017
1018
  </aside>
1018
1019
  <div class="tsd-comment tsd-typography">
@@ -1060,7 +1061,7 @@
1060
1061
  <li class="tsd-description">
1061
1062
  <aside class="tsd-sources">
1062
1063
  <ul>
1063
- <li>Defined in src/Web/decorators.ts:156</li>
1064
+ <li>Defined in src/Web/decorators.ts:157</li>
1064
1065
  </ul>
1065
1066
  </aside>
1066
1067
  <div class="tsd-comment tsd-typography">
@@ -1108,7 +1109,7 @@
1108
1109
  <li class="tsd-description">
1109
1110
  <aside class="tsd-sources">
1110
1111
  <ul>
1111
- <li>Defined in src/Web/decorators.ts:320</li>
1112
+ <li>Defined in src/Web/decorators.ts:321</li>
1112
1113
  </ul>
1113
1114
  </aside>
1114
1115
  <div class="tsd-comment tsd-typography">
@@ -1159,7 +1160,7 @@
1159
1160
  <li class="tsd-description">
1160
1161
  <aside class="tsd-sources">
1161
1162
  <ul>
1162
- <li>Defined in src/Web/decorators.ts:418</li>
1163
+ <li>Defined in src/Web/decorators.ts:423</li>
1163
1164
  </ul>
1164
1165
  </aside>
1165
1166
  <div class="tsd-comment tsd-typography">
@@ -1207,7 +1208,7 @@
1207
1208
  <li class="tsd-description">
1208
1209
  <aside class="tsd-sources">
1209
1210
  <ul>
1210
- <li>Defined in src/Web/decorators.ts:287</li>
1211
+ <li>Defined in src/Web/decorators.ts:288</li>
1211
1212
  </ul>
1212
1213
  </aside>
1213
1214
  <div class="tsd-comment tsd-typography">
@@ -1262,7 +1263,7 @@
1262
1263
  <li class="tsd-description">
1263
1264
  <aside class="tsd-sources">
1264
1265
  <ul>
1265
- <li>Defined in src/Web/decorators.ts:309</li>
1266
+ <li>Defined in src/Web/decorators.ts:310</li>
1266
1267
  </ul>
1267
1268
  </aside>
1268
1269
  <div class="tsd-comment tsd-typography">
@@ -1317,7 +1318,7 @@
1317
1318
  <li class="tsd-description">
1318
1319
  <aside class="tsd-sources">
1319
1320
  <ul>
1320
- <li>Defined in src/Web/decorators.ts:136</li>
1321
+ <li>Defined in src/Web/decorators.ts:137</li>
1321
1322
  </ul>
1322
1323
  </aside>
1323
1324
  <div class="tsd-comment tsd-typography">
@@ -1365,7 +1366,7 @@
1365
1366
  <li class="tsd-description">
1366
1367
  <aside class="tsd-sources">
1367
1368
  <ul>
1368
- <li>Defined in src/Web/decorators.ts:44</li>
1369
+ <li>Defined in src/Web/decorators.ts:45</li>
1369
1370
  </ul>
1370
1371
  </aside>
1371
1372
  <div class="tsd-comment tsd-typography">
@@ -1479,7 +1480,7 @@
1479
1480
  <li class="tsd-description">
1480
1481
  <aside class="tsd-sources">
1481
1482
  <ul>
1482
- <li>Defined in src/Web/decorators.ts:266</li>
1483
+ <li>Defined in src/Web/decorators.ts:267</li>
1483
1484
  </ul>
1484
1485
  </aside>
1485
1486
  <div class="tsd-comment tsd-typography">
@@ -1533,7 +1534,7 @@
1533
1534
  <li class="tsd-description">
1534
1535
  <aside class="tsd-sources">
1535
1536
  <ul>
1536
- <li>Defined in src/Web/decorators.ts:176</li>
1537
+ <li>Defined in src/Web/decorators.ts:177</li>
1537
1538
  </ul>
1538
1539
  </aside>
1539
1540
  <div class="tsd-comment tsd-typography">
@@ -1581,7 +1582,7 @@
1581
1582
  <li class="tsd-description">
1582
1583
  <aside class="tsd-sources">
1583
1584
  <ul>
1584
- <li>Defined in src/Web/decorators.ts:106</li>
1585
+ <li>Defined in src/Web/decorators.ts:107</li>
1585
1586
  </ul>
1586
1587
  </aside>
1587
1588
  <div class="tsd-comment tsd-typography">
@@ -1629,7 +1630,7 @@
1629
1630
  <li class="tsd-description">
1630
1631
  <aside class="tsd-sources">
1631
1632
  <ul>
1632
- <li>Defined in src/Web/decorators.ts:246</li>
1633
+ <li>Defined in src/Web/decorators.ts:247</li>
1633
1634
  </ul>
1634
1635
  </aside>
1635
1636
  <div class="tsd-comment tsd-typography">
@@ -1677,7 +1678,7 @@
1677
1678
  <li class="tsd-description">
1678
1679
  <aside class="tsd-sources">
1679
1680
  <ul>
1680
- <li>Defined in src/Web/decorators.ts:226</li>
1681
+ <li>Defined in src/Web/decorators.ts:227</li>
1681
1682
  </ul>
1682
1683
  </aside>
1683
1684
  <div class="tsd-comment tsd-typography">
@@ -1725,7 +1726,7 @@
1725
1726
  <li class="tsd-description">
1726
1727
  <aside class="tsd-sources">
1727
1728
  <ul>
1728
- <li>Defined in src/Web/decorators.ts:166</li>
1729
+ <li>Defined in src/Web/decorators.ts:167</li>
1729
1730
  </ul>
1730
1731
  </aside>
1731
1732
  <div class="tsd-comment tsd-typography">
@@ -1773,7 +1774,7 @@
1773
1774
  <li class="tsd-description">
1774
1775
  <aside class="tsd-sources">
1775
1776
  <ul>
1776
- <li>Defined in src/Web/decorators.ts:298</li>
1777
+ <li>Defined in src/Web/decorators.ts:299</li>
1777
1778
  </ul>
1778
1779
  </aside>
1779
1780
  <div class="tsd-comment tsd-typography">
@@ -1833,6 +1834,9 @@
1833
1834
  <li class=" tsd-kind-class">
1834
1835
  <a href="classes/ApiError.html" class="tsd-kind-icon">Api<wbr>Error</a>
1835
1836
  </li>
1837
+ <li class=" tsd-kind-class">
1838
+ <a href="classes/AsyncJwt.html" class="tsd-kind-icon">Async<wbr>Jwt</a>
1839
+ </li>
1836
1840
  <li class=" tsd-kind-class">
1837
1841
  <a href="classes/Controller.html" class="tsd-kind-icon">Controller</a>
1838
1842
  </li>
@@ -1989,9 +1993,6 @@
1989
1993
  <ul class="tsd-legend">
1990
1994
  <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
1991
1995
  </ul>
1992
- <ul class="tsd-legend">
1993
- <li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
1994
- </ul>
1995
1996
  </div>
1996
1997
  </div>
1997
1998
  </footer>
package/index.d.ts CHANGED
@@ -11,6 +11,51 @@ import { Client } from 'memjs';
11
11
  import { Query } from 'buildmsql';
12
12
  export { Context as ContextSsr } from 'vite-ssr-vue';
13
13
 
14
+ /**
15
+ * @class Jwt
16
+ * @description working with jwt tokens use webcrypto
17
+ */
18
+ declare class AsyncJwt {
19
+ private readonly secret;
20
+ private readonly algorithm;
21
+ /**
22
+ * @constructor
23
+ * @param secret
24
+ * @param opt addition options
25
+ */
26
+ constructor(secret: string, opt?: {
27
+ algorithm: string;
28
+ });
29
+ /**
30
+ * Verify jwt token
31
+ * @param jwt token
32
+ * @returns is token valid
33
+ */
34
+ verify(jwt: string): Promise<boolean>;
35
+ /**
36
+ * Get token
37
+ * @param data - user data
38
+ * @returns jwt
39
+ */
40
+ sign(data: any): Promise<string>;
41
+ /**
42
+ * Decode token
43
+ * @param jwt - jwt token
44
+ * @returns {head, body}
45
+ */
46
+ decode(jwt: string): {
47
+ head: any;
48
+ body: any;
49
+ };
50
+ /**
51
+ * Sign
52
+ * @param str input string
53
+ * @returns base64 sign
54
+ * @private
55
+ */
56
+ private signString;
57
+ }
58
+
14
59
  /**
15
60
  * Reed static files
16
61
  * @param req
@@ -675,4 +720,4 @@ declare const helpers: {
675
720
  getExt: (path: string) => string;
676
721
  };
677
722
 
678
- export { ContextWeb$1 as ContextWeb, Controller, Model, OptionsSsr, OptionsWeb, Route$1 as Route, Schema, Ssr, Web, action, body, config, connection, context, controller, cookies, db, headers, helpers, home, hostname, http, init, json, logerror, method, mixin, mountWithContext as mount, pool, protocol, request, stream, subaction, url, xml };
723
+ export { AsyncJwt, ContextWeb$1 as ContextWeb, Controller, Model, OptionsSsr, OptionsWeb, Route$1 as Route, Schema, Ssr, Web, action, body, config, connection, context, controller, cookies, db, headers, helpers, home, hostname, http, init, json, logerror, method, mixin, mountWithContext as mount, pool, protocol, request, stream, subaction, url, xml };
package/index.js CHANGED
@@ -4,7 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var ApiError = require('./ApiError.js');
6
6
  var Server = require('./Server-77093d28.js');
7
- var Jwt = require('./Jwt.js');
7
+ var Jwt = require('./Jwt-f1da5291.js');
8
+ var crypto = require('crypto');
9
+ var util = require('util');
8
10
  var Memcached = require('./Memcached.js');
9
11
  var jsonBody$1 = require('./jsonBody.js');
10
12
  var ApiError$1 = require('./ApiError-b517f53a.js');
@@ -24,7 +26,6 @@ var querystring = require('querystring');
24
26
  var xmljs = require('xml-js');
25
27
  var formidable = require('formidable');
26
28
  require('reflect-metadata');
27
- require('crypto');
28
29
 
29
30
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
30
31
 
@@ -34,6 +35,49 @@ var querystring__default = /*#__PURE__*/_interopDefaultLegacy(querystring);
34
35
  var xmljs__default = /*#__PURE__*/_interopDefaultLegacy(xmljs);
35
36
  var formidable__default = /*#__PURE__*/_interopDefaultLegacy(formidable);
36
37
 
38
+ const { subtle } = crypto.webcrypto;
39
+ class AsyncJwt {
40
+ constructor(secret, opt) {
41
+ this.algorithm = "SHA-256";
42
+ this.secret = secret;
43
+ this.algorithm = opt?.algorithm || this.algorithm;
44
+ this.algorithm = this.algorithm.replace("-", "").replace("SHA", "SHA-");
45
+ }
46
+ async verify(jwt) {
47
+ if (!jwt) {
48
+ return false;
49
+ }
50
+ const parts = jwt.split(".");
51
+ const signature = await this.signString(`${parts[0]}.${parts[1]}`);
52
+ return signature === parts[2];
53
+ }
54
+ async sign(data) {
55
+ const head = Jwt.toBase64url({
56
+ alg: this.algorithm.replace("-", "").replace("SHA", "HS"),
57
+ typ: "JWT"
58
+ });
59
+ const body = Jwt.toBase64url(data);
60
+ const signature = await this.signString(`${head}.${body}`);
61
+ return `${head}.${body}.${signature}`;
62
+ }
63
+ decode(jwt) {
64
+ const parts = (jwt || "").split(".");
65
+ const head = Jwt.fromBase64url(parts[0]);
66
+ const body = Jwt.fromBase64url(parts[1]);
67
+ return { head, body };
68
+ }
69
+ async signString(str) {
70
+ const enc = new util.TextEncoder();
71
+ const key = await subtle.importKey("raw", enc.encode(this.secret), {
72
+ name: "HMAC",
73
+ hash: {
74
+ name: this.algorithm
75
+ }
76
+ }, false, ["sign", "verify"]);
77
+ return Jwt.urlEncode(Buffer.from(await subtle.sign("HMAC", key, enc.encode(str))).toString("base64"));
78
+ }
79
+ }
80
+
37
81
  const rawBody$1 = (res, req) => new Promise((resolve, reject) => {
38
82
  readRaw$1(res, (obj) => {
39
83
  resolve(obj);
@@ -1291,17 +1335,20 @@ function http() {
1291
1335
  }
1292
1336
  } catch (e) {
1293
1337
  await Promise.all([...connections.map((connection2) => connection2.rollback())]);
1338
+ let output;
1339
+ if (response.type === "xml") {
1340
+ output = this.errorXml(e);
1341
+ } else {
1342
+ output = this.error(e);
1343
+ }
1294
1344
  for (const key in existingLoggers) {
1295
1345
  if (!existingLoggers.hasOwnProperty(key)) {
1296
1346
  continue;
1297
1347
  }
1298
1348
  const logger = existingLoggers[key].params;
1299
- await this[logger].error(e);
1300
- }
1301
- if (response.type === "xml") {
1302
- return this.errorXml(e);
1349
+ await this[logger].error(e, { response: easyAsh.omit(output?.body || {}, ["stack"]) });
1303
1350
  }
1304
- return this.error(e);
1351
+ return output;
1305
1352
  } finally {
1306
1353
  await Promise.all([...connections.map((connection2) => connection2.release())]);
1307
1354
  }
@@ -1339,6 +1386,7 @@ exports.Server = Server.Server;
1339
1386
  exports.codeToStatus = Server.codeToStatus;
1340
1387
  exports.Jwt = Jwt.Jwt;
1341
1388
  exports.Memcached = Memcached.Memcached;
1389
+ exports.AsyncJwt = AsyncJwt;
1342
1390
  exports.Controller = Controller;
1343
1391
  exports.Model = Model;
1344
1392
  exports.Ssr = Ssr;