w-web-api 1.0.28 → 1.0.30

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 (40) hide show
  1. package/README.md +23 -16
  2. package/dist/css/app.d38a4241.css +1 -0
  3. package/dist/index.tmp +3 -1
  4. package/dist/js/app-legacy.9b4e9f9b.js +2 -0
  5. package/dist/js/app-legacy.9b4e9f9b.js.map +1 -0
  6. package/dist/js/app.9b4e9f9b.js +2 -0
  7. package/dist/js/app.9b4e9f9b.js.map +1 -0
  8. package/dist/js/chunk-vendors-legacy.2a4fa50d.js +14 -0
  9. package/dist/js/chunk-vendors-legacy.2a4fa50d.js.map +1 -0
  10. package/dist/js/chunk-vendors.2a4fa50d.js +14 -0
  11. package/dist/js/chunk-vendors.2a4fa50d.js.map +1 -0
  12. package/dist/w-web-api.umd.js +2 -2
  13. package/dist/w-web-api.umd.js.map +1 -1
  14. package/docs/WWebApi.html +44 -4
  15. package/docs/WWebApi.mjs.html +195 -66
  16. package/docs/index.html +1 -1
  17. package/{g.mDb.mjs → g.backupDb.mjs} +1 -1
  18. package/{g.mInitialTestData.mjs → g.initialTestData.mjs} +1 -1
  19. package/package.json +5 -10
  20. package/public/index.html +8 -1
  21. package/server/WWebApi.mjs +194 -65
  22. package/server/provideApis.mjs +2 -2
  23. package/src/App.vue +17 -10
  24. package/src/components/LayoutContent.vue +15 -35
  25. package/src/main.js +0 -2
  26. package/src/store/mutations.mjs +6 -13
  27. package/srv.mjs +23 -12
  28. package/tableTags-web-api.json +1 -1
  29. package/vue.config.js +1 -1
  30. package/dist/css/app.8f83f1ad.css +0 -1
  31. package/dist/css/chunk-vendors.004a7134.css +0 -5
  32. package/dist/js/app-legacy.fe5cd851.js +0 -2
  33. package/dist/js/app-legacy.fe5cd851.js.map +0 -1
  34. package/dist/js/app.fe5cd851.js +0 -2
  35. package/dist/js/app.fe5cd851.js.map +0 -1
  36. package/dist/js/chunk-vendors-legacy.1bbf0550.js +0 -14
  37. package/dist/js/chunk-vendors-legacy.1bbf0550.js.map +0 -1
  38. package/dist/js/chunk-vendors.1bbf0550.js +0 -14
  39. package/dist/js/chunk-vendors.1bbf0550.js.map +0 -1
  40. package/src/plugins/mVuetify.mjs +0 -12
package/docs/WWebApi.html CHANGED
@@ -74,13 +74,13 @@
74
74
  <dl class="details">
75
75
 
76
76
  <dt class="tag-description">Description:</dt>
77
- <dd class="tag-description"><ul class="dummy"><li><p>基於hapi之API伺服器</p></li></ul></dd>
77
+ <dd class="tag-description"><ul class="dummy"><li><p>API伺服器</p></li></ul></dd>
78
78
 
79
79
 
80
80
 
81
81
  <dt class="tag-source">Source:</dt>
82
82
  <dd class="tag-source"><ul class="dummy"><li>
83
- <a href="WWebApi.mjs.html">WWebApi.mjs</a>, <a href="WWebApi.mjs.html#line82">line 82</a>
83
+ <a href="WWebApi.mjs.html">WWebApi.mjs</a>, <a href="WWebApi.mjs.html#line115">line 115</a>
84
84
  </li></ul></dd>
85
85
 
86
86
 
@@ -127,7 +127,7 @@
127
127
 
128
128
  <h5 class="h5-examples">Example</h5>
129
129
 
130
- <pre class="prettyprint"><code>import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
131
130
  getUserById: null,
132
131
  bCheckUser: false,
133
132
  bExcludeWhenNotAdmin: false,
134
133
  serverPort: 11005,
135
134
  subfolder: '', //mpai
136
135
  webName: {
137
136
  'eng': 'API Service',
138
137
  'cht': 'API管理系統'
139
138
  },
140
139
  console.log(err)
140
+ <pre class="prettyprint"><code>import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
141
141
  bCheckUser: false,
142
142
  getUserById: null,
143
143
  bExcludeWhenNotAdmin: false,
144
144
  serverPort: 11005,
145
145
  subfolder: '', //mapi
146
146
  webName: {
147
147
  'eng': 'API Service',
148
148
  'cht': 'API管理系統',
149
149
  },
150
150
  webDescription: {
151
151
  'eng': 'A web service package as methods to send requests to and receive responses from an API.',
152
152
  'cht': 'A web service package as methods to send requests to and receive responses from an API.',
153
153
  },
154
154
  webLogo: 'data:image/svg+xml;base64,...',
155
155
  // return {} //測試無法登入
156
156
  if (token === '{token-for-application}') { //提供外部應用系統作為存取使用者
157
157
  return {
158
158
  id: 'id-for-application',
159
159
  name: 'application',
160
160
  email: 'admin@example.com',
161
161
  isAdmin: 'y',
162
162
  }
163
163
  }
164
164
  if (token === 'sys') { //開發階段w-ui-loginout自動給予browser使用者(且位於localhost)的token為sys
165
165
  return {
166
166
  id: 'id-for-admin',
167
167
  name: '測試者',
168
168
  email: 'admin@example.com',
169
169
  isAdmin: 'y',
170
170
  }
171
171
  }
172
172
  console.log('invalid token', token)
173
173
  console.log('於生產環境時得加入SSO等驗證token機制')
174
174
  return {}
175
175
  console.log('於生產環境時得加入驗證user機制')
176
176
  return user.isAdmin === 'y' //測試僅系統管理者使用
177
177
  console.log(err)
178
178
 
179
179
 
180
180
 
@@ -721,6 +721,46 @@
721
721
  </tr>
722
722
 
723
723
 
724
+
725
+ <tr>
726
+
727
+ <td class="name"><code>urlRedirect</code></td>
728
+
729
+
730
+ <td class="type">
731
+
732
+
733
+ <span class="param-type">String</span>
734
+
735
+
736
+
737
+
738
+ </td>
739
+
740
+
741
+ <td class="attributes">
742
+
743
+ &lt;optional><br>
744
+
745
+
746
+
747
+
748
+
749
+ </td>
750
+
751
+
752
+
753
+ <td class="default">
754
+
755
+ <code>''</code>
756
+
757
+ </td>
758
+
759
+
760
+ <td class="description last"><p>輸入錯誤時自動轉址字串,提供站台例如無法登入或驗證失敗時須自動轉址,預設''</p></td>
761
+ </tr>
762
+
763
+
724
764
  </tbody>
725
765
  </table>
726
766
 
@@ -809,7 +849,7 @@
809
849
  <br class="clear">
810
850
 
811
851
  <footer>
812
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Jun 19 2023 08:31:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
852
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Nov 02 2023 22:58:48 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
813
853
  </footer>
814
854
 
815
855
  <script>prettyPrint();</script>
@@ -48,13 +48,12 @@
48
48
  <pre class="prettyprint source linenums"><code>import path from 'path'
49
49
  import fs from 'fs'
50
50
  import get from 'lodash/get'
51
- // import map from 'lodash/map'
52
51
  import each from 'lodash/each'
53
52
  import keys from 'lodash/keys'
54
- // import cloneDeep from 'lodash/cloneDeep'
55
53
  import j2o from 'wsemi/src/j2o.mjs'
56
54
  import iseobj from 'wsemi/src/iseobj.mjs'
57
55
  import isestr from 'wsemi/src/isestr.mjs'
56
+ import isearr from 'wsemi/src/isearr.mjs'
58
57
  import ispint from 'wsemi/src/ispint.mjs'
59
58
  import isfun from 'wsemi/src/isfun.mjs'
60
59
  import ispm from 'wsemi/src/ispm.mjs'
@@ -66,6 +65,7 @@ import strdelright from 'wsemi/src/strdelright.mjs'
66
65
  import pm2resolve from 'wsemi/src/pm2resolve.mjs'
67
66
  import b642str from 'wsemi/src/b642str.mjs'
68
67
  import fsIsFolder from 'wsemi/src/fsIsFolder.mjs'
68
+ import fsIsFile from 'wsemi/src/fsIsFile.mjs'
69
69
  import replace from 'wsemi/src/replace.mjs'
70
70
  import WServHapiServer from 'w-serv-hapi/src/WServHapiServer.mjs'
71
71
  import WServOrm from 'w-serv-orm/src/WServOrm.mjs'
@@ -73,7 +73,7 @@ import ds from '../src/schema/index.mjs'
73
73
 
74
74
 
75
75
  /**
76
- * 基於hapi之API伺服器
76
+ * API伺服器
77
77
  *
78
78
  * @class
79
79
  * @param {Function} WOrm 輸入資料庫ORM函數
@@ -90,12 +90,12 @@ import ds from '../src/schema/index.mjs'
90
90
  * @param {Object} [opt.webDescription={}] 輸入站台描述物件,至少包含語系eng與cht鍵的名稱,預設{}
91
91
  * @param {String} [opt.webLogo=''] 輸入站台logo字串,採base64格式,預設''
92
92
  * @param {String} [opt.subfolder=''] 輸入站台所在子目錄字串,提供站台位於內網採反向代理進行服務時,故需支援位於子目錄情形,預設''
93
+ * @param {String} [opt.urlRedirect=''] 輸入錯誤時自動轉址字串,提供站台例如無法登入或驗證失敗時須自動轉址,預設''
93
94
  * @returns {Object} 回傳物件,其內server為hapi伺服器實體,wsrv為w-converhp的伺服器事件物件,wsds為w-serv-webdata的伺服器事件物件,可監聽error事件
94
95
  * @example
95
- *
96
96
  * import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs' //自行選擇引用ORM, 使用Mongodb測試
97
- * import getSettings from './server/getSettings.mjs'
98
97
  * import WWebApi from './server/WWebApi.mjs'
98
+ * import getSettings from './g.getSettings.mjs'
99
99
  *
100
100
  * //st
101
101
  * let st = getSettings()
@@ -104,22 +104,55 @@ import ds from '../src/schema/index.mjs'
104
104
  * let db = st.dbName
105
105
  * let opt = {
106
106
  *
107
- * getUserById: null,
108
107
  * bCheckUser: false,
108
+ * getUserById: null,
109
109
  * bExcludeWhenNotAdmin: false,
110
110
  *
111
111
  * serverPort: 11005,
112
- * subfolder: '', //mpai
112
+ * subfolder: '', //mapi
113
113
  *
114
114
  * webName: {
115
115
  * 'eng': 'API Service',
116
- * 'cht': 'API管理系統'
116
+ * 'cht': 'API管理系統',
117
117
  * },
118
+ * webDescription: {
119
+ * 'eng': 'A web service package as methods to send requests to and receive responses from an API.',
120
+ * 'cht': 'A web service package as methods to send requests to and receive responses from an API.',
121
+ * },
122
+ * webLogo: 'data:image/svg+xml;base64,...',
123
+ *
124
+ * }
118
125
  *
126
+ * let getUserByToken = (token) => {
127
+ * // return {} //測試無法登入
128
+ * if (token === '{token-for-application}') { //提供外部應用系統作為存取使用者
129
+ * return {
130
+ * id: 'id-for-application',
131
+ * name: 'application',
132
+ * email: 'admin@example.com',
133
+ * isAdmin: 'y',
134
+ * }
135
+ * }
136
+ * if (token === 'sys') { //開發階段w-ui-loginout自動給予browser使用者(且位於localhost)的token為sys
137
+ * return {
138
+ * id: 'id-for-admin',
139
+ * name: '測試者',
140
+ * email: 'admin@example.com',
141
+ * isAdmin: 'y',
142
+ * }
143
+ * }
144
+ * console.log('invalid token', token)
145
+ * console.log('於生產環境時得加入SSO等驗證token機制')
146
+ * return {}
147
+ * }
148
+ *
149
+ * let verifyUser = (user) => {
150
+ * console.log('於生產環境時得加入驗證user機制')
151
+ * return user.isAdmin === 'y' //測試僅系統管理者使用
119
152
  * }
120
153
  *
121
154
  * //WWebApi
122
- * let instWWebApi = WWebApi(WOrm, url, db, opt)
155
+ * let instWWebApi = WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt)
123
156
  *
124
157
  * instWWebApi.on('error', (err) => {
125
158
  * console.log(err)
@@ -209,6 +242,10 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
209
242
  }
210
243
 
211
244
 
245
+ //urlRedirect
246
+ let urlRedirect = get(opt, 'urlRedirect', '')
247
+
248
+
212
249
  //WServOrm
213
250
  let optWServOrm = {
214
251
  bCheckUser,
@@ -235,32 +272,39 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
235
272
  }
236
273
 
237
274
 
238
- //verifyUserByToken
239
- let verifyUserByToken = async (token) => {
275
+ //getTokenUserForSelf
276
+ let getTokenUserForSelf = async (token) => {
240
277
 
241
278
  //getUserByToken
242
- let user = getUserByToken(token)
243
- if (ispm(user)) {
244
- user = await user
279
+ let userSelf = getUserByToken(token)
280
+ if (ispm(userSelf)) {
281
+ userSelf = await userSelf
245
282
  }
246
- if (!iseobj(user)) {
247
- return Promise.reject(`token does not have permission`)
283
+
284
+ //check
285
+ if (!iseobj(userSelf)) {
286
+ console.log(`token`, token)
287
+ console.log(`can not find the user from token`)
288
+ return Promise.reject(`can not find the user from token`)
248
289
  }
249
290
 
250
291
  //verifyUser
251
- let b = verifyUser(user)
292
+ let b = verifyUser(userSelf)
252
293
  if (ispm(b)) {
253
294
  b = await b
254
295
  }
255
296
 
256
297
  //check
257
298
  if (!b) {
299
+ console.log('userSelf', userSelf)
300
+ console.log(`user does not have permission`)
258
301
  return Promise.reject(`user does not have permission`)
259
302
  }
260
303
 
261
- return user
304
+ return userSelf
262
305
  }
263
306
 
307
+
264
308
  //getAPIsList
265
309
  let getAPIsList = async (query = {}) => {
266
310
  let rs = await woItems.apis.select(query)
@@ -269,7 +313,9 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
269
313
 
270
314
 
271
315
  //parsePayload
272
- let parsePayload = (req) => {
316
+ let parsePayload = async (req) => {
317
+
318
+ //inp
273
319
  let inp = get(req, 'payload')
274
320
 
275
321
  //to obj
@@ -277,37 +323,60 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
277
323
  inp = j2o(inp)
278
324
  }
279
325
 
280
- //cv apis for base64
281
- if (iseobj(inp)) {
282
-
283
- //spread
284
- let { group, apis } = inp
285
-
286
- //apis
287
- each(apis, (api, kapi) => {
288
- // console.log(kapi, api.name)
289
- each(api, (v, k) => {
290
- // console.log(k, v)
291
- if (isestr(v)) {
292
- if (strleft(v, 7) === 'base64:') {
293
- // console.log(k, 'get base64')
294
- v = strdelleft(v, 7)
295
- v = b642str(v)
296
- // console.log(v)
297
- apis[kapi][k] = v
298
- }
299
- }
300
- })
301
- })
326
+ //check
327
+ if (!iseobj(inp)) {
328
+ console.log('inp', inp)
329
+ console.log(`invalid inp from req`)
330
+ return Promise.reject(`invalid inp from req`)
331
+ }
302
332
 
303
- //resave
304
- inp = { group, apis }
333
+ //group
334
+ let group = get(inp, 'group', '')
305
335
 
336
+ //check
337
+ if (!isestr(group)) {
338
+ console.log('inp', inp)
339
+ console.log('group', group)
340
+ console.log(`invalid group from inp`)
341
+ return Promise.reject(`invalid group from inp`)
306
342
  }
307
- else {
308
- inp = null
343
+
344
+ //apis
345
+ let apis = get(inp, 'apis', [])
346
+
347
+ //check
348
+ if (!isearr(apis)) {
349
+ console.log('inp', inp)
350
+ console.log('apis', apis)
351
+ console.log(`invalid apis from inp`)
352
+ return Promise.reject(`invalid apis from inp`)
309
353
  }
310
354
 
355
+ //偵測b64自動恢復
356
+ each(apis, (api, kapi) => {
357
+ // console.log(kapi, api.name)
358
+ each(api, (v, k) => {
359
+ // console.log(k, v)
360
+ if (isestr(v)) {
361
+ if (strleft(v, 7) === 'base64:') {
362
+ // console.log(k, 'get base64')
363
+ v = strdelleft(v, 7)
364
+ v = b642str(v)
365
+ // console.log(v)
366
+ apis[kapi][k] = v
367
+ }
368
+ }
369
+ })
370
+ })
371
+
372
+ //save group
373
+ each(apis, (api, kapi) => {
374
+ apis[kapi].group = group
375
+ })
376
+
377
+ //resave
378
+ inp = { group, apis }
379
+
311
380
  return inp
312
381
  }
313
382
 
@@ -327,19 +396,38 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
327
396
  }
328
397
 
329
398
 
330
- //replaceAPIsByLevels
331
- let replaceAPIsByLevels = async (params = {}) => {
399
+ //syncAndReplaceApis
400
+ let syncAndReplaceApis = async (params) => {
332
401
 
333
- //spread params
334
- let { group, apis: rsApis } = params
402
+ //group
403
+ let group = get(params, 'group', '')
335
404
  // console.log('group', group)
336
- // console.log('rsApis', rsApis)
405
+
406
+ //check
407
+ if (!isestr(group)) {
408
+ console.log('params', params)
409
+ console.log('group', group)
410
+ console.log(`invalid group`)
411
+ return Promise.reject(`invalid group`)
412
+ }
413
+
414
+ //apis
415
+ let apis = get(params, 'apis', [])
416
+ // console.log('apis', apis)
417
+
418
+ //check
419
+ if (!isearr(apis)) {
420
+ console.log('params', params)
421
+ console.log('apis', apis)
422
+ console.log(`invalid apis`)
423
+ return Promise.reject(`invalid apis`)
424
+ }
337
425
 
338
426
  //delAll group
339
427
  await woItems.apis.delAll({ group })
340
428
 
341
429
  //insert
342
- let r = await woItems.apis.insert(rsApis)
430
+ let r = await woItems.apis.insert(apis)
343
431
 
344
432
  return r
345
433
  }
@@ -359,9 +447,18 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
359
447
  let fnEntryOut = 'index.html'
360
448
  try {
361
449
  let fpEntryIn = path.resolve(pathStaticFiles, fnEntryIn)
450
+ if (!fsIsFile(fpEntryIn)) {
451
+ fpEntryIn = path.resolve(pathStaticFiles, fnEntryOut) //本機開發另使用html替代tmp
452
+ }
453
+ if (!fsIsFile(fpEntryIn)) {
454
+ console.log('fpEntryIn', fpEntryIn)
455
+ throw new Error(`invalid fpEntryIn`)
456
+ }
362
457
  let fpEntryOut = path.resolve(pathStaticFiles, fnEntryOut)
363
458
  let c = fs.readFileSync(fpEntryIn, 'utf8')
459
+ c = replace(c, '/mapi/', '{sfd}/') //方法同genEntry
364
460
  c = replace(c, '{sfd}', subfolder)
461
+ c = replace(c, '{urlRedirect}', urlRedirect)
365
462
  fs.writeFileSync(fpEntryOut, c, 'utf8')
366
463
  }
367
464
  catch (err) {
@@ -401,8 +498,16 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
401
498
  //token
402
499
  let token = get(req, 'query.token', '')
403
500
 
404
- //verifyUserByToken
405
- let user = await verifyUserByToken(token)
501
+ //getTokenUserForSelf
502
+ let user = await getTokenUserForSelf(token)
503
+
504
+ //check
505
+ if (!iseobj(user)) {
506
+ console.log('token', token)
507
+ console.log('[API]getUserByToken/check user: invalid user')
508
+ console.log(`token does not have permission`)
509
+ return Promise.reject(`token does not have permission`)
510
+ }
406
511
 
407
512
  return user
408
513
  }
@@ -425,8 +530,16 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
425
530
  //token
426
531
  let token = get(req, 'query.token', '')
427
532
 
428
- //verifyUserByToken
429
- await verifyUserByToken(token)
533
+ //getTokenUserForSelf
534
+ let user = await getTokenUserForSelf(token)
535
+
536
+ //check
537
+ if (!iseobj(user)) {
538
+ console.log('token', token)
539
+ console.log('[API]getAPIsList/check user: invalid user')
540
+ console.log(`token does not have permission`)
541
+ return Promise.reject(`token does not have permission`)
542
+ }
430
543
 
431
544
  //getAPIsList
432
545
  let r = await getAPIsList({ isActive: 'y' })
@@ -453,11 +566,19 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
453
566
  //token
454
567
  let token = get(req, 'query.token', '')
455
568
 
456
- //verifyUserByToken
457
- await verifyUserByToken(token)
569
+ //getTokenUserForSelf
570
+ let user = await getTokenUserForSelf(token)
571
+
572
+ //check
573
+ if (!iseobj(user)) {
574
+ console.log('token', token)
575
+ console.log('[API]updateAPIs/check user: invalid user')
576
+ console.log(`token does not have permission`)
577
+ return Promise.reject(`token does not have permission`)
578
+ }
458
579
 
459
580
  //parsePayload
460
- let inp = parsePayload(req)
581
+ let inp = await parsePayload(req)
461
582
 
462
583
  //updateAPIs
463
584
  let r = await updateAPIs(inp)
@@ -474,9 +595,9 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
474
595
  },
475
596
  {
476
597
  method: 'POST',
477
- path: '/replaceAPIsByLevels',
598
+ path: '/syncAndReplaceApis',
478
599
  handler: async function (req, res) {
479
- // console.log('replaceAPIsByLevels', req)
600
+ // console.log('syncAndReplaceApis', req)
480
601
  // console.log('payload', req.payload)
481
602
 
482
603
  async function core() {
@@ -484,14 +605,22 @@ function WWebApi(WOrm, url, db, getUserByToken, verifyUser, opt = {}) {
484
605
  //token
485
606
  let token = get(req, 'query.token', '')
486
607
 
487
- //verifyUserByToken
488
- await verifyUserByToken(token)
608
+ //getTokenUserForSelf
609
+ let user = await getTokenUserForSelf(token)
610
+
611
+ //check
612
+ if (!iseobj(user)) {
613
+ console.log('token', token)
614
+ console.log('[API]syncAndReplaceApis/check user: invalid user')
615
+ console.log(`token does not have permission`)
616
+ return Promise.reject(`token does not have permission`)
617
+ }
489
618
 
490
619
  //parsePayload
491
- let inp = parsePayload(req)
620
+ let inp = await parsePayload(req)
492
621
 
493
- //replaceAPIsByLevels
494
- let r = await replaceAPIsByLevels(inp)
622
+ //syncAndReplaceApis
623
+ let r = await syncAndReplaceApis(inp)
495
624
 
496
625
  return r
497
626
  }
@@ -560,7 +689,7 @@ export default WWebApi
560
689
  <br class="clear">
561
690
 
562
691
  <footer>
563
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Jun 19 2023 08:31:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
692
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Nov 02 2023 22:58:48 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
564
693
  </footer>
565
694
 
566
695
  <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.2</a> on Mon Jun 19 2023 08:31:52 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.2</a> on Thu Nov 02 2023 22:58:48 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
@@ -7,4 +7,4 @@ getDb.backup(woItems)
7
7
 
8
8
 
9
9
  //備份資料重與由備份資料重建資料庫
10
- //node --experimental-modules --es-module-specifier-resolution=node g.mDb.mjs
10
+ //node --experimental-modules --es-module-specifier-resolution=node g.backupDb.mjs
@@ -17,4 +17,4 @@ initialTestData()
17
17
 
18
18
 
19
19
  //刪除舊檔與重建測試資料庫
20
- //node --experimental-modules --es-module-specifier-resolution=node g.mInitialTestData.mjs
20
+ //node --experimental-modules --es-module-specifier-resolution=node g.initialTestData.mjs
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "w-web-api",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "main": "dist/w-web-api.umd.js",
5
5
  "dependencies": {
6
6
  "@mdi/js": "^7.2.96",
7
7
  "axios": "^1.3.4",
8
8
  "lodash": "^4.17.21",
9
9
  "showdown": "^2.1.0",
10
- "w-component-vue": "^2.3.0",
10
+ "w-component-vue": "^2.3.47",
11
11
  "w-data-collector": "^1.0.19",
12
12
  "w-serv-hapi": "^1.0.11",
13
13
  "w-serv-orm": "^1.0.7",
14
- "w-ui-loginout": "^1.0.3",
15
- "wsemi": "^1.7.12"
14
+ "w-ui-loginout": "^1.0.4",
15
+ "wsemi": "^1.7.38"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@vue/cli-plugin-babel": "^5.0.8",
@@ -26,15 +26,10 @@
26
26
  "eslint-plugin-promise": "^6.1.1",
27
27
  "eslint-plugin-standard": "^4.1.0",
28
28
  "eslint-plugin-vue": "^9.10.0",
29
- "sass": "^1.60.0",
30
- "sass-loader": "^13.2.2",
31
29
  "vue": "^2.6.14",
32
- "vue-cli-plugin-vuetify": "^2.5.8",
33
- "vuetify": "^2.6.14",
34
- "vuetify-loader": "^1.9.2",
35
30
  "vuex": "^3.6.2",
36
31
  "w-orm-mongodb": "^1.1.29",
37
- "w-package-tools": "^1.0.69"
32
+ "w-package-tools": "^1.0.70"
38
33
  },
39
34
  "scripts": {
40
35
  "serve": "vue-cli-service serve",
package/public/index.html CHANGED
@@ -10,7 +10,14 @@
10
10
  <link href="https://cdn.jsdelivr.net/npm/@mdi/font/css/materialdesignicons.min.css" rel="stylesheet">
11
11
 
12
12
  <!-- fontawesome -->
13
- <link href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" rel="stylesheet">
13
+ <link href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css" rel="stylesheet">
14
+
15
+ <!-- ___pmwapi___ -->
16
+ <script>
17
+ window.___pmwapi___={
18
+ urlRedirect: '{urlRedirect}',
19
+ }
20
+ </script>
14
21
 
15
22
  </head>
16
23
  <body style="font-family:'Microsoft JhengHei','Avenir','Helvetica', 'Arial', 'sans-serif'; padding:0px; margin:0px;">