w-converhp 2.0.48 → 2.0.49

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * w-converhp-server v2.0.48
2
+ * w-converhp-server v2.0.49
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -80,7 +80,7 @@
80
80
 
81
81
  <dt class="tag-source">Source:</dt>
82
82
  <dd class="tag-source"><ul class="dummy"><li>
83
- <a href="WConverhpClient.mjs.html">WConverhpClient.mjs</a>, <a href="WConverhpClient.mjs.html#line95">line 95</a>
83
+ <a href="WConverhpClient.mjs.html">WConverhpClient.mjs</a>, <a href="WConverhpClient.mjs.html#line96">line 96</a>
84
84
  </li></ul></dd>
85
85
 
86
86
 
@@ -402,6 +402,46 @@
402
402
 
403
403
 
404
404
 
405
+ <tr>
406
+
407
+ <td class="name"><code>timeout</code></td>
408
+
409
+
410
+ <td class="type">
411
+
412
+
413
+ <span class="param-type">Integer</span>
414
+
415
+
416
+
417
+
418
+ </td>
419
+
420
+
421
+ <td class="attributes">
422
+
423
+ &lt;optional><br>
424
+
425
+
426
+
427
+
428
+
429
+ </td>
430
+
431
+
432
+
433
+ <td class="default">
434
+
435
+ <code>5*60*1000</code>
436
+
437
+ </td>
438
+
439
+
440
+ <td class="description last"><p>輸入最長等待時間整數,單位ms,預設為5<em>60</em>1000、為5分鐘</p></td>
441
+ </tr>
442
+
443
+
444
+
405
445
  <tr>
406
446
 
407
447
  <td class="name"><code>retry</code></td>
@@ -432,12 +472,12 @@
432
472
 
433
473
  <td class="default">
434
474
 
435
- <code>3</code>
475
+ <code>10</code>
436
476
 
437
477
  </td>
438
478
 
439
479
 
440
- <td class="description last"><p>輸入傳輸失敗重試次數整數,預設為3</p></td>
480
+ <td class="description last"><p>輸入傳輸失敗重試次數整數,預設為10</p></td>
441
481
  </tr>
442
482
 
443
483
 
@@ -529,7 +569,7 @@
529
569
  <br class="clear">
530
570
 
531
571
  <footer>
532
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 20:54:14 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
572
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 21:33:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
533
573
  </footer>
534
574
 
535
575
  <script>prettyPrint();</script>
@@ -80,7 +80,8 @@ import getFileXxHash from 'wsemi/src/getFileXxHash.mjs'
80
80
  * @param {Function} [opt.getToken=()=>''] 輸入取得使用者token的回調函數,預設()=>''
81
81
  * @param {String} [opt.tokenType='Bearer'] 輸入token類型字串,預設'Bearer'
82
82
  * @param {Integer} [opt.sizeSlice=1024*1024] 輸入切片上傳檔案之切片檔案大小整數,單位為Byte,預設為1024*1024
83
- * @param {Integer} [opt.retry=3] 輸入傳輸失敗重試次數整數,預設為3
83
+ * @param {Integer} [opt.timeout=5*60*1000] 輸入最長等待時間整數,單位ms,預設為5*60*1000、為5分鐘
84
+ * @param {Integer} [opt.retry=10] 輸入傳輸失敗重試次數整數,預設為10
84
85
  * @returns {Object} 回傳事件物件,可使用函數execute、upload
85
86
  * @example
86
87
  *
@@ -182,6 +183,12 @@ function WConverhpClient(opt) {
182
183
  sizeSlice = 1024 * 1024 //1m
183
184
  }
184
185
 
186
+ //timeout
187
+ let timeout = get(opt, 'timeout')
188
+ if (!isp0int(timeout)) {
189
+ timeout = 5 * 60 * 1000 //5min
190
+ }
191
+
185
192
  //retry
186
193
  let retry = get(opt, 'retry')
187
194
  if (!isp0int(retry)) {
@@ -487,7 +494,7 @@ function WConverhpClient(opt) {
487
494
  ...ct,
488
495
  ...headers,
489
496
  },
490
- timeout: 60 * 60 * 1000, //1hr
497
+ timeout,
491
498
  maxContentLength: Infinity, //1024 * 1024 * 1024, Infinity //axios於nodejs中會限制內容大小故需改為無限
492
499
  maxBodyLength: Infinity, //1024 * 1024 * 1024, Infinity //axios於nodejs中會限制內容大小故需改為無限
493
500
  responseType: rt,
@@ -1134,7 +1141,7 @@ export default WConverhpClient
1134
1141
  <br class="clear">
1135
1142
 
1136
1143
  <footer>
1137
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 20:54:14 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1144
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 21:33:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1138
1145
  </footer>
1139
1146
 
1140
1147
  <script>prettyPrint();</script>
@@ -749,7 +749,7 @@
749
749
  <br class="clear">
750
750
 
751
751
  <footer>
752
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 20:54:14 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
752
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 21:33:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
753
753
  </footer>
754
754
 
755
755
  <script>prettyPrint();</script>
@@ -1485,7 +1485,7 @@ export default WConverhpServer
1485
1485
  <br class="clear">
1486
1486
 
1487
1487
  <footer>
1488
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 20:54:14 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1488
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 21:33:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1489
1489
  </footer>
1490
1490
 
1491
1491
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
  <br class="clear">
72
72
 
73
73
  <footer>
74
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 20:54:14 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat May 17 2025 21:33:07 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-converhp",
3
- "version": "2.0.48",
3
+ "version": "2.0.49",
4
4
  "main": "dist/w-converhp-server.umd.js",
5
5
  "dependencies": {
6
6
  "@hapi/hapi": "^21.4.0",
@@ -33,7 +33,8 @@ import getFileXxHash from 'wsemi/src/getFileXxHash.mjs'
33
33
  * @param {Function} [opt.getToken=()=>''] 輸入取得使用者token的回調函數,預設()=>''
34
34
  * @param {String} [opt.tokenType='Bearer'] 輸入token類型字串,預設'Bearer'
35
35
  * @param {Integer} [opt.sizeSlice=1024*1024] 輸入切片上傳檔案之切片檔案大小整數,單位為Byte,預設為1024*1024
36
- * @param {Integer} [opt.retry=3] 輸入傳輸失敗重試次數整數,預設為3
36
+ * @param {Integer} [opt.timeout=5*60*1000] 輸入最長等待時間整數,單位ms,預設為5*60*1000、為5分鐘
37
+ * @param {Integer} [opt.retry=10] 輸入傳輸失敗重試次數整數,預設為10
37
38
  * @returns {Object} 回傳事件物件,可使用函數execute、upload
38
39
  * @example
39
40
  *
@@ -135,6 +136,12 @@ function WConverhpClient(opt) {
135
136
  sizeSlice = 1024 * 1024 //1m
136
137
  }
137
138
 
139
+ //timeout
140
+ let timeout = get(opt, 'timeout')
141
+ if (!isp0int(timeout)) {
142
+ timeout = 5 * 60 * 1000 //5min
143
+ }
144
+
138
145
  //retry
139
146
  let retry = get(opt, 'retry')
140
147
  if (!isp0int(retry)) {
@@ -440,7 +447,7 @@ function WConverhpClient(opt) {
440
447
  ...ct,
441
448
  ...headers,
442
449
  },
443
- timeout: 60 * 60 * 1000, //1hr
450
+ timeout,
444
451
  maxContentLength: Infinity, //1024 * 1024 * 1024, Infinity //axios於nodejs中會限制內容大小故需改為無限
445
452
  maxBodyLength: Infinity, //1024 * 1024 * 1024, Infinity //axios於nodejs中會限制內容大小故需改為無限
446
453
  responseType: rt,