w-data-collector 1.0.1

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 (60) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +54 -0
  4. package/.jsdoc +25 -0
  5. package/LICENSE +21 -0
  6. package/README.md +43 -0
  7. package/SECURITY.md +5 -0
  8. package/babel.config.js +14 -0
  9. package/dist/w-data-collector.umd.js +7 -0
  10. package/dist/w-data-collector.umd.js.map +1 -0
  11. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  29. package/docs/genIndex.mjs.html +189 -0
  30. package/docs/genTestdata.mjs.html +162 -0
  31. package/docs/global.html +891 -0
  32. package/docs/index.html +81 -0
  33. package/docs/scripts/collapse.js +20 -0
  34. package/docs/scripts/linenumber.js +25 -0
  35. package/docs/scripts/nav.js +12 -0
  36. package/docs/scripts/polyfill.js +4 -0
  37. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  38. package/docs/scripts/prettify/lang-css.js +2 -0
  39. package/docs/scripts/prettify/prettify.js +28 -0
  40. package/docs/scripts/search.js +83 -0
  41. package/docs/styles/jsdoc.css +765 -0
  42. package/docs/styles/prettify.css +79 -0
  43. package/gi.mjs +13 -0
  44. package/gt.mjs +11 -0
  45. package/package.json +32 -0
  46. package/src/WDataCollector.mjs +13 -0
  47. package/src/build.mjs +127 -0
  48. package/src/genIndex.mjs +120 -0
  49. package/src/genTestdata.mjs +93 -0
  50. package/test/genIndex.test.mjs +17 -0
  51. package/test/schema/index.mjs +20 -0
  52. package/test/schema/index.mjs.txt +20 -0
  53. package/test/schema/tables/holeLabTabs.mjs +130 -0
  54. package/test/schema/tables/holeLabTabsItems.mjs +318 -0
  55. package/test/schema/tables/users.mjs +102 -0
  56. package/toolg/addVersion.mjs +4 -0
  57. package/toolg/cleanFolder.mjs +4 -0
  58. package/toolg/gDistRollup.mjs +35 -0
  59. package/toolg/gDocsExams.mjs +51 -0
  60. package/toolg/modifyReadme.mjs +4 -0
@@ -0,0 +1,891 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>Global - 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
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+ </head>
19
+ <body>
20
+
21
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
22
+ <label for="nav-trigger" class="navicon-button x">
23
+ <div class="navicon"></div>
24
+ </label>
25
+
26
+ <label for="nav-trigger" class="overlay"></label>
27
+
28
+ <nav >
29
+
30
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#genIndex">genIndex</a></li><li><a href="global.html#genTestdata">genTestdata</a></li></ul>
31
+ </nav>
32
+
33
+ <div id="main">
34
+
35
+ <h1 class="page-title">Global</h1>
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ <section>
44
+
45
+ <header>
46
+
47
+ <h2>
48
+
49
+ </h2>
50
+
51
+
52
+ </header>
53
+
54
+ <article>
55
+
56
+ <div class="container-overview">
57
+
58
+
59
+
60
+ <dl class="details">
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ </dl>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+ <h3 class="subsection-title">Methods</h3>
121
+
122
+
123
+
124
+
125
+
126
+
127
+ <h4 class="name" id="genIndex"><span class="type-signature"></span>genIndex<span class="signature">(fdSrc, fdIndex, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <dl class="details">
135
+
136
+
137
+ <dt class="tag-source">Source:</dt>
138
+ <dd class="tag-source"><ul class="dummy"><li>
139
+ <a href="genIndex.mjs.html">genIndex.mjs</a>, <a href="genIndex.mjs.html#line48">line 48</a>
140
+ </li></ul></dd>
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+ </dl>
173
+
174
+
175
+
176
+
177
+
178
+ <div class="description usertext">
179
+ <p>由各資料表定義*.mjs檔產生資料表收集物件ds</p>
180
+ </div>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+ <h5>Example</h5>
191
+
192
+ <pre class="prettyprint"><code>import genIndex from 'w-data-collector/src/genIndex.mjs'
193
+
194
+
195
+
196
+
197
+ <h5>Parameters:</h5>
198
+
199
+
200
+ <table class="params">
201
+ <thead>
202
+ <tr>
203
+
204
+ <th>Name</th>
205
+
206
+
207
+ <th>Type</th>
208
+
209
+
210
+ <th>Attributes</th>
211
+
212
+
213
+
214
+ <th>Default</th>
215
+
216
+
217
+ <th class="last">Description</th>
218
+ </tr>
219
+ </thead>
220
+
221
+ <tbody>
222
+
223
+
224
+ <tr>
225
+
226
+ <td class="name"><code>fdSrc</code></td>
227
+
228
+
229
+ <td class="type">
230
+
231
+
232
+ <span class="param-type">String</span>
233
+
234
+
235
+
236
+ </td>
237
+
238
+
239
+ <td class="attributes">
240
+
241
+
242
+
243
+
244
+
245
+ </td>
246
+
247
+
248
+
249
+ <td class="default">
250
+
251
+ </td>
252
+
253
+
254
+ <td class="description last"><p>輸入各資料表定義*.mjs檔案所在資料夾</p></td>
255
+ </tr>
256
+
257
+
258
+
259
+ <tr>
260
+
261
+ <td class="name"><code>fdIndex</code></td>
262
+
263
+
264
+ <td class="type">
265
+
266
+
267
+ <span class="param-type">String</span>
268
+
269
+
270
+
271
+ </td>
272
+
273
+
274
+ <td class="attributes">
275
+
276
+
277
+
278
+
279
+
280
+ </td>
281
+
282
+
283
+
284
+ <td class="default">
285
+
286
+ </td>
287
+
288
+
289
+ <td class="description last"><p>輸入產生index.mjs檔案需儲存至的資料夾,主要是跟各資料表定義*.mjs檔計算相對路徑供程式碼import用</p></td>
290
+ </tr>
291
+
292
+
293
+
294
+ <tr>
295
+
296
+ <td class="name"><code>opt</code></td>
297
+
298
+
299
+ <td class="type">
300
+
301
+
302
+ <span class="param-type">Object</span>
303
+
304
+
305
+
306
+ </td>
307
+
308
+
309
+ <td class="attributes">
310
+
311
+ &lt;optional><br>
312
+
313
+
314
+
315
+
316
+
317
+ </td>
318
+
319
+
320
+
321
+ <td class="default">
322
+
323
+ <code>{}</code>
324
+
325
+ </td>
326
+
327
+
328
+ <td class="description last"><p>輸入設定物件,預設{}</p>
329
+ <h6>Properties</h6>
330
+
331
+
332
+ <table class="params">
333
+ <thead>
334
+ <tr>
335
+
336
+ <th>Name</th>
337
+
338
+
339
+ <th>Type</th>
340
+
341
+
342
+ <th>Attributes</th>
343
+
344
+
345
+
346
+ <th>Default</th>
347
+
348
+
349
+ <th class="last">Description</th>
350
+ </tr>
351
+ </thead>
352
+
353
+ <tbody>
354
+
355
+
356
+ <tr>
357
+
358
+ <td class="name"><code>fpBuild</code></td>
359
+
360
+
361
+ <td class="type">
362
+
363
+
364
+ <span class="param-type">String</span>
365
+
366
+
367
+
368
+ </td>
369
+
370
+
371
+ <td class="attributes">
372
+
373
+ &lt;optional><br>
374
+
375
+
376
+
377
+
378
+
379
+ </td>
380
+
381
+
382
+
383
+ <td class="default">
384
+
385
+ <code>'w-data-collector/src/build.mjs'</code>
386
+
387
+ </td>
388
+
389
+
390
+ <td class="description last"><p>輸入程式碼所需import之再處理資料表定義*.mjs檔的build函數,預設為'w-data-collector/src/build.mjs'</p></td>
391
+ </tr>
392
+
393
+
394
+
395
+ <tr>
396
+
397
+ <td class="name"><code>fnIndex</code></td>
398
+
399
+
400
+ <td class="type">
401
+
402
+
403
+ <span class="param-type">String</span>
404
+
405
+
406
+
407
+ </td>
408
+
409
+
410
+ <td class="attributes">
411
+
412
+ &lt;optional><br>
413
+
414
+
415
+
416
+
417
+
418
+ </td>
419
+
420
+
421
+
422
+ <td class="default">
423
+
424
+ <code>'index.mjs'</code>
425
+
426
+ </td>
427
+
428
+
429
+ <td class="description last"><p>輸入產生ds所需程式碼index.mjs檔案的名稱,預設為'index.mjs',實際檔案儲存位置為fdIndex下fnIndex</p></td>
430
+ </tr>
431
+
432
+
433
+ </tbody>
434
+ </table>
435
+
436
+ </td>
437
+ </tr>
438
+
439
+
440
+ </tbody>
441
+ </table>
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+ <h4 class="name" id="genTestdata"><span class="type-signature">(async) </span>genTestdata<span class="signature">(ds, wo, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
467
+
468
+
469
+
470
+
471
+
472
+
473
+ <dl class="details">
474
+
475
+
476
+ <dt class="tag-source">Source:</dt>
477
+ <dd class="tag-source"><ul class="dummy"><li>
478
+ <a href="genTestdata.mjs.html">genTestdata.mjs</a>, <a href="genTestdata.mjs.html#line59">line 59</a>
479
+ </li></ul></dd>
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+ </dl>
512
+
513
+
514
+
515
+
516
+
517
+ <div class="description usertext">
518
+ <p>由資料表收集物件ds與資料表控制物件wo產生測試資料,並儲存至資料庫</p>
519
+ </div>
520
+
521
+
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+ <h5>Example</h5>
530
+
531
+ <pre class="prettyprint"><code>import genTestdata from 'w-data-collector/src/genTestdata.mjs'
532
+
533
+
534
+
535
+
536
+ <h5>Parameters:</h5>
537
+
538
+
539
+ <table class="params">
540
+ <thead>
541
+ <tr>
542
+
543
+ <th>Name</th>
544
+
545
+
546
+ <th>Type</th>
547
+
548
+
549
+ <th>Attributes</th>
550
+
551
+
552
+
553
+ <th>Default</th>
554
+
555
+
556
+ <th class="last">Description</th>
557
+ </tr>
558
+ </thead>
559
+
560
+ <tbody>
561
+
562
+
563
+ <tr>
564
+
565
+ <td class="name"><code>ds</code></td>
566
+
567
+
568
+ <td class="type">
569
+
570
+
571
+ <span class="param-type">Object</span>
572
+
573
+
574
+
575
+ </td>
576
+
577
+
578
+ <td class="attributes">
579
+
580
+
581
+
582
+
583
+
584
+ </td>
585
+
586
+
587
+
588
+ <td class="default">
589
+
590
+ </td>
591
+
592
+
593
+ <td class="description last"><p>輸入資料表收集物件,ds也就是import由genIndex產生的index.mjs,其內各key代表各資料表,值代表各資料表設定與操作函數例如settings、fnew或ftest等</p></td>
594
+ </tr>
595
+
596
+
597
+
598
+ <tr>
599
+
600
+ <td class="name"><code>wo</code></td>
601
+
602
+
603
+ <td class="type">
604
+
605
+
606
+ <span class="param-type">Object</span>
607
+
608
+
609
+
610
+ </td>
611
+
612
+
613
+ <td class="attributes">
614
+
615
+
616
+
617
+
618
+
619
+ </td>
620
+
621
+
622
+
623
+ <td class="default">
624
+
625
+ </td>
626
+
627
+
628
+ <td class="description last"><p>輸入資料表控制物件,各key代表各資料表,值代表各資料表操作函數例如insert、save、del等</p></td>
629
+ </tr>
630
+
631
+
632
+
633
+ <tr>
634
+
635
+ <td class="name"><code>opt</code></td>
636
+
637
+
638
+ <td class="type">
639
+
640
+
641
+ <span class="param-type">Object</span>
642
+
643
+
644
+
645
+ </td>
646
+
647
+
648
+ <td class="attributes">
649
+
650
+ &lt;optional><br>
651
+
652
+
653
+
654
+
655
+
656
+ </td>
657
+
658
+
659
+
660
+ <td class="default">
661
+
662
+ <code>{}</code>
663
+
664
+ </td>
665
+
666
+
667
+ <td class="description last"><p>輸入設定物件,預設{}</p>
668
+ <h6>Properties</h6>
669
+
670
+
671
+ <table class="params">
672
+ <thead>
673
+ <tr>
674
+
675
+ <th>Name</th>
676
+
677
+
678
+ <th>Type</th>
679
+
680
+
681
+ <th>Attributes</th>
682
+
683
+
684
+
685
+ <th>Default</th>
686
+
687
+
688
+ <th class="last">Description</th>
689
+ </tr>
690
+ </thead>
691
+
692
+ <tbody>
693
+
694
+
695
+ <tr>
696
+
697
+ <td class="name"><code>useGenModels</code></td>
698
+
699
+
700
+ <td class="type">
701
+
702
+
703
+ <span class="param-type">Boolean</span>
704
+
705
+
706
+
707
+ </td>
708
+
709
+
710
+ <td class="attributes">
711
+
712
+ &lt;optional><br>
713
+
714
+
715
+
716
+
717
+
718
+ </td>
719
+
720
+
721
+
722
+ <td class="default">
723
+
724
+ <code>false</code>
725
+
726
+ </td>
727
+
728
+
729
+ <td class="description last"><p>輸入是否呼叫genModels,若資料庫與ORM為關聯資料庫時需設定為true,同時還需給予opt.genModelsByTabs。預設為false</p></td>
730
+ </tr>
731
+
732
+
733
+
734
+ <tr>
735
+
736
+ <td class="name"><code>genModelsByTabs</code></td>
737
+
738
+
739
+ <td class="type">
740
+
741
+
742
+ <span class="param-type">function</span>
743
+
744
+
745
+
746
+ </td>
747
+
748
+
749
+ <td class="attributes">
750
+
751
+ &lt;optional><br>
752
+
753
+
754
+
755
+
756
+
757
+ </td>
758
+
759
+
760
+
761
+ <td class="default">
762
+
763
+ <code>null</code>
764
+
765
+ </td>
766
+
767
+
768
+ <td class="description last"><p>輸入可由ds與wo產生models的函數,若資料庫與ORM為關聯資料庫時則需給予,可由程式碼import genModelsByTabs from 'w-orm-reladb/src/genModelsByTabs.mjs'取得genModelsByTabs,並再設定給opt.genModelsByTabs</p></td>
769
+ </tr>
770
+
771
+
772
+
773
+ <tr>
774
+
775
+ <td class="name"><code>fdModels</code></td>
776
+
777
+
778
+ <td class="type">
779
+
780
+
781
+ <span class="param-type">String</span>
782
+
783
+
784
+
785
+ </td>
786
+
787
+
788
+ <td class="attributes">
789
+
790
+ &lt;optional><br>
791
+
792
+
793
+
794
+
795
+
796
+ </td>
797
+
798
+
799
+
800
+ <td class="default">
801
+
802
+ <code>'./models'</code>
803
+
804
+ </td>
805
+
806
+
807
+ <td class="description last"><p>輸入產生models放置的資料夾位置,預設為工作路徑下的models</p></td>
808
+ </tr>
809
+
810
+
811
+ </tbody>
812
+ </table>
813
+
814
+ </td>
815
+ </tr>
816
+
817
+
818
+ </tbody>
819
+ </table>
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+ <h5>Returns:</h5>
837
+
838
+
839
+ <div class="param-desc">
840
+ <p>回傳Promise,resolve代表產生成功,reject代表產生失敗</p>
841
+ </div>
842
+
843
+
844
+
845
+ <dl class="param-type">
846
+ <dt>
847
+ Type
848
+ </dt>
849
+ <dd>
850
+
851
+ <span class="param-type">Promise</span>
852
+
853
+
854
+ </dd>
855
+ </dl>
856
+
857
+
858
+
859
+
860
+
861
+
862
+
863
+
864
+
865
+
866
+
867
+ </article>
868
+
869
+ </section>
870
+
871
+
872
+
873
+
874
+
875
+
876
+ </div>
877
+
878
+ <br class="clear">
879
+
880
+ <footer>
881
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a> on Thu Oct 28 2021 15:38:46 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
882
+ </footer>
883
+
884
+ <script>prettyPrint();</script>
885
+ <script src="scripts/polyfill.js"></script>
886
+ <script src="scripts/linenumber.js"></script>
887
+
888
+
889
+
890
+ </body>
891
+ </html>