w-web-api 1.0.7 → 1.0.8

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-web-api v1.0.7
2
+ * w-web-api v1.0.8
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
package/docs/WWebApi.html CHANGED
@@ -604,7 +604,7 @@
604
604
  <br class="clear">
605
605
 
606
606
  <footer>
607
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 16:47:26 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
607
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 22:46:53 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
608
608
  </footer>
609
609
 
610
610
  <script>prettyPrint();</script>
@@ -367,7 +367,7 @@ export default WWebApi
367
367
  <br class="clear">
368
368
 
369
369
  <footer>
370
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 16:47:26 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
370
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 22:46:53 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
371
371
  </footer>
372
372
 
373
373
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -68,7 +68,7 @@
68
68
  <br class="clear">
69
69
 
70
70
  <footer>
71
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 16:47:26 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
71
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 22:46:53 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
72
72
  </footer>
73
73
 
74
74
  <script>prettyPrint();</script>
package/g.mDb.mjs CHANGED
@@ -1,75 +1,9 @@
1
- // import path from 'path'
2
- import fs from 'fs'
3
- // import _ from 'lodash'
4
- import w from 'wsemi'
5
- import br from 'w-serv-orm/src/getDbBackupAndRecover.mjs'
6
1
  import { woItems } from './g.mOrm.mjs'
7
- // import { genModels } from './g.mOrmGenModels.mjs'
2
+ import getDb from 'w-serv-orm/src/getDb.mjs'
8
3
 
9
4
 
10
- //mOrmGenModels.mjs
11
- let genModels = `
12
- import path from 'path'
13
- import _ from 'lodash'
14
- // import w from 'wsemi'
15
- import genModelsByTabs from 'w-orm-reladb/src/genModelsByTabs.mjs'
16
- import ds from '../src/schema/index.mjs'
17
-
18
-
19
- let fdSrv = path.resolve()
20
-
21
-
22
- function genModels() {
23
-
24
- //names
25
- let names = _.keys(ds)
26
-
27
- //tabs
28
- let tabs = {}
29
- _.each(names, (name) => {
30
- tabs[name] = ds[name].settings
31
- })
32
- console.log('tabs', tabs)
33
-
34
- //fd
35
- let fd = fdSrv + '/models'
36
-
37
- //genModelsByTabs
38
- genModelsByTabs(fd, tabs)
39
-
40
- }
41
-
42
-
43
- export { genModels }
44
- `
45
-
46
- function backup() {
47
- br.backup(woItems)
48
- .then((res) => {
49
- let j = w.o2j(res)
50
- fs.writeFileSync(`./backup-${w.now2strp()}.json`, j, 'utf8')
51
- console.log('backup finish')
52
- })
53
- .catch((err) => {
54
- console.log(err)
55
- })
56
- }
57
- backup()
58
-
59
-
60
- function recover() {
61
- let fp = '../_db/backup-20220222134749.json'
62
- let genModels = null
63
- let needCreateStorage = false
64
- br.recover(fp, woItems, genModels, needCreateStorage)
65
- .then(() => {
66
- console.log('recover finish')
67
- })
68
- .catch((err) => {
69
- console.log(err)
70
- })
71
- }
72
- // recover()
5
+ getDb.backup(woItems)
6
+ // getDb.recover(woItems, './ooo.json')
73
7
 
74
8
 
75
9
  //備份資料重與由備份資料重建資料庫
@@ -1,32 +1,12 @@
1
- // import path from 'path'
2
- // import fs from 'fs'
3
- // import _ from 'lodash'
4
- import w from 'wsemi'
5
1
  import ds from './src/schema/index.mjs'
6
2
  import { woItems } from './g.mOrm.mjs'
3
+ import genTestData from 'w-serv-orm/src/genTestData.mjs'
7
4
 
8
5
 
9
6
  async function initialTestData() {
10
7
 
11
- //delFiles
12
- // delFiles('./histData')
13
- // delFiles('./uploadFiles')
14
-
15
- //funTest
16
- await w.pmSeries(ds, async (v, k) => {
17
-
18
- //funTestAndSave
19
- let rs = await v.funTestAndSave(woItems)
20
- console.log(`${k}.funTestAndSave`, rs)
21
-
22
- // //funTest
23
- // let rs = await v.funTest(woItems)
24
-
25
- // //save
26
- // await woItems[k].save(rs)
27
- // console.log(`${k}.funTest and save`, rs)
28
-
29
- })
8
+ //genTestData
9
+ await genTestData(ds, woItems)
30
10
 
31
11
  }
32
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-web-api",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "dist/w-web-api.umd.js",
5
5
  "dependencies": {
6
6
  "@mdi/js": "^6.6.96",
@@ -10,7 +10,7 @@
10
10
  "w-component-vue": "^2.2.6",
11
11
  "w-data-collector": "^1.0.13",
12
12
  "w-serv-hapi": "^1.0.6",
13
- "w-serv-orm": "^1.0.1",
13
+ "w-serv-orm": "^1.0.2",
14
14
  "wsemi": "^1.6.55"
15
15
  },
16
16
  "devDependencies": {