@jwn-js/common 1.3.3 → 1.3.7

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/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.3</title>
7
- <meta name="description" content="Documentation for @jwn-js/common - v1.3.3">
6
+ <title>@jwn-js/common - v1.3.7</title>
7
+ <meta name="description" content="Documentation for @jwn-js/common - v1.3.7">
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.3</a>
26
+ <a href="index.html" class="title">@jwn-js/common - v1.3.7</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.3</h1>
53
+ <h1>@jwn-js/common - v1.3.7</h1>
54
54
  </div>
55
55
  </div>
56
56
  </header>
@@ -78,8 +78,11 @@
78
78
  <h3>Interfaces</h3>
79
79
  <ul class="tsd-index-list">
80
80
  <li class="tsd-kind-interface"><a href="interfaces/ApiErrorMessage.html" class="tsd-kind-icon">Api<wbr>Error<wbr>Message</a></li>
81
- <li class="tsd-kind-interface"><a href="interfaces/ContextSsr.html" class="tsd-kind-icon">Context<wbr>Ssr</a></li>
81
+ <li class="tsd-kind-interface tsd-is-external"><a href="interfaces/ContextSsr.html" class="tsd-kind-icon">Context<wbr>Ssr</a></li>
82
82
  <li class="tsd-kind-interface"><a href="interfaces/ContextWeb.html" class="tsd-kind-icon">Context<wbr>Web</a></li>
83
+ <li class="tsd-kind-interface"><a href="interfaces/OptionsSsr.html" class="tsd-kind-icon">Options<wbr>Ssr</a></li>
84
+ <li class="tsd-kind-interface"><a href="interfaces/OptionsWeb.html" class="tsd-kind-icon">Options<wbr>Web</a></li>
85
+ <li class="tsd-kind-interface"><a href="interfaces/Route.html" class="tsd-kind-icon">Route</a></li>
83
86
  <li class="tsd-kind-interface"><a href="interfaces/ServerHandler.html" class="tsd-kind-icon">Server<wbr>Handler</a></li>
84
87
  <li class="tsd-kind-interface"><a href="interfaces/ServerOptions.html" class="tsd-kind-icon">Server<wbr>Options</a></li>
85
88
  <li class="tsd-kind-interface"><a href="interfaces/ServerWebsocket.html" class="tsd-kind-icon">Server<wbr>Websocket</a></li>
@@ -119,6 +122,7 @@
119
122
  <li class="tsd-kind-function"><a href="modules.html#method" class="tsd-kind-icon">method</a></li>
120
123
  <li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mixin" class="tsd-kind-icon">mixin</a></li>
121
124
  <li class="tsd-kind-function tsd-has-type-parameter"><a href="modules.html#mount" class="tsd-kind-icon">mount</a></li>
125
+ <li class="tsd-kind-function"><a href="modules.html#pool" class="tsd-kind-icon">pool</a></li>
122
126
  <li class="tsd-kind-function"><a href="modules.html#protocol" class="tsd-kind-icon">protocol</a></li>
123
127
  <li class="tsd-kind-function"><a href="modules.html#request" class="tsd-kind-icon">request</a></li>
124
128
  <li class="tsd-kind-function"><a href="modules.html#stream" class="tsd-kind-icon">stream</a></li>
@@ -157,7 +161,7 @@
157
161
  <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>
158
162
  <aside class="tsd-sources">
159
163
  <ul>
160
- <li>Defined in src/index.ts:33</li>
164
+ <li>Defined in src/index.ts:34</li>
161
165
  </ul>
162
166
  </aside>
163
167
  <div class="tsd-comment tsd-typography">
@@ -713,7 +717,7 @@
713
717
  <li class="tsd-description">
714
718
  <aside class="tsd-sources">
715
719
  <ul>
716
- <li>Defined in src/Web/decorators.ts:266</li>
720
+ <li>Defined in src/Web/decorators.ts:276</li>
717
721
  </ul>
718
722
  </aside>
719
723
  <div class="tsd-comment tsd-typography">
@@ -726,7 +730,7 @@
726
730
  <h4 class="tsd-parameters-title">Parameters</h4>
727
731
  <ul class="tsd-parameters">
728
732
  <li>
729
- <h5>name: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &#x27;home&#x27;</span></h5>
733
+ <h5>name: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;home&quot;</span></h5>
730
734
  </li>
731
735
  </ul>
732
736
  <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><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, parameterIndex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h4>
@@ -1103,7 +1107,7 @@
1103
1107
  <li class="tsd-description">
1104
1108
  <aside class="tsd-sources">
1105
1109
  <ul>
1106
- <li>Defined in src/Web/decorators.ts:310</li>
1110
+ <li>Defined in src/Web/decorators.ts:320</li>
1107
1111
  </ul>
1108
1112
  </aside>
1109
1113
  <div class="tsd-comment tsd-typography">
@@ -1154,7 +1158,7 @@
1154
1158
  <li class="tsd-description">
1155
1159
  <aside class="tsd-sources">
1156
1160
  <ul>
1157
- <li>Defined in src/Web/decorators.ts:406</li>
1161
+ <li>Defined in src/Web/decorators.ts:418</li>
1158
1162
  </ul>
1159
1163
  </aside>
1160
1164
  <div class="tsd-comment tsd-typography">
@@ -1202,7 +1206,7 @@
1202
1206
  <li class="tsd-description">
1203
1207
  <aside class="tsd-sources">
1204
1208
  <ul>
1205
- <li>Defined in src/Web/decorators.ts:277</li>
1209
+ <li>Defined in src/Web/decorators.ts:287</li>
1206
1210
  </ul>
1207
1211
  </aside>
1208
1212
  <div class="tsd-comment tsd-typography">
@@ -1257,7 +1261,7 @@
1257
1261
  <li class="tsd-description">
1258
1262
  <aside class="tsd-sources">
1259
1263
  <ul>
1260
- <li>Defined in src/Web/decorators.ts:299</li>
1264
+ <li>Defined in src/Web/decorators.ts:309</li>
1261
1265
  </ul>
1262
1266
  </aside>
1263
1267
  <div class="tsd-comment tsd-typography">
@@ -1464,6 +1468,60 @@
1464
1468
  </li>
1465
1469
  </ul>
1466
1470
  </section>
1471
+ <section class="tsd-panel tsd-member tsd-kind-function">
1472
+ <a name="pool" class="tsd-anchor"></a>
1473
+ <h3>pool</h3>
1474
+ <ul class="tsd-signatures tsd-kind-function">
1475
+ <li class="tsd-signature tsd-kind-icon">pool<span class="tsd-signature-symbol">(</span>name<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>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><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, parameterIndex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></li>
1476
+ </ul>
1477
+ <ul class="tsd-descriptions">
1478
+ <li class="tsd-description">
1479
+ <aside class="tsd-sources">
1480
+ <ul>
1481
+ <li>Defined in src/Web/decorators.ts:266</li>
1482
+ </ul>
1483
+ </aside>
1484
+ <div class="tsd-comment tsd-typography">
1485
+ <dl class="tsd-comment-tags">
1486
+ <dt>pool()</dt>
1487
+ <dd><p>decorator</p>
1488
+ </dd>
1489
+ </dl>
1490
+ </div>
1491
+ <h4 class="tsd-parameters-title">Parameters</h4>
1492
+ <ul class="tsd-parameters">
1493
+ <li>
1494
+ <h5>name: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;home&quot;</span></h5>
1495
+ </li>
1496
+ </ul>
1497
+ <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><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, parameterIndex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h4>
1498
+ <ul class="tsd-parameters">
1499
+ <li class="tsd-parameter-signature">
1500
+ <ul class="tsd-signatures tsd-kind-type-literal">
1501
+ <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><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span>, parameterIndex<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
1502
+ </ul>
1503
+ <ul class="tsd-descriptions">
1504
+ <li class="tsd-description">
1505
+ <h4 class="tsd-parameters-title">Parameters</h4>
1506
+ <ul class="tsd-parameters">
1507
+ <li>
1508
+ <h5>target: <span class="tsd-signature-type">any</span></h5>
1509
+ </li>
1510
+ <li>
1511
+ <h5>propertyKey: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
1512
+ </li>
1513
+ <li>
1514
+ <h5>parameterIndex: <span class="tsd-signature-type">number</span></h5>
1515
+ </li>
1516
+ </ul>
1517
+ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
1518
+ </li>
1519
+ </ul>
1520
+ </li>
1521
+ </ul>
1522
+ </li>
1523
+ </ul>
1524
+ </section>
1467
1525
  <section class="tsd-panel tsd-member tsd-kind-function">
1468
1526
  <a name="protocol" class="tsd-anchor"></a>
1469
1527
  <h3>protocol</h3>
@@ -1714,7 +1772,7 @@
1714
1772
  <li class="tsd-description">
1715
1773
  <aside class="tsd-sources">
1716
1774
  <ul>
1717
- <li>Defined in src/Web/decorators.ts:288</li>
1775
+ <li>Defined in src/Web/decorators.ts:298</li>
1718
1776
  </ul>
1719
1777
  </aside>
1720
1778
  <div class="tsd-comment tsd-typography">
@@ -1798,12 +1856,21 @@
1798
1856
  <li class=" tsd-kind-interface">
1799
1857
  <a href="interfaces/ApiErrorMessage.html" class="tsd-kind-icon">Api<wbr>Error<wbr>Message</a>
1800
1858
  </li>
1801
- <li class=" tsd-kind-interface">
1859
+ <li class=" tsd-kind-interface tsd-is-external">
1802
1860
  <a href="interfaces/ContextSsr.html" class="tsd-kind-icon">Context<wbr>Ssr</a>
1803
1861
  </li>
1804
1862
  <li class=" tsd-kind-interface">
1805
1863
  <a href="interfaces/ContextWeb.html" class="tsd-kind-icon">Context<wbr>Web</a>
1806
1864
  </li>
1865
+ <li class=" tsd-kind-interface">
1866
+ <a href="interfaces/OptionsSsr.html" class="tsd-kind-icon">Options<wbr>Ssr</a>
1867
+ </li>
1868
+ <li class=" tsd-kind-interface">
1869
+ <a href="interfaces/OptionsWeb.html" class="tsd-kind-icon">Options<wbr>Web</a>
1870
+ </li>
1871
+ <li class=" tsd-kind-interface">
1872
+ <a href="interfaces/Route.html" class="tsd-kind-icon">Route</a>
1873
+ </li>
1807
1874
  <li class=" tsd-kind-interface">
1808
1875
  <a href="interfaces/ServerHandler.html" class="tsd-kind-icon">Server<wbr>Handler</a>
1809
1876
  </li>
@@ -1876,6 +1943,9 @@
1876
1943
  <li class=" tsd-kind-function tsd-has-type-parameter">
1877
1944
  <a href="modules.html#mount" class="tsd-kind-icon">mount</a>
1878
1945
  </li>
1946
+ <li class=" tsd-kind-function">
1947
+ <a href="modules.html#pool" class="tsd-kind-icon">pool</a>
1948
+ </li>
1879
1949
  <li class=" tsd-kind-function">
1880
1950
  <a href="modules.html#protocol" class="tsd-kind-icon">protocol</a>
1881
1951
  </li>
package/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { Server, Handler as ServerHandler, Options as ServerOptions, Routes as S
8
8
  export { Jwt } from './Jwt';
9
9
  import { Client } from 'memjs';
10
10
  import { Query } from 'buildmsql';
11
+ export { Context as ContextSsr } from 'vite-ssr-vue';
11
12
 
12
13
  declare class Memcached {
13
14
  memjs: Client;
@@ -57,20 +58,21 @@ declare class Memcached {
57
58
  */
58
59
  declare function staticBody(res: HttpResponse, req: HttpRequest, base: string): Promise<void>;
59
60
 
60
- interface Context$3 {
61
+ interface OptionsSsr {
61
62
  readonly manifest: Record<string, any>;
62
63
  readonly memcached: Memcached;
63
64
  readonly [key: string]: any;
64
65
  }
65
66
  declare type EntryFunction = (url: string, opt: Record<string, any>) => Promise<any>;
67
+
66
68
  /**
67
69
  * Ssr handler for production
68
70
  */
69
71
  declare class Ssr {
70
72
  res: HttpResponse;
71
73
  req: HttpRequest;
72
- context: Context$3;
73
- entry: EntryFunction;
74
+ context: OptionsSsr;
75
+ entry: EntryFunction | any;
74
76
  /**
75
77
  * @constructor
76
78
  * @param res response
@@ -78,7 +80,7 @@ declare class Ssr {
78
80
  * @param context params
79
81
  * @param entry - entry point function
80
82
  */
81
- constructor(res: HttpResponse, req: HttpRequest, context: Context$3, entry: EntryFunction);
83
+ constructor(res: HttpResponse, req: HttpRequest, context: OptionsSsr, entry: EntryFunction | any);
82
84
  /**
83
85
  * @param request addition request params
84
86
  */
@@ -145,7 +147,7 @@ interface Route$1 {
145
147
  method?: method$2 | Array<method$2>;
146
148
  component: any;
147
149
  }
148
- interface Context$2 {
150
+ interface OptionsWeb {
149
151
  readonly routes: Array<Route$1>;
150
152
  readonly config: Config$1;
151
153
  readonly db: Record<string, Query>;
@@ -206,7 +208,7 @@ interface ContextWebController extends ContextWeb {
206
208
  declare class Web {
207
209
  res: HttpResponse;
208
210
  req: HttpRequest;
209
- context: Context$2;
211
+ context: OptionsWeb;
210
212
  defaultRequest: {
211
213
  controller: string;
212
214
  subaction: string;
@@ -227,7 +229,7 @@ declare class Web {
227
229
  * @param req request
228
230
  * @param context params
229
231
  */
230
- constructor(res: HttpResponse, req: HttpRequest, context: Context$2);
232
+ constructor(res: HttpResponse, req: HttpRequest, context: OptionsWeb);
231
233
  request(request?: Record<string, any>): Promise<void>;
232
234
  /**
233
235
  * Import controller class
@@ -369,6 +371,9 @@ declare class Model$1 {
369
371
  isLog: boolean;
370
372
  isActive: boolean;
371
373
  };
374
+ getDb(): Record<string, any>;
375
+ getHome(): any;
376
+ getPool(key?: string): any;
372
377
  }
373
378
 
374
379
  interface ResponseOptions {
@@ -503,6 +508,7 @@ declare class Controller {
503
508
  isActive: boolean;
504
509
  };
505
510
  getHome(): Query;
511
+ getPool(key?: string): Query;
506
512
  }
507
513
 
508
514
  interface Context extends ContextWeb {
@@ -554,6 +560,9 @@ declare class Model {
554
560
  isLog: boolean;
555
561
  isActive: boolean;
556
562
  };
563
+ getDb(): Record<string, any>;
564
+ getHome(): any;
565
+ getPool(key?: string): any;
557
566
  }
558
567
 
559
568
  /**
@@ -638,6 +647,10 @@ declare function stream(): (target: any, propertyKey: string | symbol, parameter
638
647
  * @home() decorator
639
648
  */
640
649
  declare function home(): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
650
+ /**
651
+ * @pool() decorator
652
+ */
653
+ declare function pool(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
641
654
  /**
642
655
  * @connection() decorator
643
656
  */
@@ -682,4 +695,4 @@ declare const helpers: {
682
695
  getExt: (path: string) => string;
683
696
  };
684
697
 
685
- export { Context$3 as ContextSsr, ContextWeb, Controller, Memcached, Model, Ssr, Web, action, body, config, connection, context, controller, cookies, db, headers, helpers, home, hostname, http, init, json, logerror, method, mixin, mountWithContext as mount, protocol, request, stream, subaction, url, xml };
698
+ export { ContextWeb, Controller, Memcached, Model, OptionsSsr, OptionsWeb, Route$1 as Route, 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
@@ -953,6 +953,9 @@ class Controller {
953
953
  getHome() {
954
954
  return this.getDb().home;
955
955
  }
956
+ getPool(key = "home") {
957
+ return this.getDb()[key];
958
+ }
956
959
  }
957
960
 
958
961
  class Model {
@@ -1002,6 +1005,15 @@ class Model {
1002
1005
  getSubaction() {
1003
1006
  return this.$context.subaction;
1004
1007
  }
1008
+ getDb() {
1009
+ return this.$context.db;
1010
+ }
1011
+ getHome() {
1012
+ return this.$context.db.home;
1013
+ }
1014
+ getPool(key = "home") {
1015
+ return this.getDb()[key];
1016
+ }
1005
1017
  }
1006
1018
 
1007
1019
  const argumentsSubactionsKey = Symbol("arguments");
@@ -1120,6 +1132,11 @@ function home() {
1120
1132
  defineMetadataArgument(argumentsSubactionsKey, target, propertyKey, parameterIndex, "home");
1121
1133
  };
1122
1134
  }
1135
+ function pool(name = "home") {
1136
+ return function(target, propertyKey, parameterIndex) {
1137
+ defineMetadataArgument(argumentsSubactionsKey, target, propertyKey, parameterIndex, "pool", name);
1138
+ };
1139
+ }
1123
1140
  function connection(name = "home") {
1124
1141
  return function(target, propertyKey, parameterIndex) {
1125
1142
  defineMetadataArgument(argumentsConnectionsKey, target, propertyKey, parameterIndex, "connection", name);
@@ -1156,7 +1173,7 @@ function http() {
1156
1173
  continue;
1157
1174
  }
1158
1175
  const getterName = `get${upperCaseFirstLetter(existingArguments[key].type)}`;
1159
- args[+key] = this[getterName]();
1176
+ args[+key] = this[getterName](existingConnections[key].params);
1160
1177
  }
1161
1178
  for (const key in existingConnections) {
1162
1179
  if (!existingConnections.hasOwnProperty(key)) {
@@ -1167,12 +1184,13 @@ function http() {
1167
1184
  connections.push(args[+key]);
1168
1185
  }
1169
1186
  try {
1170
- const out = await method2.apply(this, args);
1187
+ let out = await method2.apply(this, args), opt;
1188
+ Array.isArray(out) && ([out, opt] = out);
1171
1189
  if (responseInit.type !== "init") {
1172
1190
  if (response.type === "xml") {
1173
- return this.successXml(out, response.params);
1191
+ return this.successXml(out, Object.assign(response.params, opt || {}));
1174
1192
  }
1175
- return this.success(out, response.params);
1193
+ return this.success(out, Object.assign(response.params, opt || {}));
1176
1194
  }
1177
1195
  } catch (e) {
1178
1196
  await Promise.all([...connections.map((connection2) => connection2.rollback())]);
@@ -1247,6 +1265,7 @@ exports.logerror = logerror;
1247
1265
  exports.method = method;
1248
1266
  exports.mixin = mixin;
1249
1267
  exports.mount = mountWithContext;
1268
+ exports.pool = pool;
1250
1269
  exports.protocol = protocol;
1251
1270
  exports.request = request;
1252
1271
  exports.stream = stream;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jwn-js/common",
3
3
  "private": false,
4
- "version": "1.3.3",
4
+ "version": "1.3.7",
5
5
  "description": "@jwn-js/common package",
6
6
  "main": "./index.js",
7
7
  "types": "./index.d.ts",