@live-change/vue3-ssr 0.2.7 → 0.2.13
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/Api.js +8 -0
- package/index.js +6 -2
- package/package.json +7 -6
package/Api.js
CHANGED
|
@@ -124,6 +124,10 @@ class Api extends DaoProxy {
|
|
|
124
124
|
}
|
|
125
125
|
let fetch = { }
|
|
126
126
|
globalFetch[serviceDefinition.name] = fetch
|
|
127
|
+
for(const actionName in serviceDefinition.actions) {
|
|
128
|
+
fetch[actionName] = (params) => [serviceDefinition.name, actionName, params]
|
|
129
|
+
fetch[actionName].definition = serviceDefinition.actions[actionName]
|
|
130
|
+
}
|
|
127
131
|
for(const viewName in serviceDefinition.views) {
|
|
128
132
|
fetch[viewName] = (params) => new Path([serviceDefinition.name, viewName, params])
|
|
129
133
|
fetch[viewName].definition = serviceDefinition.views[viewName]
|
|
@@ -235,6 +239,10 @@ class Api extends DaoProxy {
|
|
|
235
239
|
reverse: !range.reverse
|
|
236
240
|
}
|
|
237
241
|
}
|
|
242
|
+
|
|
243
|
+
getServiceDefinition(serviceName) {
|
|
244
|
+
return this.metadata.api.value.services.find(s => s.name == serviceName)
|
|
245
|
+
}
|
|
238
246
|
}
|
|
239
247
|
|
|
240
248
|
export default Api
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCurrentInstance, onUnmounted } from 'vue'
|
|
2
|
-
import { live as d3live, RangeBuckets } from '@live-change/dao-vue3'
|
|
2
|
+
import { live as d3live, fetch as d3fetch, RangeBuckets } from '@live-change/dao-vue3'
|
|
3
3
|
|
|
4
4
|
function api(context) {
|
|
5
5
|
context = context || getCurrentInstance().appContext
|
|
@@ -22,6 +22,10 @@ function live(path) {
|
|
|
22
22
|
return d3live(api(), path)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function fetch(path) {
|
|
26
|
+
return d3fetch(api(), path)
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
async function rangeBuckets(pathFunction, options, app = getCurrentInstance()) {
|
|
26
30
|
const lc = api()
|
|
27
31
|
const extendedPathFunction = (range) => pathFunction(range, lc.fetch)
|
|
@@ -64,4 +68,4 @@ function uid(context) {
|
|
|
64
68
|
return api(context).uid
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
export { path, api, view, actions, live, client, uid, rangeBuckets, reverseRange }
|
|
71
|
+
export { path, api, view, actions, live, fetch, client, uid, rangeBuckets, reverseRange }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/vue3-ssr",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Live Change Framework - vue components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/live-change/live-change-framework-vue3",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/
|
|
25
|
-
"@
|
|
26
|
-
"
|
|
27
|
-
"
|
|
24
|
+
"@live-change/dao-vue3": "0.4.12",
|
|
25
|
+
"@live-change/uid": "0.6.5",
|
|
26
|
+
"@vueuse/core": "^8.3.1",
|
|
27
|
+
"debug": "^4.3.4",
|
|
28
|
+
"vue": "^3.2.33"
|
|
28
29
|
},
|
|
29
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "2a8fa3e359bb31fecf9ea0674e10a3cd11c460e9"
|
|
30
31
|
}
|