w-web-api 1.0.3 → 1.0.6
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/README.md +16 -22
- package/dist/connecting.svg +10 -0
- package/dist/css/app.ff30ea93.css +1 -0
- package/dist/css/chunk-vendors.f0a39794.css +5 -0
- package/dist/deny.png +0 -0
- package/dist/disconnect.png +0 -0
- package/dist/index.html +1 -0
- package/dist/js/app.584c7442.js +2 -0
- package/dist/js/app.584c7442.js.map +1 -0
- package/dist/js/chunk-vendors.35dfbb6b.js +28 -0
- package/dist/js/chunk-vendors.35dfbb6b.js.map +1 -0
- package/dist/logout.png +0 -0
- package/dist/w-web-api.umd.js +2 -2
- package/dist/w-web-api.umd.js.map +1 -1
- package/docs/WWebApi.html +3 -3
- package/docs/WWebApi.mjs.html +32 -2
- package/docs/index.html +1 -1
- package/package.json +6 -13
- package/server/WWebApi.mjs +31 -1
- package/srv.mjs +2 -2
- package/tableTags-web-api.json +1 -0
- package/toolg/gDistRollup.mjs +5 -3
- package/tableTags.json +0 -1
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#
|
|
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
|
|
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
|
|
607
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 14:44:05 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
608
608
|
</footer>
|
|
609
609
|
|
|
610
610
|
<script>prettyPrint();</script>
|
package/docs/WWebApi.mjs.html
CHANGED
|
@@ -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
|
|
372
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 14:44:05 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
|
|
71
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Thu Apr 14 2022 14:44:05 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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "w-web-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"main": "dist/w-web-api.umd.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@mdi/js": "^6.6.96",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"showdown": "^2.0.3",
|
|
9
9
|
"w-component-vue": "^2.2.6",
|
|
10
10
|
"w-data-collector": "^1.0.13",
|
|
11
|
-
"w-
|
|
12
|
-
"w-serv-hapi": "^1.0.5",
|
|
11
|
+
"w-serv-hapi": "^1.0.6",
|
|
13
12
|
"w-serv-orm": "^1.0.0",
|
|
14
13
|
"wsemi": "^1.6.55"
|
|
15
14
|
},
|
|
@@ -34,6 +33,7 @@
|
|
|
34
33
|
"vue-cli-plugin-vuetify": "^2.4.8",
|
|
35
34
|
"vuetify": "^2.6.4",
|
|
36
35
|
"vuetify-loader": "^1.7.3",
|
|
36
|
+
"w-orm-mongodb": "^1.1.26",
|
|
37
37
|
"w-package-tools": "^1.0.65"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
@@ -66,16 +66,9 @@
|
|
|
66
66
|
"url": "https://github.com/yuda-lyu/w-web-api"
|
|
67
67
|
},
|
|
68
68
|
"keywords": [
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
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"
|
package/server/WWebApi.mjs
CHANGED
|
@@ -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"}
|
package/toolg/gDistRollup.mjs
CHANGED
|
@@ -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
|
-
|
|
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"}
|