w-web-perm 1.1.8 → 1.1.10

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.
Files changed (51) hide show
  1. package/README.md +14 -4
  2. package/dist/index.tmp +1 -1
  3. package/dist/js/app-legacy.26e909d6.js +1 -0
  4. package/dist/js/app.26e909d6.js +1 -0
  5. package/dist/js/{chunk-vendors-legacy.00f159e8.js → chunk-vendors-legacy.b43f5548.js} +3 -3
  6. package/dist/js/{chunk-vendors.00f159e8.js → chunk-vendors.b43f5548.js} +3 -3
  7. package/dist/w-web-perm.umd.js +2 -2
  8. package/dist/w-web-perm.umd.js.map +1 -1
  9. package/docs/WWebPerm.html +78 -128
  10. package/docs/global.html +1280 -39
  11. package/docs/index.html +2 -2
  12. package/docs/server_WWebPerm.mjs.html +1247 -1196
  13. package/docs/server_dataChannel.mjs.html +131 -0
  14. package/docs/server_lockSave.mjs.html +2 -2
  15. package/docs/server_maskLog.mjs.html +2 -2
  16. package/docs/server_procCore.mjs.html +53 -11
  17. package/docs/server_staLogs_resolveShellWorker.mjs.html +180 -0
  18. package/docs/server_validateRows.mjs.html +184 -0
  19. package/docs/server_wrapInjected.mjs.html +2 -2
  20. package/docs/src_fetchJson.mjs.html +2 -2
  21. package/docs/src_js_legendFit.mjs.html +2 -2
  22. package/docs/src_plugins_reuseDeletedIds.mjs.html +2 -2
  23. package/docs/src_plugins_submitGuard.mjs.html +2 -2
  24. package/g_backupDb.mjs +4 -0
  25. package/g_initialData.mjs +1 -0
  26. package/g_initialTestData.mjs +1 -0
  27. package/g_mOrm.mjs +2 -7
  28. package/g_provideGrups.mjs +1 -0
  29. package/g_providePemis.mjs +1 -0
  30. package/g_provideTargets.mjs +1 -0
  31. package/g_provideUsers.mjs +1 -0
  32. package/package.json +14 -14
  33. package/server/WWebPerm.mjs +1245 -1194
  34. package/server/dataChannel.mjs +59 -0
  35. package/server/procCore.mjs +51 -9
  36. package/server/procLang.mjs +13 -3
  37. package/server/staLogs/resolveShellWorker.mjs +108 -0
  38. package/server/staLogs/staLogsCore.callWorker.mjs +29 -9
  39. package/server/validateRows.mjs +112 -0
  40. package/src/components/LayoutContentGrups.vue +8 -8
  41. package/src/components/LayoutContentPemis.vue +8 -8
  42. package/src/components/LayoutContentTargets.vue +2 -2
  43. package/src/components/LayoutContentUsers.vue +4 -4
  44. package/src/components/VeCgrups.vue +3 -3
  45. package/src/components/VeCpemis.vue +3 -3
  46. package/src/components/VeCrules.vue +3 -3
  47. package/src/components/VeGrupBlngUsers.vue +6 -6
  48. package/src/components/VePemiBlngGrups.vue +6 -6
  49. package/srv.mjs +0 -4
  50. package/dist/js/app-legacy.6f82d8bd.js +0 -1
  51. package/dist/js/app.6f82d8bd.js +0 -1
package/docs/global.html CHANGED
@@ -29,7 +29,7 @@
29
29
  <nav >
30
30
 
31
31
 
32
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WWebPerm.html">WWebPerm</a></li></ul><h3>Global</h3><ul><li><a href="global.html#createLegendMeasurer">createLegendMeasurer</a></li><li><a href="global.html#createLockSave">createLockSave</a></li><li><a href="global.html#decideLegendType">decideLegendType</a></li><li><a href="global.html#describeUpstream">describeUpstream</a></li><li><a href="global.html#fetchJson">fetchJson</a></li><li><a href="global.html#genLegend">genLegend</a></li><li><a href="global.html#maskQuery">maskQuery</a></li><li><a href="global.html#maskTok">maskTok</a></li><li><a href="global.html#maskUrl">maskUrl</a></li><li><a href="global.html#mergePickKeysOnly">mergePickKeysOnly</a></li><li><a href="global.html#reuseDeletedIds">reuseDeletedIds</a></li><li><a href="global.html#submitGuard">submitGuard</a></li><li><a href="global.html#wrapInjected">wrapInjected</a></li></ul>
32
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WWebPerm.html">WWebPerm</a></li></ul><h3>Global</h3><ul><li><a href="global.html#createAuthorizeExec">createAuthorizeExec</a></li><li><a href="global.html#createLegendMeasurer">createLegendMeasurer</a></li><li><a href="global.html#createLockSave">createLockSave</a></li><li><a href="global.html#decideLegendType">decideLegendType</a></li><li><a href="global.html#describeUpstream">describeUpstream</a></li><li><a href="global.html#fetchJson">fetchJson</a></li><li><a href="global.html#genLegend">genLegend</a></li><li><a href="global.html#maskQuery">maskQuery</a></li><li><a href="global.html#maskTok">maskTok</a></li><li><a href="global.html#maskUrl">maskUrl</a></li><li><a href="global.html#mergePickKeysOnly">mergePickKeysOnly</a></li><li><a href="global.html#resolveShellWorker">resolveShellWorker</a></li><li><a href="global.html#reuseDeletedIds">reuseDeletedIds</a></li><li><a href="global.html#submitGuard">submitGuard</a></li><li><a href="global.html#validateRowsBeforeWrite">validateRowsBeforeWrite</a></li><li><a href="global.html#wrapInjected">wrapInjected</a></li><li><a href="global.html#wrapOperOrm">wrapOperOrm</a></li></ul>
33
33
 
34
34
  </nav>
35
35
 
@@ -130,6 +130,214 @@
130
130
 
131
131
 
132
132
 
133
+ <h4 class="name" id="createAuthorizeExec"><span class="type-signature"></span>createAuthorizeExec<span class="signature">(p)</span><span class="type-signature"> &rarr; {function}</span></h4>
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <dl class="details">
141
+
142
+ <dt class="tag-description">Description:</dt>
143
+ <dd class="tag-description"><ul class="dummy"><li><p>建立資料通道之表操作授權函數(w-serv-webdata 之 opt.authorizeExec)</p></li></ul></dd>
144
+
145
+
146
+
147
+ <dt class="tag-source">Source:</dt>
148
+ <dd class="tag-source"><ul class="dummy"><li>
149
+ <a href="server_dataChannel.mjs.html">server/dataChannel.mjs</a>, <a href="server_dataChannel.mjs.html#line19">line 19</a>
150
+ </li></ul></dd>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ </dl>
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+ <h5 class="h5-parameters">Parameters:</h5>
197
+
198
+
199
+ <table class="params">
200
+ <thead>
201
+ <tr>
202
+
203
+ <th>Name</th>
204
+
205
+
206
+ <th>Type</th>
207
+
208
+
209
+
210
+
211
+
212
+ <th class="last">Description</th>
213
+ </tr>
214
+ </thead>
215
+
216
+ <tbody>
217
+
218
+
219
+ <tr>
220
+
221
+ <td class="name"><code>p</code></td>
222
+
223
+
224
+ <td class="type">
225
+
226
+
227
+ <span class="param-type">Object</span>
228
+
229
+
230
+
231
+
232
+ </td>
233
+
234
+
235
+
236
+
237
+
238
+ <td class="description last"><p>輸入物件</p>
239
+ <h6>Properties</h6>
240
+
241
+
242
+ <table class="params">
243
+ <thead>
244
+ <tr>
245
+
246
+ <th>Name</th>
247
+
248
+
249
+ <th>Type</th>
250
+
251
+
252
+
253
+
254
+
255
+ <th class="last">Description</th>
256
+ </tr>
257
+ </thead>
258
+
259
+ <tbody>
260
+
261
+
262
+ <tr>
263
+
264
+ <td class="name"><code>srLog</code></td>
265
+
266
+
267
+ <td class="type">
268
+
269
+
270
+ <span class="param-type">Object</span>
271
+
272
+
273
+
274
+
275
+ </td>
276
+
277
+
278
+
279
+
280
+
281
+ <td class="description last"><p>輸入 srLog(須有 error 方法)</p></td>
282
+ </tr>
283
+
284
+
285
+ </tbody>
286
+ </table>
287
+
288
+ </td>
289
+ </tr>
290
+
291
+
292
+ </tbody>
293
+ </table>
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+ <h5 class="h5-returns">Returns:</h5>
311
+
312
+
313
+ <div class="param-desc">
314
+ <p>回傳授權函數 ({ userId, tableName, methodName }) =&gt; Boolean, 只對已取得 userId 之 select 回傳 true; 拒絕時記 srLog(event 'authorizeExec', msg 為 err key)</p>
315
+ </div>
316
+
317
+
318
+
319
+ <dl class="param-type">
320
+ <dt>
321
+ Type
322
+ </dt>
323
+ <dd>
324
+
325
+ <span class="param-type">function</span>
326
+
327
+
328
+
329
+ </dd>
330
+ </dl>
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
133
341
  <h4 class="name" id="createLegendMeasurer"><span class="type-signature"></span>createLegendMeasurer<span class="signature">(echarts)</span><span class="type-signature"> &rarr; {Object}</span></h4>
134
342
 
135
343
 
@@ -1692,7 +1900,7 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
1692
1900
 
1693
1901
  <dt class="tag-source">Source:</dt>
1694
1902
  <dd class="tag-source"><ul class="dummy"><li>
1695
- <a href="server_procCore.mjs.html">server/procCore.mjs</a>, <a href="server_procCore.mjs.html#line26">line 26</a>
1903
+ <a href="server_procCore.mjs.html">server/procCore.mjs</a>, <a href="server_procCore.mjs.html#line28">line 28</a>
1696
1904
  </li></ul></dd>
1697
1905
 
1698
1906
 
@@ -1906,7 +2114,7 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
1906
2114
 
1907
2115
 
1908
2116
 
1909
- <h4 class="name" id="reuseDeletedIds"><span class="type-signature"></span>reuseDeletedIds<span class="signature">(rows, rowsDb)</span><span class="type-signature"> &rarr; {Array}</span></h4>
2117
+ <h4 class="name" id="resolveShellWorker"><span class="type-signature"></span>resolveShellWorker<span class="signature">(p)</span><span class="type-signature"> &rarr; {String}</span></h4>
1910
2118
 
1911
2119
 
1912
2120
 
@@ -1916,19 +2124,16 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
1916
2124
  <dl class="details">
1917
2125
 
1918
2126
  <dt class="tag-description">Description:</dt>
1919
- <dd class="tag-description"><ul class="dummy"><li><p>新增列沿用資料庫既有 id 時之正規化 (標的清單專用, 其 id 為可就地改寫之標的路徑; ADR-025)</p>
1920
- <p>同一次儲存中刪除(或把 id 改掉)某既有列, 又新增一列並把 id 改成該既有列之 id, 淨效果為「修改該列」:
1921
- 該新增列改為一般列送出(_isNew 設 false), 建立者 / 建立時間沿用資料庫之值(修改者 / 修改時間由後端寫入).
1922
- 否則後端之「新增列已存在即拒絕」(saveNewRowExists, 擋同一包重送) 會把它當重送擋下, 且重新整理後重做仍被擋;
1923
- 亦避免以前端佔位字({待自動給予})覆寫建立者 / 建立時間.
1924
- 只處理 id 於 rows 內唯一者; 重複 id 不處理, 由後端 ckKey 回 saveRowFieldDuplicate.
1925
- 使用者 / 群組 / 權限清單之 id 為系統產生且不可編輯, 新增列不會與既有列同 id, 不需此處理.</p></li></ul></dd>
2127
+ <dd class="tag-description"><ul class="dummy"><li><p>解析本套件 staLogs worker 檔之絕對路徑, 供源碼、已安裝之套件、本套件之 dist 與被下游再打包時皆可用</p>
2128
+ <p>順序: (a) 由 fpSelf 往上找最近之 package.json, 其 name 為 pkgName 且其下 rel 存在 → 採用(最近之 package.json 名稱不符即不再往上);
2129
+ (b) createRequire(fpSelf).resolve(<code>${pkgName}/${rel}</code>)(被下游打包時往上找 node_modules); (c) 同上但以 cwd 為基準(bundle 被搬離 node_modules 樹而由專案根執行);
2130
+ (d) 皆失敗拋 Error, 訊息含套件名、相對路徑與已試之位置</p></li></ul></dd>
1926
2131
 
1927
2132
 
1928
2133
 
1929
2134
  <dt class="tag-source">Source:</dt>
1930
2135
  <dd class="tag-source"><ul class="dummy"><li>
1931
- <a href="src_plugins_reuseDeletedIds.mjs.html">src/plugins/reuseDeletedIds.mjs</a>, <a href="src_plugins_reuseDeletedIds.mjs.html#line20">line 20</a>
2136
+ <a href="server_staLogs_resolveShellWorker.mjs.html">server/staLogs/resolveShellWorker.mjs</a>, <a href="server_staLogs_resolveShellWorker.mjs.html#line49">line 49</a>
1932
2137
  </li></ul></dd>
1933
2138
 
1934
2139
 
@@ -2000,13 +2205,13 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
2000
2205
 
2001
2206
  <tr>
2002
2207
 
2003
- <td class="name"><code>rows</code></td>
2208
+ <td class="name"><code>p</code></td>
2004
2209
 
2005
2210
 
2006
2211
  <td class="type">
2007
2212
 
2008
2213
 
2009
- <span class="param-type">Array</span>
2214
+ <span class="param-type">Object</span>
2010
2215
 
2011
2216
 
2012
2217
 
@@ -2017,20 +2222,43 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
2017
2222
 
2018
2223
 
2019
2224
 
2020
- <td class="description last"><p>輸入欲送出之列陣列(清單之 opt.rows), 不修改</p></td>
2021
- </tr>
2225
+ <td class="description last"><p>輸入物件</p>
2226
+ <h6>Properties</h6>
2227
+
2228
+
2229
+ <table class="params">
2230
+ <thead>
2231
+ <tr>
2232
+
2233
+ <th>Name</th>
2234
+
2235
+
2236
+ <th>Type</th>
2237
+
2238
+
2239
+ <th>Attributes</th>
2240
+
2241
+
2242
+
2243
+ <th>Default</th>
2244
+
2245
+
2246
+ <th class="last">Description</th>
2247
+ </tr>
2248
+ </thead>
2022
2249
 
2250
+ <tbody>
2023
2251
 
2024
2252
 
2025
2253
  <tr>
2026
2254
 
2027
- <td class="name"><code>rowsDb</code></td>
2255
+ <td class="name"><code>fpSelf</code></td>
2028
2256
 
2029
2257
 
2030
2258
  <td class="type">
2031
2259
 
2032
2260
 
2033
- <span class="param-type">Array</span>
2261
+ <span class="param-type">String</span>
2034
2262
 
2035
2263
 
2036
2264
 
@@ -2038,15 +2266,580 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
2038
2266
  </td>
2039
2267
 
2040
2268
 
2269
+ <td class="attributes">
2270
+
2271
+
2272
+
2041
2273
 
2274
+
2275
+ </td>
2042
2276
 
2043
2277
 
2044
- <td class="description last"><p>輸入資料庫之列陣列(前端 store 之同表資料)</p></td>
2278
+
2279
+ <td class="default">
2280
+
2281
+ </td>
2282
+
2283
+
2284
+ <td class="description last"><p>輸入呼叫端模組之檔案絕對路徑(由 import.meta.url 轉得; 打包後為 bundle 之位置)</p></td>
2045
2285
  </tr>
2046
2286
 
2047
2287
 
2048
- </tbody>
2049
- </table>
2288
+
2289
+ <tr>
2290
+
2291
+ <td class="name"><code>cwd</code></td>
2292
+
2293
+
2294
+ <td class="type">
2295
+
2296
+
2297
+ <span class="param-type">String</span>
2298
+
2299
+
2300
+
2301
+
2302
+ </td>
2303
+
2304
+
2305
+ <td class="attributes">
2306
+
2307
+ &lt;optional><br>
2308
+
2309
+
2310
+
2311
+
2312
+
2313
+ </td>
2314
+
2315
+
2316
+
2317
+ <td class="default">
2318
+
2319
+ <code>process.cwd()</code>
2320
+
2321
+ </td>
2322
+
2323
+
2324
+ <td class="description last"><p>輸入 (c) 之基準資料夾</p></td>
2325
+ </tr>
2326
+
2327
+
2328
+
2329
+ <tr>
2330
+
2331
+ <td class="name"><code>pkgName</code></td>
2332
+
2333
+
2334
+ <td class="type">
2335
+
2336
+
2337
+ <span class="param-type">String</span>
2338
+
2339
+
2340
+
2341
+
2342
+ </td>
2343
+
2344
+
2345
+ <td class="attributes">
2346
+
2347
+ &lt;optional><br>
2348
+
2349
+
2350
+
2351
+
2352
+
2353
+ </td>
2354
+
2355
+
2356
+
2357
+ <td class="default">
2358
+
2359
+ <code>'w-web-perm'</code>
2360
+
2361
+ </td>
2362
+
2363
+
2364
+ <td class="description last"><p>輸入本套件名稱</p></td>
2365
+ </tr>
2366
+
2367
+
2368
+
2369
+ <tr>
2370
+
2371
+ <td class="name"><code>rel</code></td>
2372
+
2373
+
2374
+ <td class="type">
2375
+
2376
+
2377
+ <span class="param-type">String</span>
2378
+
2379
+
2380
+
2381
+
2382
+ </td>
2383
+
2384
+
2385
+ <td class="attributes">
2386
+
2387
+ &lt;optional><br>
2388
+
2389
+
2390
+
2391
+
2392
+
2393
+ </td>
2394
+
2395
+
2396
+
2397
+ <td class="default">
2398
+
2399
+ <code>'server/staLogs/staLogsCore.shellWorker.mjs'</code>
2400
+
2401
+ </td>
2402
+
2403
+
2404
+ <td class="description last"><p>輸入 worker 檔相對於套件根之路徑</p></td>
2405
+ </tr>
2406
+
2407
+
2408
+
2409
+ <tr>
2410
+
2411
+ <td class="name"><code>existsSync</code></td>
2412
+
2413
+
2414
+ <td class="type">
2415
+
2416
+
2417
+ <span class="param-type">function</span>
2418
+
2419
+
2420
+
2421
+
2422
+ </td>
2423
+
2424
+
2425
+ <td class="attributes">
2426
+
2427
+ &lt;optional><br>
2428
+
2429
+
2430
+
2431
+
2432
+
2433
+ </td>
2434
+
2435
+
2436
+
2437
+ <td class="default">
2438
+
2439
+ <code>fs.existsSync</code>
2440
+
2441
+ </td>
2442
+
2443
+
2444
+ <td class="description last"><p>輸入檔案是否存在之函數(測試注入用)</p></td>
2445
+ </tr>
2446
+
2447
+
2448
+
2449
+ <tr>
2450
+
2451
+ <td class="name"><code>readFileSync</code></td>
2452
+
2453
+
2454
+ <td class="type">
2455
+
2456
+
2457
+ <span class="param-type">function</span>
2458
+
2459
+
2460
+
2461
+
2462
+ </td>
2463
+
2464
+
2465
+ <td class="attributes">
2466
+
2467
+ &lt;optional><br>
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+ </td>
2474
+
2475
+
2476
+
2477
+ <td class="default">
2478
+
2479
+ <code>fs.readFileSync</code>
2480
+
2481
+ </td>
2482
+
2483
+
2484
+ <td class="description last"><p>輸入讀檔函數(測試注入用)</p></td>
2485
+ </tr>
2486
+
2487
+
2488
+
2489
+ <tr>
2490
+
2491
+ <td class="name"><code>createRequire</code></td>
2492
+
2493
+
2494
+ <td class="type">
2495
+
2496
+
2497
+ <span class="param-type">function</span>
2498
+
2499
+
2500
+
2501
+
2502
+ </td>
2503
+
2504
+
2505
+ <td class="attributes">
2506
+
2507
+ &lt;optional><br>
2508
+
2509
+
2510
+
2511
+
2512
+
2513
+ </td>
2514
+
2515
+
2516
+
2517
+ <td class="default">
2518
+
2519
+ </td>
2520
+
2521
+
2522
+ <td class="description last"><p>輸入 module.createRequire(測試注入用)</p></td>
2523
+ </tr>
2524
+
2525
+
2526
+ </tbody>
2527
+ </table>
2528
+
2529
+ </td>
2530
+ </tr>
2531
+
2532
+
2533
+ </tbody>
2534
+ </table>
2535
+
2536
+
2537
+
2538
+
2539
+
2540
+
2541
+
2542
+
2543
+
2544
+
2545
+
2546
+
2547
+
2548
+
2549
+
2550
+
2551
+ <h5 class="h5-returns">Returns:</h5>
2552
+
2553
+
2554
+ <div class="param-desc">
2555
+ <p>回傳 worker 檔之絕對路徑</p>
2556
+ </div>
2557
+
2558
+
2559
+
2560
+ <dl class="param-type">
2561
+ <dt>
2562
+ Type
2563
+ </dt>
2564
+ <dd>
2565
+
2566
+ <span class="param-type">String</span>
2567
+
2568
+
2569
+
2570
+ </dd>
2571
+ </dl>
2572
+
2573
+
2574
+
2575
+
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+ <h4 class="name" id="reuseDeletedIds"><span class="type-signature"></span>reuseDeletedIds<span class="signature">(rows, rowsDb)</span><span class="type-signature"> &rarr; {Array}</span></h4>
2583
+
2584
+
2585
+
2586
+
2587
+
2588
+
2589
+ <dl class="details">
2590
+
2591
+ <dt class="tag-description">Description:</dt>
2592
+ <dd class="tag-description"><ul class="dummy"><li><p>新增列沿用資料庫既有 id 時之正規化 (標的清單專用, 其 id 為可就地改寫之標的路徑; ADR-025)</p>
2593
+ <p>同一次儲存中刪除(或把 id 改掉)某既有列, 又新增一列並把 id 改成該既有列之 id, 淨效果為「修改該列」:
2594
+ 該新增列改為一般列送出(_isNew 設 false), 建立者 / 建立時間沿用資料庫之值(修改者 / 修改時間由後端寫入).
2595
+ 否則後端之「新增列已存在即拒絕」(saveNewRowExists, 擋同一包重送) 會把它當重送擋下, 且重新整理後重做仍被擋;
2596
+ 亦避免以前端佔位字({待自動給予})覆寫建立者 / 建立時間.
2597
+ 只處理 id 於 rows 內唯一者; 重複 id 不處理, 由後端 ckKey 回 saveRowFieldDuplicate.
2598
+ 使用者 / 群組 / 權限清單之 id 為系統產生且不可編輯, 新增列不會與既有列同 id, 不需此處理.</p></li></ul></dd>
2599
+
2600
+
2601
+
2602
+ <dt class="tag-source">Source:</dt>
2603
+ <dd class="tag-source"><ul class="dummy"><li>
2604
+ <a href="src_plugins_reuseDeletedIds.mjs.html">src/plugins/reuseDeletedIds.mjs</a>, <a href="src_plugins_reuseDeletedIds.mjs.html#line20">line 20</a>
2605
+ </li></ul></dd>
2606
+
2607
+
2608
+
2609
+
2610
+
2611
+
2612
+
2613
+
2614
+
2615
+
2616
+
2617
+
2618
+
2619
+
2620
+
2621
+
2622
+
2623
+
2624
+
2625
+
2626
+
2627
+
2628
+
2629
+
2630
+
2631
+
2632
+
2633
+
2634
+
2635
+
2636
+
2637
+ </dl>
2638
+
2639
+
2640
+
2641
+
2642
+
2643
+
2644
+
2645
+
2646
+
2647
+
2648
+
2649
+
2650
+
2651
+ <h5 class="h5-parameters">Parameters:</h5>
2652
+
2653
+
2654
+ <table class="params">
2655
+ <thead>
2656
+ <tr>
2657
+
2658
+ <th>Name</th>
2659
+
2660
+
2661
+ <th>Type</th>
2662
+
2663
+
2664
+
2665
+
2666
+
2667
+ <th class="last">Description</th>
2668
+ </tr>
2669
+ </thead>
2670
+
2671
+ <tbody>
2672
+
2673
+
2674
+ <tr>
2675
+
2676
+ <td class="name"><code>rows</code></td>
2677
+
2678
+
2679
+ <td class="type">
2680
+
2681
+
2682
+ <span class="param-type">Array</span>
2683
+
2684
+
2685
+
2686
+
2687
+ </td>
2688
+
2689
+
2690
+
2691
+
2692
+
2693
+ <td class="description last"><p>輸入欲送出之列陣列(清單之 opt.rows), 不修改</p></td>
2694
+ </tr>
2695
+
2696
+
2697
+
2698
+ <tr>
2699
+
2700
+ <td class="name"><code>rowsDb</code></td>
2701
+
2702
+
2703
+ <td class="type">
2704
+
2705
+
2706
+ <span class="param-type">Array</span>
2707
+
2708
+
2709
+
2710
+
2711
+ </td>
2712
+
2713
+
2714
+
2715
+
2716
+
2717
+ <td class="description last"><p>輸入資料庫之列陣列(前端 store 之同表資料)</p></td>
2718
+ </tr>
2719
+
2720
+
2721
+ </tbody>
2722
+ </table>
2723
+
2724
+
2725
+
2726
+
2727
+
2728
+
2729
+
2730
+
2731
+
2732
+
2733
+
2734
+
2735
+
2736
+
2737
+
2738
+
2739
+ <h5 class="h5-returns">Returns:</h5>
2740
+
2741
+
2742
+ <div class="param-desc">
2743
+ <p>回傳正規化後之新陣列</p>
2744
+ </div>
2745
+
2746
+
2747
+
2748
+ <dl class="param-type">
2749
+ <dt>
2750
+ Type
2751
+ </dt>
2752
+ <dd>
2753
+
2754
+ <span class="param-type">Array</span>
2755
+
2756
+
2757
+
2758
+ </dd>
2759
+ </dl>
2760
+
2761
+
2762
+
2763
+
2764
+
2765
+
2766
+
2767
+
2768
+
2769
+
2770
+ <h4 class="name" id="submitGuard"><span class="type-signature"></span>submitGuard<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
2771
+
2772
+
2773
+
2774
+
2775
+
2776
+
2777
+ <dl class="details">
2778
+
2779
+ <dt class="tag-description">Description:</dt>
2780
+ <dd class="tag-description"><ul class="dummy"><li><p>送出類操作之前端雙擊防護核心 (與 Vue / store 無關, 供單元測試; 由 mUI 之 runSubmit 與 updateLoading 使用, ADR-025)</p>
2781
+ <ul>
2782
+ <li>run(key, fn, opt): 同 key 之送出流程進行中(自觸發起至流程結束, 含結果訊息框開啟期間)再觸發即略過.
2783
+ 按鈕之滑鼠與鍵盤 Enter、輸入框之 Enter 等入口共用同一狀態.
2784
+ opt.pm 為 WButtonChip / WButtonCircle 之 promiseUnlock 鎖(click 事件之 msg.pm), 於 releaseBtnLocks()(全頁 loading 關閉, 即請求結束)
2785
+ 或流程結束時釋放; 被略過之觸發亦立即釋放其 pm, 否則該按鈕永久鎖住.
2786
+ fn 收到 unlock 函數: 流程需先開確認框者於開框前呼叫, 按鈕鎖只涵蓋請求期間(確認框背後之按鈕不顯示載入圖示), 重入仍由流程狀態擋.
2787
+ opt.hold 為函數, 輸入流程結果, 回傳 true 時保持占位與按鈕鎖(如登入成功轉址, 頁面即將離開).</li>
2788
+ <li>releaseBtnLocks(): 釋放進行中流程所登記之按鈕鎖, 流程狀態不變(結果訊息框開啟期間之重入仍擋).</li>
2789
+ <li>isRunning(key): 查詢 key 是否進行中.</li>
2790
+ </ul>
2791
+ <p>為何需要: 全頁 loading(WDialog)不搶焦點, 只擋滑鼠, 鍵盤事件仍送達背後之按鈕與輸入框;
2792
+ 按鈕鎖若於 handler 第一行即解除, 鍵盤連按照樣送出(2026-09-29 實測).</p></li></ul></dd>
2793
+
2794
+
2795
+
2796
+ <dt class="tag-source">Source:</dt>
2797
+ <dd class="tag-source"><ul class="dummy"><li>
2798
+ <a href="src_plugins_submitGuard.mjs.html">src/plugins/submitGuard.mjs</a>, <a href="src_plugins_submitGuard.mjs.html#line24">line 24</a>
2799
+ </li></ul></dd>
2800
+
2801
+
2802
+
2803
+
2804
+
2805
+
2806
+
2807
+
2808
+
2809
+
2810
+
2811
+
2812
+
2813
+
2814
+
2815
+
2816
+
2817
+
2818
+
2819
+
2820
+
2821
+
2822
+
2823
+
2824
+
2825
+
2826
+
2827
+
2828
+
2829
+
2830
+
2831
+ </dl>
2832
+
2833
+
2834
+
2835
+
2836
+
2837
+
2838
+
2839
+
2840
+
2841
+
2842
+
2050
2843
 
2051
2844
 
2052
2845
 
@@ -2067,7 +2860,7 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
2067
2860
 
2068
2861
 
2069
2862
  <div class="param-desc">
2070
- <p>回傳正規化後之新陣列</p>
2863
+ <p>回傳 { run, releaseBtnLocks, isRunning }</p>
2071
2864
  </div>
2072
2865
 
2073
2866
 
@@ -2078,7 +2871,7 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
2078
2871
  </dt>
2079
2872
  <dd>
2080
2873
 
2081
- <span class="param-type">Array</span>
2874
+ <span class="param-type">Object</span>
2082
2875
 
2083
2876
 
2084
2877
 
@@ -2094,7 +2887,7 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
2094
2887
 
2095
2888
 
2096
2889
 
2097
- <h4 class="name" id="submitGuard"><span class="type-signature"></span>submitGuard<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
2890
+ <h4 class="name" id="validateRowsBeforeWrite"><span class="type-signature"></span>validateRowsBeforeWrite<span class="signature">(rows, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object|null}</span></h4>
2098
2891
 
2099
2892
 
2100
2893
 
@@ -2104,25 +2897,22 @@ reject 之 message 只含例外名稱與代碼(如 'TypeError ECONNREFUSED'、'S
2104
2897
  <dl class="details">
2105
2898
 
2106
2899
  <dt class="tag-description">Description:</dt>
2107
- <dd class="tag-description"><ul class="dummy"><li><p>送出類操作之前端雙擊防護核心 (與 Vue / store 無關, 供單元測試; 由 mUI 之 runSubmit 與 updateLoading 使用, ADR-025)</p>
2108
- <ul>
2109
- <li>run(key, fn, opt): 同 key 之送出流程進行中(自觸發起至流程結束, 含結果訊息框開啟期間)再觸發即略過.
2110
- 按鈕之滑鼠與鍵盤 Enter、輸入框之 Enter 等入口共用同一狀態.
2111
- opt.pm 為 WButtonChip / WButtonCircle 之 promiseUnlock 鎖(click 事件之 msg.pm), 於 releaseBtnLocks()(全頁 loading 關閉, 即請求結束)
2112
- 或流程結束時釋放; 被略過之觸發亦立即釋放其 pm, 否則該按鈕永久鎖住.
2113
- fn 收到 unlock 函數: 流程需先開確認框者於開框前呼叫, 按鈕鎖只涵蓋請求期間(確認框背後之按鈕不顯示載入圖示), 重入仍由流程狀態擋.
2114
- opt.hold 為函數, 輸入流程結果, 回傳 true 時保持占位與按鈕鎖(如登入成功轉址, 頁面即將離開).</li>
2115
- <li>releaseBtnLocks(): 釋放進行中流程所登記之按鈕鎖, 流程狀態不變(結果訊息框開啟期間之重入仍擋).</li>
2116
- <li>isRunning(key): 查詢 key 是否進行中.</li>
2117
- </ul>
2118
- <p>為何需要: 全頁 loading(WDialog)不搶焦點, 只擋滑鼠, 鍵盤事件仍送達背後之按鈕與輸入框;
2119
- 按鈕鎖若於 handler 第一行即解除, 鍵盤連按照樣送出(2026-09-29 實測).</p></li></ul></dd>
2900
+ <dd class="tag-description"><ul class="dummy"><li><p>寫入前驗證可預判之 ORM 寫入失敗(ADR-026, 規則帳本 R-ORM-01)</p>
2901
+ <p>寫入路徑皆「先破壞後寫入」(整表儲存為 del → insert → save, 外部同步為 delAll → insert), 而 ORM(w-serv-orm 1.1.8 起)對下列輸入整批拒絕,
2902
+ 於第一個破壞步驟之後才被拒會造成部分寫入或資料遺失, 故須於任何寫入之前判定:</p>
2903
+ <ol>
2904
+ <li>主鍵 id 有給時須為非空字串或有限數字(NaN、±Infinity 視為未給, 同 w-serv-orm 1.1.11 之補值), 字串之 UTF-8 位元組數不得超過 1978(LMDB 鍵長上限),
2905
+ 且批內不得重複(以 String(id) 比對: w-serv-orm 1.1.11 起數字主鍵存為其字串形式, 數字與其字串形式為同一主鍵).</li>
2906
+ <li>任一字串欄位之值會被 wsemi 之 clearXSS 改寫者(含 HTML 標記, 如「&lt;」後接英文字母)即拒絕——與 w-serv-orm 寫入前之 adjustData 同一函數,
2907
+ 主鍵被改寫時 ORM 拒絕整批, 其他欄位則會被靜默改寫(存值與送入值不同), 兩者皆於此擋下, 使送入值即儲存值.
2908
+ 本函數為純函數: 不修改輸入、不呼叫 ORM; 主鍵是否必填由呼叫端以 opt.idRequired 指定(未給主鍵之列由 ORM 自動補主鍵者可不要求).</li>
2909
+ </ol></li></ul></dd>
2120
2910
 
2121
2911
 
2122
2912
 
2123
2913
  <dt class="tag-source">Source:</dt>
2124
2914
  <dd class="tag-source"><ul class="dummy"><li>
2125
- <a href="src_plugins_submitGuard.mjs.html">src/plugins/submitGuard.mjs</a>, <a href="src_plugins_submitGuard.mjs.html#line24">line 24</a>
2915
+ <a href="server_validateRows.mjs.html">server/validateRows.mjs</a>, <a href="server_validateRows.mjs.html#line30">line 30</a>
2126
2916
  </li></ul></dd>
2127
2917
 
2128
2918
 
@@ -2169,6 +2959,222 @@ opt.hold 為函數, 輸入流程結果, 回傳 true 時保持占位與按鈕鎖(
2169
2959
 
2170
2960
 
2171
2961
 
2962
+ <h5 class="h5-parameters">Parameters:</h5>
2963
+
2964
+
2965
+ <table class="params">
2966
+ <thead>
2967
+ <tr>
2968
+
2969
+ <th>Name</th>
2970
+
2971
+
2972
+ <th>Type</th>
2973
+
2974
+
2975
+ <th>Attributes</th>
2976
+
2977
+
2978
+
2979
+ <th>Default</th>
2980
+
2981
+
2982
+ <th class="last">Description</th>
2983
+ </tr>
2984
+ </thead>
2985
+
2986
+ <tbody>
2987
+
2988
+
2989
+ <tr>
2990
+
2991
+ <td class="name"><code>rows</code></td>
2992
+
2993
+
2994
+ <td class="type">
2995
+
2996
+
2997
+ <span class="param-type">Array</span>
2998
+
2999
+
3000
+
3001
+
3002
+ </td>
3003
+
3004
+
3005
+ <td class="attributes">
3006
+
3007
+
3008
+
3009
+
3010
+
3011
+ </td>
3012
+
3013
+
3014
+
3015
+ <td class="default">
3016
+
3017
+ </td>
3018
+
3019
+
3020
+ <td class="description last"><p>輸入待寫入之列陣列, 各列為物件</p></td>
3021
+ </tr>
3022
+
3023
+
3024
+
3025
+ <tr>
3026
+
3027
+ <td class="name"><code>opt</code></td>
3028
+
3029
+
3030
+ <td class="type">
3031
+
3032
+
3033
+ <span class="param-type">Object</span>
3034
+
3035
+
3036
+
3037
+
3038
+ </td>
3039
+
3040
+
3041
+ <td class="attributes">
3042
+
3043
+ &lt;optional><br>
3044
+
3045
+
3046
+
3047
+
3048
+
3049
+ </td>
3050
+
3051
+
3052
+
3053
+ <td class="default">
3054
+
3055
+ <code>{}</code>
3056
+
3057
+ </td>
3058
+
3059
+
3060
+ <td class="description last"><p>輸入設定物件</p>
3061
+ <h6>Properties</h6>
3062
+
3063
+
3064
+ <table class="params">
3065
+ <thead>
3066
+ <tr>
3067
+
3068
+ <th>Name</th>
3069
+
3070
+
3071
+ <th>Type</th>
3072
+
3073
+
3074
+ <th>Attributes</th>
3075
+
3076
+
3077
+
3078
+ <th>Default</th>
3079
+
3080
+
3081
+ <th class="last">Description</th>
3082
+ </tr>
3083
+ </thead>
3084
+
3085
+ <tbody>
3086
+
3087
+
3088
+ <tr>
3089
+
3090
+ <td class="name"><code>idRequired</code></td>
3091
+
3092
+
3093
+ <td class="type">
3094
+
3095
+
3096
+ <span class="param-type">Boolean</span>
3097
+
3098
+
3099
+
3100
+
3101
+ </td>
3102
+
3103
+
3104
+ <td class="attributes">
3105
+
3106
+ &lt;optional><br>
3107
+
3108
+
3109
+
3110
+
3111
+
3112
+ </td>
3113
+
3114
+
3115
+
3116
+ <td class="default">
3117
+
3118
+ <code>false</code>
3119
+
3120
+ </td>
3121
+
3122
+
3123
+ <td class="description last"><p>輸入主鍵是否必填, 預設false</p></td>
3124
+ </tr>
3125
+
3126
+
3127
+
3128
+ <tr>
3129
+
3130
+ <td class="name"><code>rowsIdOnly</code></td>
3131
+
3132
+
3133
+ <td class="type">
3134
+
3135
+
3136
+ <span class="param-type">Array</span>
3137
+
3138
+
3139
+
3140
+
3141
+ </td>
3142
+
3143
+
3144
+ <td class="attributes">
3145
+
3146
+ &lt;optional><br>
3147
+
3148
+
3149
+
3150
+
3151
+
3152
+ </td>
3153
+
3154
+
3155
+
3156
+ <td class="default">
3157
+
3158
+ <code>[]</code>
3159
+
3160
+ </td>
3161
+
3162
+
3163
+ <td class="description last"><p>輸入只參與主鍵檢查(重複、長度)而不檢查欄位標記之列陣列(如整表儲存中不會被寫入之既有列), 預設[]</p></td>
3164
+ </tr>
3165
+
3166
+
3167
+ </tbody>
3168
+ </table>
3169
+
3170
+ </td>
3171
+ </tr>
3172
+
3173
+
3174
+ </tbody>
3175
+ </table>
3176
+
3177
+
2172
3178
 
2173
3179
 
2174
3180
 
@@ -2187,7 +3193,7 @@ opt.hold 為函數, 輸入流程結果, 回傳 true 時保持占位與按鈕鎖(
2187
3193
 
2188
3194
 
2189
3195
  <div class="param-desc">
2190
- <p>回傳 { run, releaseBtnLocks, isRunning }</p>
3196
+ <p>回傳第一個違規 { reason, k, field }, reason 為 'idInvalid'、'idTooLong'、'idDuplicate'、'htmlMarkup' 之一, k 為該列於 rows 之位置(rowsIdOnly 之列為 -1), field 為欄位名; 皆通過回傳 null</p>
2191
3197
  </div>
2192
3198
 
2193
3199
 
@@ -2199,6 +3205,9 @@ opt.hold 為函數, 輸入流程結果, 回傳 true 時保持占位與按鈕鎖(
2199
3205
  <dd>
2200
3206
 
2201
3207
  <span class="param-type">Object</span>
3208
+ |
3209
+
3210
+ <span class="param-type">null</span>
2202
3211
 
2203
3212
 
2204
3213
 
@@ -2535,6 +3544,238 @@ opt.hold 為函數, 輸入流程結果, 回傳 true 時保持占位與按鈕鎖(
2535
3544
 
2536
3545
 
2537
3546
 
3547
+
3548
+
3549
+
3550
+
3551
+ <h4 class="name" id="wrapOperOrm"><span class="type-signature"></span>wrapOperOrm<span class="signature">(procOrm, p)</span><span class="type-signature"> &rarr; {function}</span></h4>
3552
+
3553
+
3554
+
3555
+
3556
+
3557
+
3558
+ <dl class="details">
3559
+
3560
+ <dt class="tag-description">Description:</dt>
3561
+ <dd class="tag-description"><ul class="dummy"><li><p>包裝資料通道之 operOrm: ORM 拒絕之原文(英文訊息、Error)只入 srLog, 對前端改回語系鍵 anUnexpectedErrorOccurred</p></li></ul></dd>
3562
+
3563
+
3564
+
3565
+ <dt class="tag-source">Source:</dt>
3566
+ <dd class="tag-source"><ul class="dummy"><li>
3567
+ <a href="server_dataChannel.mjs.html">server/dataChannel.mjs</a>, <a href="server_dataChannel.mjs.html#line45">line 45</a>
3568
+ </li></ul></dd>
3569
+
3570
+
3571
+
3572
+
3573
+
3574
+
3575
+
3576
+
3577
+
3578
+
3579
+
3580
+
3581
+
3582
+
3583
+
3584
+
3585
+
3586
+
3587
+
3588
+
3589
+
3590
+
3591
+
3592
+
3593
+
3594
+
3595
+
3596
+
3597
+
3598
+
3599
+
3600
+ </dl>
3601
+
3602
+
3603
+
3604
+
3605
+
3606
+
3607
+
3608
+
3609
+
3610
+
3611
+
3612
+
3613
+
3614
+ <h5 class="h5-parameters">Parameters:</h5>
3615
+
3616
+
3617
+ <table class="params">
3618
+ <thead>
3619
+ <tr>
3620
+
3621
+ <th>Name</th>
3622
+
3623
+
3624
+ <th>Type</th>
3625
+
3626
+
3627
+
3628
+
3629
+
3630
+ <th class="last">Description</th>
3631
+ </tr>
3632
+ </thead>
3633
+
3634
+ <tbody>
3635
+
3636
+
3637
+ <tr>
3638
+
3639
+ <td class="name"><code>procOrm</code></td>
3640
+
3641
+
3642
+ <td class="type">
3643
+
3644
+
3645
+ <span class="param-type">function</span>
3646
+
3647
+
3648
+
3649
+
3650
+ </td>
3651
+
3652
+
3653
+
3654
+
3655
+
3656
+ <td class="description last"><p>輸入 w-serv-orm 之 procOrm(userId, tableName, methodName, input)</p></td>
3657
+ </tr>
3658
+
3659
+
3660
+
3661
+ <tr>
3662
+
3663
+ <td class="name"><code>p</code></td>
3664
+
3665
+
3666
+ <td class="type">
3667
+
3668
+
3669
+ <span class="param-type">Object</span>
3670
+
3671
+
3672
+
3673
+
3674
+ </td>
3675
+
3676
+
3677
+
3678
+
3679
+
3680
+ <td class="description last"><p>輸入物件</p>
3681
+ <h6>Properties</h6>
3682
+
3683
+
3684
+ <table class="params">
3685
+ <thead>
3686
+ <tr>
3687
+
3688
+ <th>Name</th>
3689
+
3690
+
3691
+ <th>Type</th>
3692
+
3693
+
3694
+
3695
+
3696
+
3697
+ <th class="last">Description</th>
3698
+ </tr>
3699
+ </thead>
3700
+
3701
+ <tbody>
3702
+
3703
+
3704
+ <tr>
3705
+
3706
+ <td class="name"><code>srLog</code></td>
3707
+
3708
+
3709
+ <td class="type">
3710
+
3711
+
3712
+ <span class="param-type">Object</span>
3713
+
3714
+
3715
+
3716
+
3717
+ </td>
3718
+
3719
+
3720
+
3721
+
3722
+
3723
+ <td class="description last"><p>輸入 srLog(須有 error 方法)</p></td>
3724
+ </tr>
3725
+
3726
+
3727
+ </tbody>
3728
+ </table>
3729
+
3730
+ </td>
3731
+ </tr>
3732
+
3733
+
3734
+ </tbody>
3735
+ </table>
3736
+
3737
+
3738
+
3739
+
3740
+
3741
+
3742
+
3743
+
3744
+
3745
+
3746
+
3747
+
3748
+
3749
+
3750
+
3751
+
3752
+ <h5 class="h5-returns">Returns:</h5>
3753
+
3754
+
3755
+ <div class="param-desc">
3756
+ <p>回傳同簽名之 async 函數</p>
3757
+ </div>
3758
+
3759
+
3760
+
3761
+ <dl class="param-type">
3762
+ <dt>
3763
+ Type
3764
+ </dt>
3765
+ <dd>
3766
+
3767
+ <span class="param-type">function</span>
3768
+
3769
+
3770
+
3771
+ </dd>
3772
+ </dl>
3773
+
3774
+
3775
+
3776
+
3777
+
3778
+
2538
3779
 
2539
3780
 
2540
3781
 
@@ -2554,7 +3795,7 @@ opt.hold 為函數, 輸入流程結果, 回傳 true 時保持占位與按鈕鎖(
2554
3795
  <br class="clear">
2555
3796
 
2556
3797
  <footer>
2557
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Sun Oct 11 2026 16:35:27 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
3798
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Tue Oct 20 2026 06:46:43 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
2558
3799
  </footer>
2559
3800
 
2560
3801
  <script>prettyPrint();</script>