w-web-api 1.0.2 → 1.0.5

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.
package/docs/WWebApi.html CHANGED
@@ -71,7 +71,7 @@
71
71
 
72
72
  <dt class="tag-source">Source:</dt>
73
73
  <dd class="tag-source"><ul class="dummy"><li>
74
- <a href="WWebApi.mjs.html">WWebApi.mjs</a>, <a href="WWebApi.mjs.html#line36">line 36</a>
74
+ <a href="WWebApi.mjs.html">WWebApi.mjs</a>, <a href="WWebApi.mjs.html#line64">line 64</a>
75
75
  </li></ul></dd>
76
76
 
77
77
 
@@ -124,7 +124,7 @@
124
124
 
125
125
  <h5>Example</h5>
126
126
 
127
- <pre class="prettyprint"><code></code></pre>
127
+ <pre class="prettyprint"><code>import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
128
128
  getUserById: null,
129
129
  bCheckUser: false,
130
130
  bExcludeWhenNotAdmin: false,
131
131
  serverPort: 11005,
132
132
  webName: {
133
133
  'eng': 'API Service',
134
134
  'cht': 'API管理系統'
135
135
  },
136
136
  .catch((err) => {
137
137
  console.log(err)
138
138
  })</code></pre>
139
139
 
140
140
 
141
141
 
@@ -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 13:48:44 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 14:36:03 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
608
608
  </footer>
609
609
 
610
610
  <script>prettyPrint();</script>
@@ -74,7 +74,35 @@ import WServOrm from 'w-serv-orm/src/WServOrm.mjs'
74
74
  * @returns {Object} 回傳物件,其內server為hapi伺服器實體,wsrv為w-converhp的伺服器事件物件,wsds為w-serv-webdata的伺服器事件物件,可監聽error事件
75
75
  * @example
76
76
  *
77
-
77
+ * import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
78
+ * import getSettings from './server/getSettings.mjs'
79
+ * import WWebApi from './server/WWebApi.mjs'
80
+ *
81
+ * //st
82
+ * let st = getSettings()
83
+ *
84
+ * let url = `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}` //使用Mongodb測試
85
+ * let db = st.dbName
86
+ * let opt = {
87
+ *
88
+ * getUserById: null,
89
+ * bCheckUser: false,
90
+ * bExcludeWhenNotAdmin: false,
91
+ *
92
+ * serverPort: 11005,
93
+ *
94
+ * webName: {
95
+ * 'eng': 'API Service',
96
+ * 'cht': 'API管理系統'
97
+ * },
98
+ *
99
+ * }
100
+ *
101
+ * //WWebApi
102
+ * WWebApi(url, db, WOrm, opt)
103
+ * .catch((err) => {
104
+ * console.log(err)
105
+ * })
78
106
  *
79
107
  */
80
108
  async function WWebApi(url, db, WOrm, opt = {}) {
@@ -217,6 +245,7 @@ async function WWebApi(url, db, WOrm, opt = {}) {
217
245
  if (fsIsFolder(npmPathStaticFiles)) {
218
246
  pathStaticFiles = npmPathStaticFiles
219
247
  }
248
+ // console.log('pathStaticFiles', pathStaticFiles)
220
249
 
221
250
 
222
251
  //apis
@@ -317,6 +346,7 @@ async function WWebApi(url, db, WOrm, opt = {}) {
317
346
  },
318
347
  hookBefores: null,
319
348
  hookAfters: null,
349
+ fnTableTags: 'tableTags-web-api.json',
320
350
  })
321
351
 
322
352
 
@@ -339,7 +369,7 @@ export default WWebApi
339
369
  <br class="clear">
340
370
 
341
371
  <footer>
342
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 13:48:44 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
372
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 14:36:02 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
343
373
  </footer>
344
374
 
345
375
  <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 13:48:44 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 14:36:03 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/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "w-web-api",
3
- "version": "1.0.2",
4
- "description": "",
3
+ "version": "1.0.5",
5
4
  "main": "dist/w-web-api.umd.js",
6
5
  "dependencies": {
7
6
  "@mdi/js": "^6.6.96",
@@ -10,7 +9,7 @@
10
9
  "w-component-vue": "^2.2.6",
11
10
  "w-data-collector": "^1.0.13",
12
11
  "w-orm-mongodb": "^1.1.26",
13
- "w-serv-hapi": "^1.0.5",
12
+ "w-serv-hapi": "^1.0.6",
14
13
  "w-serv-orm": "^1.0.0",
15
14
  "wsemi": "^1.6.55"
16
15
  },
@@ -40,8 +39,9 @@
40
39
  "scripts": {
41
40
  "serve": "vue-cli-service serve",
42
41
  "build": "vue-cli-service build",
42
+ "test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
43
43
  "lint": "vue-cli-service lint",
44
- "start": "node --experimental-modules --es-module-specifier-resolution=node server/srv.mjs"
44
+ "deploy": "gh-pages -d docs"
45
45
  },
46
46
  "eslintConfig": {
47
47
  "root": true,
@@ -66,16 +66,9 @@
66
66
  "url": "https://github.com/yuda-lyu/w-web-api"
67
67
  },
68
68
  "keywords": [
69
- "lodash",
70
- "color",
71
- "crypto",
72
- "fuzzy",
73
- "xss",
74
- "xlsx",
75
- "tool",
76
- "package ",
77
- "browser",
78
- "developer"
69
+ "web",
70
+ "service",
71
+ "api"
79
72
  ],
80
73
  "author": "yuda-lyu(semisphere)",
81
74
  "license": "MIT"
@@ -30,7 +30,35 @@ import WServOrm from 'w-serv-orm/src/WServOrm.mjs'
30
30
  * @returns {Object} 回傳物件,其內server為hapi伺服器實體,wsrv為w-converhp的伺服器事件物件,wsds為w-serv-webdata的伺服器事件物件,可監聽error事件
31
31
  * @example
32
32
  *
33
-
33
+ * import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
34
+ * import getSettings from './server/getSettings.mjs'
35
+ * import WWebApi from './server/WWebApi.mjs'
36
+ *
37
+ * //st
38
+ * let st = getSettings()
39
+ *
40
+ * let url = `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}` //使用Mongodb測試
41
+ * let db = st.dbName
42
+ * let opt = {
43
+ *
44
+ * getUserById: null,
45
+ * bCheckUser: false,
46
+ * bExcludeWhenNotAdmin: false,
47
+ *
48
+ * serverPort: 11005,
49
+ *
50
+ * webName: {
51
+ * 'eng': 'API Service',
52
+ * 'cht': 'API管理系統'
53
+ * },
54
+ *
55
+ * }
56
+ *
57
+ * //WWebApi
58
+ * WWebApi(url, db, WOrm, opt)
59
+ * .catch((err) => {
60
+ * console.log(err)
61
+ * })
34
62
  *
35
63
  */
36
64
  async function WWebApi(url, db, WOrm, opt = {}) {
@@ -173,6 +201,7 @@ async function WWebApi(url, db, WOrm, opt = {}) {
173
201
  if (fsIsFolder(npmPathStaticFiles)) {
174
202
  pathStaticFiles = npmPathStaticFiles
175
203
  }
204
+ // console.log('pathStaticFiles', pathStaticFiles)
176
205
 
177
206
 
178
207
  //apis
@@ -273,6 +302,7 @@ async function WWebApi(url, db, WOrm, opt = {}) {
273
302
  },
274
303
  hookBefores: null,
275
304
  hookAfters: null,
305
+ fnTableTags: 'tableTags-web-api.json',
276
306
  })
277
307
 
278
308
 
package/srv.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs'
1
+ import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
2
2
  import getSettings from './server/getSettings.mjs'
3
3
  import WWebApi from './server/WWebApi.mjs'
4
4
 
@@ -6,7 +6,7 @@ import WWebApi from './server/WWebApi.mjs'
6
6
  //st
7
7
  let st = getSettings()
8
8
 
9
- let url = `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}`
9
+ let url = `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}` //使用Mongodb測試
10
10
  let db = st.dbName
11
11
  let opt = {
12
12
 
@@ -0,0 +1 @@
1
+ {"apis":"c36gPY"}
@@ -1,12 +1,14 @@
1
- import rollupFiles from 'w-package-tools/src/rollupFiles.mjs'
1
+ // import rollupFiles from 'w-package-tools/src/rollupFiles.mjs'
2
+ import rollupFile from 'w-package-tools/src/rollupFile.mjs' //因只有1檔案且不需刪除dsit故改用rollupFile
2
3
 
3
4
 
4
5
  let fdSrc = './server' //'./src'
5
6
  let fdTar = './dist'
6
7
 
7
8
 
8
- rollupFiles({
9
- fns: ['WWebApi.mjs'],
9
+ rollupFile({
10
+ // fns: ['WWebApi.mjs'],
11
+ fn: 'WWebApi.mjs',
10
12
  fdSrc,
11
13
  fdTar,
12
14
  nameDistType: 'kebabCase',
package/tableTags.json DELETED
@@ -1 +0,0 @@
1
- {"apis":"gertCD"}