w-web-perm 1.0.0

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 (101) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.github/workflows/ci-test.yml +24 -0
  5. package/.jsdoc +25 -0
  6. package/.vscode/launch.json +21 -0
  7. package/LICENSE +21 -0
  8. package/README.md +24 -0
  9. package/SECURITY.md +5 -0
  10. package/babel.config.js +15 -0
  11. package/dist/css/app.79b4b59b.css +1 -0
  12. package/dist/css/chunk-vendors.65775501.css +5 -0
  13. package/dist/index.tmp +1 -0
  14. package/dist/js/app-legacy.954e168c.js +2 -0
  15. package/dist/js/app-legacy.954e168c.js.map +1 -0
  16. package/dist/js/app.954e168c.js +2 -0
  17. package/dist/js/app.954e168c.js.map +1 -0
  18. package/dist/js/chunk-vendors-legacy.f5f1a231.js +13 -0
  19. package/dist/js/chunk-vendors-legacy.f5f1a231.js.map +1 -0
  20. package/dist/js/chunk-vendors.f5f1a231.js +13 -0
  21. package/dist/js/chunk-vendors.f5f1a231.js.map +1 -0
  22. package/dist/w-web-perm.umd.js +7 -0
  23. package/dist/w-web-perm.umd.js.map +1 -0
  24. package/docs/WWebPerm.html +826 -0
  25. package/docs/WWebPerm.mjs.html +558 -0
  26. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  27. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  28. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  29. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  30. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  31. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  32. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  33. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  34. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  35. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  36. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  37. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  38. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  39. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  40. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  41. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  42. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  43. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  44. package/docs/index.html +84 -0
  45. package/docs/scripts/collapse.js +39 -0
  46. package/docs/scripts/commonNav.js +28 -0
  47. package/docs/scripts/linenumber.js +25 -0
  48. package/docs/scripts/nav.js +12 -0
  49. package/docs/scripts/polyfill.js +4 -0
  50. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  51. package/docs/scripts/prettify/lang-css.js +2 -0
  52. package/docs/scripts/prettify/prettify.js +28 -0
  53. package/docs/scripts/search.js +99 -0
  54. package/docs/styles/jsdoc.css +776 -0
  55. package/docs/styles/prettify.css +80 -0
  56. package/g.getSettings.mjs +17 -0
  57. package/g.mDb.mjs +10 -0
  58. package/g.mInitialTestData.mjs +20 -0
  59. package/g.mOrm.mjs +24 -0
  60. package/package.json +75 -0
  61. package/public/index.html +23 -0
  62. package/server/WWebPerm.mjs +486 -0
  63. package/src/App.vue +153 -0
  64. package/src/components/Common/CheckYes.vue +85 -0
  65. package/src/components/Common/CheckYesNo.vue +91 -0
  66. package/src/components/Common/LabelItem.vue +106 -0
  67. package/src/components/Common/LoadingWinBar.vue +87 -0
  68. package/src/components/Layout.vue +152 -0
  69. package/src/components/LayoutContent.vue +246 -0
  70. package/src/components/LayoutContentGroups.vue +664 -0
  71. package/src/components/LayoutContentTargets.vue +538 -0
  72. package/src/components/LayoutContentUsers.vue +493 -0
  73. package/src/components/LayoutState.vue +91 -0
  74. package/src/components/VeUser.vue +453 -0
  75. package/src/components/ruleGroup.vue +667 -0
  76. package/src/main.js +103 -0
  77. package/src/perm.mjs +61 -0
  78. package/src/plugins/mDataSelectorSchema.mjs +30 -0
  79. package/src/plugins/mDataSupport.mjs +66 -0
  80. package/src/plugins/mShare.mjs +366 -0
  81. package/src/plugins/mUI.mjs +229 -0
  82. package/src/plugins/mVuetify.mjs +12 -0
  83. package/src/schema/gi.mjs +8 -0
  84. package/src/schema/index.mjs +20 -0
  85. package/src/schema/tables/ruleGroups.mjs +100 -0
  86. package/src/schema/tables/targets.mjs +100 -0
  87. package/src/schema/tables/users.mjs +125 -0
  88. package/src/store/actions.mjs +1 -0
  89. package/src/store/getters.mjs +1 -0
  90. package/src/store/index.mjs +25 -0
  91. package/src/store/mutations.mjs +201 -0
  92. package/src/store/types.mjs +15 -0
  93. package/srv.mjs +52 -0
  94. package/tableTags-web-perm.json +1 -0
  95. package/test/all.test.mjs +10 -0
  96. package/toolg/addVersion.mjs +4 -0
  97. package/toolg/cleanFolder.mjs +4 -0
  98. package/toolg/gDistRollup.mjs +36 -0
  99. package/toolg/genEntry.mjs +23 -0
  100. package/toolg/modifyReadme.mjs +4 -0
  101. package/vue.config.js +15 -0
@@ -0,0 +1,826 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>WWebPerm - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="WWebPerm.html">WWebPerm</a></li></ul>
33
+
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+ <h1 class="page-title">WWebPerm</h1>
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <section>
47
+
48
+ <header>
49
+
50
+ <h2>
51
+
52
+ WWebPerm
53
+
54
+ </h2>
55
+
56
+
57
+ </header>
58
+
59
+ <article>
60
+
61
+ <div class="container-overview">
62
+
63
+
64
+
65
+
66
+
67
+ <h4 class="name" id="WWebPerm"><span class="type-signature"></span>new WWebPerm<span class="signature">(WOrm, url, db, getUserByToken, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
68
+
69
+
70
+
71
+
72
+
73
+
74
+ <dl class="details">
75
+
76
+ <dt class="tag-description">Description:</dt>
77
+ <dd class="tag-description"><ul class="dummy"><li><p>基於hapi之API伺服器</p></li></ul></dd>
78
+
79
+
80
+
81
+ <dt class="tag-source">Source:</dt>
82
+ <dd class="tag-source"><ul class="dummy"><li>
83
+ <a href="WWebPerm.mjs.html">WWebPerm.mjs</a>, <a href="WWebPerm.mjs.html#line45">line 45</a>
84
+ </li></ul></dd>
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ </dl>
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ <h5 class="h5-examples">Example</h5>
129
+
130
+ <pre class="prettyprint"><code></code></pre>
131
+
132
+
133
+
134
+
135
+ <h5 class="h5-parameters">Parameters:</h5>
136
+
137
+
138
+ <table class="params">
139
+ <thead>
140
+ <tr>
141
+
142
+ <th>Name</th>
143
+
144
+
145
+ <th>Type</th>
146
+
147
+
148
+ <th>Attributes</th>
149
+
150
+
151
+
152
+ <th>Default</th>
153
+
154
+
155
+ <th class="last">Description</th>
156
+ </tr>
157
+ </thead>
158
+
159
+ <tbody>
160
+
161
+
162
+ <tr>
163
+
164
+ <td class="name"><code>WOrm</code></td>
165
+
166
+
167
+ <td class="type">
168
+
169
+
170
+ <span class="param-type">function</span>
171
+
172
+
173
+
174
+
175
+ </td>
176
+
177
+
178
+ <td class="attributes">
179
+
180
+
181
+
182
+
183
+
184
+ </td>
185
+
186
+
187
+
188
+ <td class="default">
189
+
190
+ </td>
191
+
192
+
193
+ <td class="description last"><p>輸入資料庫ORM函數</p></td>
194
+ </tr>
195
+
196
+
197
+
198
+ <tr>
199
+
200
+ <td class="name"><code>url</code></td>
201
+
202
+
203
+ <td class="type">
204
+
205
+
206
+ <span class="param-type">String</span>
207
+
208
+
209
+
210
+
211
+ </td>
212
+
213
+
214
+ <td class="attributes">
215
+
216
+
217
+
218
+
219
+
220
+ </td>
221
+
222
+
223
+
224
+ <td class="default">
225
+
226
+ </td>
227
+
228
+
229
+ <td class="description last"><p>輸入資料庫連線字串,例如'mongodb://sername:password@$127.0.0.1:27017'</p></td>
230
+ </tr>
231
+
232
+
233
+
234
+ <tr>
235
+
236
+ <td class="name"><code>db</code></td>
237
+
238
+
239
+ <td class="type">
240
+
241
+
242
+ <span class="param-type">String</span>
243
+
244
+
245
+
246
+
247
+ </td>
248
+
249
+
250
+ <td class="attributes">
251
+
252
+
253
+
254
+
255
+
256
+ </td>
257
+
258
+
259
+
260
+ <td class="default">
261
+
262
+ </td>
263
+
264
+
265
+ <td class="description last"><p>輸入資料庫名稱字串</p></td>
266
+ </tr>
267
+
268
+
269
+
270
+ <tr>
271
+
272
+ <td class="name"><code>getUserByToken</code></td>
273
+
274
+
275
+ <td class="type">
276
+
277
+
278
+ <span class="param-type">function</span>
279
+
280
+
281
+
282
+
283
+ </td>
284
+
285
+
286
+ <td class="attributes">
287
+
288
+
289
+
290
+
291
+
292
+ </td>
293
+
294
+
295
+
296
+ <td class="default">
297
+
298
+ </td>
299
+
300
+
301
+ <td class="description last"><p>輸入處理函數,函數會傳入使用者token,通過此函數處理後並回傳使用者資訊物件,並至少須提供'id'、'email'、'name'、'isAdmin'欄位,且'isAdmin'限輸入'y'或'n',且輸入'y'時會複寫權限系統該使用者之'isAdmin'欄位值</p></td>
302
+ </tr>
303
+
304
+
305
+
306
+ <tr>
307
+
308
+ <td class="name"><code>opt</code></td>
309
+
310
+
311
+ <td class="type">
312
+
313
+
314
+ <span class="param-type">Object</span>
315
+
316
+
317
+
318
+
319
+ </td>
320
+
321
+
322
+ <td class="attributes">
323
+
324
+ &lt;optional><br>
325
+
326
+
327
+
328
+
329
+
330
+ </td>
331
+
332
+
333
+
334
+ <td class="default">
335
+
336
+ <code>{}</code>
337
+
338
+ </td>
339
+
340
+
341
+ <td class="description last"><p>輸入設定物件,預設{}</p>
342
+ <h6>Properties</h6>
343
+
344
+
345
+ <table class="params">
346
+ <thead>
347
+ <tr>
348
+
349
+ <th>Name</th>
350
+
351
+
352
+ <th>Type</th>
353
+
354
+
355
+ <th>Attributes</th>
356
+
357
+
358
+
359
+ <th>Default</th>
360
+
361
+
362
+ <th class="last">Description</th>
363
+ </tr>
364
+ </thead>
365
+
366
+ <tbody>
367
+
368
+
369
+ <tr>
370
+
371
+ <td class="name"><code>serverPort</code></td>
372
+
373
+
374
+ <td class="type">
375
+
376
+
377
+ <span class="param-type">Integer</span>
378
+
379
+
380
+
381
+
382
+ </td>
383
+
384
+
385
+ <td class="attributes">
386
+
387
+ &lt;optional><br>
388
+
389
+
390
+
391
+
392
+
393
+ </td>
394
+
395
+
396
+
397
+ <td class="default">
398
+
399
+ <code>11006</code>
400
+
401
+ </td>
402
+
403
+
404
+ <td class="description last"><p>輸入伺服器通訊port,預設11006</p></td>
405
+ </tr>
406
+
407
+
408
+
409
+ <tr>
410
+
411
+ <td class="name"><code>bCheckUser</code></td>
412
+
413
+
414
+ <td class="type">
415
+
416
+
417
+ <span class="param-type">Boolean</span>
418
+
419
+
420
+
421
+
422
+ </td>
423
+
424
+
425
+ <td class="attributes">
426
+
427
+ &lt;optional><br>
428
+
429
+
430
+
431
+
432
+
433
+ </td>
434
+
435
+
436
+
437
+ <td class="default">
438
+
439
+ <code>false</code>
440
+
441
+ </td>
442
+
443
+
444
+ <td class="description last"><p>輸入是否檢查使用者資訊布林值,預設false</p></td>
445
+ </tr>
446
+
447
+
448
+
449
+ <tr>
450
+
451
+ <td class="name"><code>getUserById</code></td>
452
+
453
+
454
+ <td class="type">
455
+
456
+
457
+ <span class="param-type">function</span>
458
+
459
+
460
+
461
+
462
+ </td>
463
+
464
+
465
+ <td class="attributes">
466
+
467
+ &lt;optional><br>
468
+
469
+
470
+
471
+
472
+
473
+ </td>
474
+
475
+
476
+
477
+ <td class="default">
478
+
479
+ <code>null</code>
480
+
481
+ </td>
482
+
483
+
484
+ <td class="description last"><p>輸入當bCheckUser=true時依照使用者ID取得使用者資訊物件函數,預設null</p></td>
485
+ </tr>
486
+
487
+
488
+
489
+ <tr>
490
+
491
+ <td class="name"><code>bExcludeWhenNotAdmin</code></td>
492
+
493
+
494
+ <td class="type">
495
+
496
+
497
+ <span class="param-type">Boolean</span>
498
+
499
+
500
+
501
+
502
+ </td>
503
+
504
+
505
+ <td class="attributes">
506
+
507
+ &lt;optional><br>
508
+
509
+
510
+
511
+
512
+
513
+ </td>
514
+
515
+
516
+
517
+ <td class="default">
518
+
519
+ <code>false</code>
520
+
521
+ </td>
522
+
523
+
524
+ <td class="description last"><p>輸入使用ORM的select方法時是否自動刪除數據內isActive欄位之布林值,預設false</p></td>
525
+ </tr>
526
+
527
+
528
+
529
+ <tr>
530
+
531
+ <td class="name"><code>webName</code></td>
532
+
533
+
534
+ <td class="type">
535
+
536
+
537
+ <span class="param-type">Object</span>
538
+
539
+
540
+
541
+
542
+ </td>
543
+
544
+
545
+ <td class="attributes">
546
+
547
+ &lt;optional><br>
548
+
549
+
550
+
551
+
552
+
553
+ </td>
554
+
555
+
556
+
557
+ <td class="default">
558
+
559
+ <code>{}</code>
560
+
561
+ </td>
562
+
563
+
564
+ <td class="description last"><p>輸入站台名稱物件,至少包含語系eng與cht鍵的名稱,預設{}</p></td>
565
+ </tr>
566
+
567
+
568
+
569
+ <tr>
570
+
571
+ <td class="name"><code>webDescription</code></td>
572
+
573
+
574
+ <td class="type">
575
+
576
+
577
+ <span class="param-type">Object</span>
578
+
579
+
580
+
581
+
582
+ </td>
583
+
584
+
585
+ <td class="attributes">
586
+
587
+ &lt;optional><br>
588
+
589
+
590
+
591
+
592
+
593
+ </td>
594
+
595
+
596
+
597
+ <td class="default">
598
+
599
+ <code>{}</code>
600
+
601
+ </td>
602
+
603
+
604
+ <td class="description last"><p>輸入站台描述物件,至少包含語系eng與cht鍵的名稱,預設{}</p></td>
605
+ </tr>
606
+
607
+
608
+
609
+ <tr>
610
+
611
+ <td class="name"><code>webLogo</code></td>
612
+
613
+
614
+ <td class="type">
615
+
616
+
617
+ <span class="param-type">String</span>
618
+
619
+
620
+
621
+
622
+ </td>
623
+
624
+
625
+ <td class="attributes">
626
+
627
+ &lt;optional><br>
628
+
629
+
630
+
631
+
632
+
633
+ </td>
634
+
635
+
636
+
637
+ <td class="default">
638
+
639
+ <code>''</code>
640
+
641
+ </td>
642
+
643
+
644
+ <td class="description last"><p>輸入站台logo字串,採base64格式,預設''</p></td>
645
+ </tr>
646
+
647
+
648
+
649
+ <tr>
650
+
651
+ <td class="name"><code>subfolder</code></td>
652
+
653
+
654
+ <td class="type">
655
+
656
+
657
+ <span class="param-type">String</span>
658
+
659
+
660
+
661
+
662
+ </td>
663
+
664
+
665
+ <td class="attributes">
666
+
667
+ &lt;optional><br>
668
+
669
+
670
+
671
+
672
+
673
+ </td>
674
+
675
+
676
+
677
+ <td class="default">
678
+
679
+ <code>''</code>
680
+
681
+ </td>
682
+
683
+
684
+ <td class="description last"><p>輸入站台所在子目錄字串,提供站台位於內網採反向代理進行服務時,故需支援位於子目錄情形,預設''</p></td>
685
+ </tr>
686
+
687
+
688
+
689
+ <tr>
690
+
691
+ <td class="name"><code>mappingBy</code></td>
692
+
693
+
694
+ <td class="type">
695
+
696
+
697
+ <span class="param-type">String</span>
698
+
699
+
700
+
701
+
702
+ </td>
703
+
704
+
705
+ <td class="attributes">
706
+
707
+ &lt;optional><br>
708
+
709
+
710
+
711
+
712
+
713
+ </td>
714
+
715
+
716
+
717
+ <td class="default">
718
+
719
+ <code>'email'</code>
720
+
721
+ </td>
722
+
723
+
724
+ <td class="description last"><p>輸入外部系統識別使用者token後所提供之資料物件,與權限系統之使用者資料物件,兩者間查找之對應欄位,可選'id'、'email'、'name',預設'email'</p></td>
725
+ </tr>
726
+
727
+
728
+ </tbody>
729
+ </table>
730
+
731
+ </td>
732
+ </tr>
733
+
734
+
735
+ </tbody>
736
+ </table>
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+ <h5 class="h5-returns">Returns:</h5>
754
+
755
+
756
+ <div class="param-desc">
757
+ <p>回傳物件,其內server為hapi伺服器實體,wsrv為w-converhp的伺服器事件物件,wsds為w-serv-webdata的伺服器事件物件,可監聽error事件</p>
758
+ </div>
759
+
760
+
761
+
762
+ <dl class="param-type">
763
+ <dt>
764
+ Type
765
+ </dt>
766
+ <dd>
767
+
768
+ <span class="param-type">Object</span>
769
+
770
+
771
+
772
+ </dd>
773
+ </dl>
774
+
775
+
776
+
777
+
778
+
779
+
780
+ </div>
781
+
782
+
783
+
784
+
785
+
786
+
787
+
788
+
789
+
790
+
791
+
792
+
793
+
794
+
795
+
796
+
797
+
798
+
799
+
800
+
801
+
802
+ </article>
803
+
804
+ </section>
805
+
806
+
807
+
808
+
809
+
810
+
811
+ </div>
812
+
813
+ <br class="clear">
814
+
815
+ <footer>
816
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Jul 19 2023 12:50:03 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
817
+ </footer>
818
+
819
+ <script>prettyPrint();</script>
820
+ <script src="scripts/polyfill.js"></script>
821
+ <script src="scripts/linenumber.js"></script>
822
+
823
+
824
+
825
+ </body>
826
+ </html>