w-dwdata-tweq 1.0.21 → 1.0.22

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.
@@ -76,6 +76,7 @@ import cropPic from './cropPic.mjs'
76
76
  * @param {Integer} yearEnd 輸入數據結束年整數
77
77
  * @param {Object} [opt={}] 輸入設定物件,預設{}
78
78
  * @param {String} [opt.keyId='keyId'] 輸入各筆數據之主鍵字串,預設'keyId'
79
+ * @param {String} [opt.fdTagRemove='./_tagRemove'] 輸入暫存標記為刪除數據資料夾字串,預設'./_tagRemove'
79
80
  * @param {String} [opt.fdDwAttime='./_dwAttime'] 輸入當前下載數據資料夾字串,預設'./_dwAttime'
80
81
  * @param {String} [opt.fdDwCurrent='./_dwCurrent'] 輸入已下載數據資料夾字串,預設'./_dwCurrent'
81
82
  * @param {String} [opt.fdResult='./_result'] 輸入已下載數據所連動生成數據資料夾字串,預設'./_result'
@@ -91,11 +92,49 @@ import cropPic from './cropPic.mjs'
91
92
  * @returns {Object} 回傳事件物件,可呼叫函數on監聽change事件
92
93
  * @example
93
94
  *
95
+ * import w from 'wsemi'
94
96
  * import WDwdataTweq from './src/WDwdataTweq.mjs'
95
97
  *
98
+ * //fdTagRemove
99
+ * let fdTagRemove = `./_tagRemove`
100
+ * w.fsCleanFolder(fdTagRemove)
101
+ *
102
+ * //fdDwAttime
103
+ * let fdDwAttime = `./_dwAttime`
104
+ * w.fsCleanFolder(fdDwAttime)
105
+ *
106
+ * //fdDwCurrent
107
+ * let fdDwCurrent = `./_dwCurrent`
108
+ * w.fsCleanFolder(fdDwCurrent)
109
+ *
110
+ * //fdResult
111
+ * let fdResult = `./_result`
112
+ * w.fsCleanFolder(fdResult)
113
+ *
114
+ * //fdTaskCpActualSrc
115
+ * let fdTaskCpActualSrc = `./_taskCpActualSrc`
116
+ * w.fsCleanFolder(fdTaskCpActualSrc)
117
+ *
118
+ * //fdTaskCpSrc
119
+ * let fdTaskCpSrc = `./_taskCpSrc`
120
+ * w.fsCleanFolder(fdTaskCpSrc)
121
+ *
96
122
  * let yearStart = 2022
97
123
  * let yearEnd = 2022
98
- * let opt = {}
124
+ * let opt = {
125
+ * fdTagRemove,
126
+ * fdDwAttime,
127
+ * fdDwCurrent,
128
+ * fdResult,
129
+ * fdTaskCpActualSrc,
130
+ * fdTaskCpSrc,
131
+ * // fdLog,
132
+ * // funDownload,
133
+ * // funGetCurrent,
134
+ * // funRemove,
135
+ * // funAdd,
136
+ * // funModify,
137
+ * }
99
138
  * let ev = await WDwdataTweq(yearStart, yearEnd, opt)
100
139
  * .catch((err) => {
101
140
  * console.log(err)
@@ -140,6 +179,12 @@ let WDwdataTweq = async(yearStart, yearEnd, opt = {}) => {
140
179
  keyId = `id`
141
180
  }
142
181
 
182
+ //fdTagRemove, 暫存標記為刪除數據資料夾
183
+ let fdTagRemove = get(opt, 'fdTagRemove')
184
+ if (!isestr(fdTagRemove)) {
185
+ fdTagRemove = `./_tagRemove`
186
+ }
187
+
143
188
  //fdDwAttime
144
189
  let fdDwAttime = get(opt, 'fdDwAttime')
145
190
  if (!isestr(fdDwAttime)) {
@@ -167,6 +212,15 @@ let WDwdataTweq = async(yearStart, yearEnd, opt = {}) => {
167
212
  fsCreateFolder(fdResult)
168
213
  }
169
214
 
215
+ //fdTaskCpActualSrc, 儲存完整任務狀態資料夾
216
+ let fdTaskCpActualSrc = get(opt, 'fdTaskCpActualSrc')
217
+ if (!isestr(fdTaskCpActualSrc)) {
218
+ fdTaskCpActualSrc = `./_taskCpActualSrc`
219
+ }
220
+ if (!fsIsFolder(fdTaskCpActualSrc)) {
221
+ fsCreateFolder(fdTaskCpActualSrc)
222
+ }
223
+
170
224
  //fdTaskCpSrc
171
225
  let fdTaskCpSrc = get(opt, 'fdTaskCpSrc')
172
226
  if (!isestr(fdTaskCpSrc)) {
@@ -317,11 +371,12 @@ let WDwdataTweq = async(yearStart, yearEnd, opt = {}) => {
317
371
  funModify = funModifyDef
318
372
  }
319
373
 
320
- //WDwdataBuilder
321
374
  let optBdr = {
375
+ fdTagRemove,
322
376
  fdDwAttime,
323
377
  fdDwCurrent,
324
- fdResult,
378
+ // fdResult, //WDwdataBuilder不需要
379
+ fdTaskCpActualSrc,
325
380
  fdTaskCpSrc,
326
381
  fdLog,
327
382
  funDownload,
@@ -352,7 +407,7 @@ export default WDwdataTweq
352
407
  <br class="clear">
353
408
 
354
409
  <footer>
355
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Fri Sep 12 2025 12:04:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
410
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Fri Sep 12 2025 14:51:15 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
356
411
  </footer>
357
412
 
358
413
  <script>prettyPrint();</script>
package/docs/global.html CHANGED
@@ -147,7 +147,7 @@
147
147
 
148
148
  <dt class="tag-source">Source:</dt>
149
149
  <dd class="tag-source"><ul class="dummy"><li>
150
- <a href="WDwdataTweq.mjs.html">WDwdataTweq.mjs</a>, <a href="WDwdataTweq.mjs.html#line76">line 76</a>
150
+ <a href="WDwdataTweq.mjs.html">WDwdataTweq.mjs</a>, <a href="WDwdataTweq.mjs.html#line115">line 115</a>
151
151
  </li></ul></dd>
152
152
 
153
153
 
@@ -194,7 +194,7 @@
194
194
 
195
195
  <h5 class="h5-examples">Example</h5>
196
196
 
197
- <pre class="prettyprint"><code>import WDwdataTweq from './src/WDwdataTweq.mjs'
198
197
  .catch((err) => {
199
198
  console.log(err)
200
199
  })
201
200
  delete msg.type
202
201
  console.log('change', msg)
202
+ <pre class="prettyprint"><code>import w from 'wsemi'
203
203
  fdTagRemove,
204
204
  fdDwAttime,
205
205
  fdDwCurrent,
206
206
  fdResult,
207
207
  fdTaskCpActualSrc,
208
208
  fdTaskCpSrc,
209
209
  // fdLog,
210
210
  // funDownload,
211
211
  // funGetCurrent,
212
212
  // funRemove,
213
213
  // funAdd,
214
214
  // funModify,
215
215
  .catch((err) => {
216
216
  console.log(err)
217
217
  })
218
218
  delete msg.type
219
219
  console.log('change', msg)
220
220
 
221
221
 
222
222
 
@@ -401,6 +401,46 @@
401
401
 
402
402
 
403
403
 
404
+ <tr>
405
+
406
+ <td class="name"><code>fdTagRemove</code></td>
407
+
408
+
409
+ <td class="type">
410
+
411
+
412
+ <span class="param-type">String</span>
413
+
414
+
415
+
416
+
417
+ </td>
418
+
419
+
420
+ <td class="attributes">
421
+
422
+ &lt;optional><br>
423
+
424
+
425
+
426
+
427
+
428
+ </td>
429
+
430
+
431
+
432
+ <td class="default">
433
+
434
+ <code>'./_tagRemove'</code>
435
+
436
+ </td>
437
+
438
+
439
+ <td class="description last"><p>輸入暫存標記為刪除數據資料夾字串,預設'./_tagRemove'</p></td>
440
+ </tr>
441
+
442
+
443
+
404
444
  <tr>
405
445
 
406
446
  <td class="name"><code>fdDwAttime</code></td>
@@ -951,7 +991,7 @@
951
991
  <br class="clear">
952
992
 
953
993
  <footer>
954
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Fri Sep 12 2025 12:04:08 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
994
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Fri Sep 12 2025 14:51:15 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
955
995
  </footer>
956
996
 
957
997
  <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.4</a> on Fri Sep 12 2025 12:04:08 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.4</a> on Fri Sep 12 2025 14:51:15 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/g.funDownload.mjs CHANGED
@@ -102,6 +102,10 @@ let kpEqs = {
102
102
  3: eqs3,
103
103
  }
104
104
 
105
+ //fdTagRemove
106
+ let fdTagRemove = `./_tagRemove`
107
+ w.fsCleanFolder(fdTagRemove)
108
+
105
109
  //fdDwAttime
106
110
  let fdDwAttime = `./_dwAttime`
107
111
  w.fsCleanFolder(fdDwAttime)
@@ -114,6 +118,14 @@ w.fsCleanFolder(fdDwCurrent)
114
118
  let fdResult = `./_result`
115
119
  w.fsCleanFolder(fdResult)
116
120
 
121
+ //fdTaskCpActualSrc
122
+ let fdTaskCpActualSrc = `./_taskCpActualSrc`
123
+ w.fsCleanFolder(fdTaskCpActualSrc)
124
+
125
+ //fdTaskCpSrc
126
+ let fdTaskCpSrc = `./_taskCpSrc`
127
+ w.fsCleanFolder(fdTaskCpSrc)
128
+
117
129
  let i = 0
118
130
  let run = async() => {
119
131
  i++
@@ -134,9 +146,13 @@ let run = async() => {
134
146
  let yearStart = 2022
135
147
  let yearEnd = 2022
136
148
  let opt = {
149
+ fdTagRemove,
137
150
  fdDwAttime,
138
151
  fdDwCurrent,
139
152
  fdResult,
153
+ fdTaskCpActualSrc,
154
+ fdTaskCpSrc,
155
+ // fdLog,
140
156
  funDownload,
141
157
  // funGetCurrent,
142
158
  // funRemove,
package/g.mjs CHANGED
@@ -5,6 +5,10 @@ import w from 'wsemi'
5
5
  import WDwdataTweq from './src/WDwdataTweq.mjs'
6
6
 
7
7
 
8
+ //fdTagRemove
9
+ let fdTagRemove = `./_tagRemove`
10
+ w.fsCleanFolder(fdTagRemove)
11
+
8
12
  //fdDwAttime
9
13
  let fdDwAttime = `./_dwAttime`
10
14
  w.fsCleanFolder(fdDwAttime)
@@ -17,12 +21,24 @@ w.fsCleanFolder(fdDwCurrent)
17
21
  let fdResult = `./_result`
18
22
  w.fsCleanFolder(fdResult)
19
23
 
24
+ //fdTaskCpActualSrc
25
+ let fdTaskCpActualSrc = `./_taskCpActualSrc`
26
+ w.fsCleanFolder(fdTaskCpActualSrc)
27
+
28
+ //fdTaskCpSrc
29
+ let fdTaskCpSrc = `./_taskCpSrc`
30
+ w.fsCleanFolder(fdTaskCpSrc)
31
+
20
32
  let yearStart = 2022
21
33
  let yearEnd = 2022
22
34
  let opt = {
35
+ fdTagRemove,
23
36
  fdDwAttime,
24
37
  fdDwCurrent,
25
38
  fdResult,
39
+ fdTaskCpActualSrc,
40
+ fdTaskCpSrc,
41
+ // fdLog,
26
42
  // funDownload,
27
43
  // funGetCurrent,
28
44
  // funRemove,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "w-dwdata-tweq",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "main": "dist/w-dwdata-tweq.umd.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.12.0",
7
7
  "lodash-es": "^4.17.21",
8
8
  "sharp": "^0.34.3",
9
- "w-dwdata-builder": "^1.0.25",
9
+ "w-dwdata-builder": "^1.0.26",
10
10
  "wsemi": "^1.8.20"
11
11
  },
12
12
  "devDependencies": {
@@ -29,6 +29,7 @@ import cropPic from './cropPic.mjs'
29
29
  * @param {Integer} yearEnd 輸入數據結束年整數
30
30
  * @param {Object} [opt={}] 輸入設定物件,預設{}
31
31
  * @param {String} [opt.keyId='keyId'] 輸入各筆數據之主鍵字串,預設'keyId'
32
+ * @param {String} [opt.fdTagRemove='./_tagRemove'] 輸入暫存標記為刪除數據資料夾字串,預設'./_tagRemove'
32
33
  * @param {String} [opt.fdDwAttime='./_dwAttime'] 輸入當前下載數據資料夾字串,預設'./_dwAttime'
33
34
  * @param {String} [opt.fdDwCurrent='./_dwCurrent'] 輸入已下載數據資料夾字串,預設'./_dwCurrent'
34
35
  * @param {String} [opt.fdResult='./_result'] 輸入已下載數據所連動生成數據資料夾字串,預設'./_result'
@@ -44,11 +45,49 @@ import cropPic from './cropPic.mjs'
44
45
  * @returns {Object} 回傳事件物件,可呼叫函數on監聽change事件
45
46
  * @example
46
47
  *
48
+ * import w from 'wsemi'
47
49
  * import WDwdataTweq from './src/WDwdataTweq.mjs'
48
50
  *
51
+ * //fdTagRemove
52
+ * let fdTagRemove = `./_tagRemove`
53
+ * w.fsCleanFolder(fdTagRemove)
54
+ *
55
+ * //fdDwAttime
56
+ * let fdDwAttime = `./_dwAttime`
57
+ * w.fsCleanFolder(fdDwAttime)
58
+ *
59
+ * //fdDwCurrent
60
+ * let fdDwCurrent = `./_dwCurrent`
61
+ * w.fsCleanFolder(fdDwCurrent)
62
+ *
63
+ * //fdResult
64
+ * let fdResult = `./_result`
65
+ * w.fsCleanFolder(fdResult)
66
+ *
67
+ * //fdTaskCpActualSrc
68
+ * let fdTaskCpActualSrc = `./_taskCpActualSrc`
69
+ * w.fsCleanFolder(fdTaskCpActualSrc)
70
+ *
71
+ * //fdTaskCpSrc
72
+ * let fdTaskCpSrc = `./_taskCpSrc`
73
+ * w.fsCleanFolder(fdTaskCpSrc)
74
+ *
49
75
  * let yearStart = 2022
50
76
  * let yearEnd = 2022
51
- * let opt = {}
77
+ * let opt = {
78
+ * fdTagRemove,
79
+ * fdDwAttime,
80
+ * fdDwCurrent,
81
+ * fdResult,
82
+ * fdTaskCpActualSrc,
83
+ * fdTaskCpSrc,
84
+ * // fdLog,
85
+ * // funDownload,
86
+ * // funGetCurrent,
87
+ * // funRemove,
88
+ * // funAdd,
89
+ * // funModify,
90
+ * }
52
91
  * let ev = await WDwdataTweq(yearStart, yearEnd, opt)
53
92
  * .catch((err) => {
54
93
  * console.log(err)
@@ -93,6 +132,12 @@ let WDwdataTweq = async(yearStart, yearEnd, opt = {}) => {
93
132
  keyId = `id`
94
133
  }
95
134
 
135
+ //fdTagRemove, 暫存標記為刪除數據資料夾
136
+ let fdTagRemove = get(opt, 'fdTagRemove')
137
+ if (!isestr(fdTagRemove)) {
138
+ fdTagRemove = `./_tagRemove`
139
+ }
140
+
96
141
  //fdDwAttime
97
142
  let fdDwAttime = get(opt, 'fdDwAttime')
98
143
  if (!isestr(fdDwAttime)) {
@@ -120,6 +165,15 @@ let WDwdataTweq = async(yearStart, yearEnd, opt = {}) => {
120
165
  fsCreateFolder(fdResult)
121
166
  }
122
167
 
168
+ //fdTaskCpActualSrc, 儲存完整任務狀態資料夾
169
+ let fdTaskCpActualSrc = get(opt, 'fdTaskCpActualSrc')
170
+ if (!isestr(fdTaskCpActualSrc)) {
171
+ fdTaskCpActualSrc = `./_taskCpActualSrc`
172
+ }
173
+ if (!fsIsFolder(fdTaskCpActualSrc)) {
174
+ fsCreateFolder(fdTaskCpActualSrc)
175
+ }
176
+
123
177
  //fdTaskCpSrc
124
178
  let fdTaskCpSrc = get(opt, 'fdTaskCpSrc')
125
179
  if (!isestr(fdTaskCpSrc)) {
@@ -270,11 +324,12 @@ let WDwdataTweq = async(yearStart, yearEnd, opt = {}) => {
270
324
  funModify = funModifyDef
271
325
  }
272
326
 
273
- //WDwdataBuilder
274
327
  let optBdr = {
328
+ fdTagRemove,
275
329
  fdDwAttime,
276
330
  fdDwCurrent,
277
- fdResult,
331
+ // fdResult, //WDwdataBuilder不需要
332
+ fdTaskCpActualSrc,
278
333
  fdTaskCpSrc,
279
334
  fdLog,
280
335
  funDownload,
@@ -107,6 +107,10 @@ describe('multi', function() {
107
107
  3: eqs3,
108
108
  }
109
109
 
110
+ //fdTagRemove
111
+ let fdTagRemove = `./_multi_tagRemove`
112
+ w.fsCleanFolder(fdTagRemove)
113
+
110
114
  //fdDwAttime
111
115
  let fdDwAttime = `./_multi_dwAttime`
112
116
  w.fsCleanFolder(fdDwAttime)
@@ -119,6 +123,14 @@ describe('multi', function() {
119
123
  let fdResult = `./_multi_result`
120
124
  w.fsCleanFolder(fdResult)
121
125
 
126
+ //fdTaskCpActualSrc
127
+ let fdTaskCpActualSrc = `./_multi_taskCpActualSrc`
128
+ w.fsCleanFolder(fdTaskCpActualSrc)
129
+
130
+ //fdTaskCpSrc
131
+ let fdTaskCpSrc = `./_multi_taskCpSrc`
132
+ w.fsCleanFolder(fdTaskCpSrc)
133
+
122
134
  let i = 0
123
135
  let run = async() => {
124
136
  i++
@@ -139,9 +151,13 @@ describe('multi', function() {
139
151
  let yearStart = 2022
140
152
  let yearEnd = 2022
141
153
  let opt = {
154
+ fdTagRemove,
142
155
  fdDwAttime,
143
156
  fdDwCurrent,
144
157
  fdResult,
158
+ fdTaskCpActualSrc,
159
+ fdTaskCpSrc,
160
+ // fdLog,
145
161
  funDownload,
146
162
  // funGetCurrent,
147
163
  // funRemove,
@@ -179,11 +195,14 @@ describe('multi', function() {
179
195
  await run()
180
196
  })
181
197
 
198
+ w.fsDeleteFolder(fdTagRemove)
182
199
  w.fsDeleteFolder(fdDwAttime)
183
200
  w.fsDeleteFolder(fdDwCurrent)
184
201
  w.fsDeleteFolder(fdResult)
202
+ w.fsDeleteFolder(fdTaskCpActualSrc)
203
+ w.fsDeleteFolder(fdTaskCpSrc)
185
204
 
186
- console.log('ms', ms)
205
+ // console.log('ms', ms)
187
206
  return ms
188
207
  }
189
208
  let ms = [
@@ -13,6 +13,10 @@ describe('once', function() {
13
13
 
14
14
  let ms = []
15
15
 
16
+ //fdTagRemove
17
+ let fdTagRemove = `./_once_tagRemove`
18
+ w.fsCleanFolder(fdTagRemove)
19
+
16
20
  //fdDwAttime
17
21
  let fdDwAttime = `./_once_dwAttime`
18
22
  w.fsCleanFolder(fdDwAttime)
@@ -25,6 +29,14 @@ describe('once', function() {
25
29
  let fdResult = `./_once_result`
26
30
  w.fsCleanFolder(fdResult)
27
31
 
32
+ //fdTaskCpActualSrc
33
+ let fdTaskCpActualSrc = `./_once_taskCpActualSrc`
34
+ w.fsCleanFolder(fdTaskCpActualSrc)
35
+
36
+ //fdTaskCpSrc
37
+ let fdTaskCpSrc = `./_once_taskCpSrc`
38
+ w.fsCleanFolder(fdTaskCpSrc)
39
+
28
40
  //funDownload
29
41
  let funDownload = async() => {
30
42
 
@@ -80,9 +92,13 @@ describe('once', function() {
80
92
  let yearStart = 2022
81
93
  let yearEnd = 2022
82
94
  let opt = {
95
+ fdTagRemove,
83
96
  fdDwAttime,
84
97
  fdDwCurrent,
85
98
  fdResult,
99
+ fdTaskCpActualSrc,
100
+ fdTaskCpSrc,
101
+ // fdLog,
86
102
  funDownload,
87
103
  // funGetCurrent,
88
104
  // funRemove,
@@ -102,9 +118,14 @@ describe('once', function() {
102
118
  ms.push(msg)
103
119
  })
104
120
  ev.on('end', () => {
121
+
122
+ w.fsDeleteFolder(fdTagRemove)
105
123
  w.fsDeleteFolder(fdDwAttime)
106
124
  w.fsDeleteFolder(fdDwCurrent)
107
125
  w.fsDeleteFolder(fdResult)
126
+ w.fsDeleteFolder(fdTaskCpActualSrc)
127
+ w.fsDeleteFolder(fdTaskCpSrc)
128
+
108
129
  // console.log('ms', ms)
109
130
  pm.resolve(ms)
110
131
  })