@live-change/framework 0.8.75 → 0.8.76
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/lib/App.js
CHANGED
|
@@ -582,22 +582,22 @@ class App {
|
|
|
582
582
|
const service = this.startedServices[serviceName]
|
|
583
583
|
const view = service.views[viewName]
|
|
584
584
|
if(!view) throw new Error(`View ${viewName} not found in service ${serviceName}`)
|
|
585
|
-
const result = view.observable(params)
|
|
586
|
-
return result.then ? new
|
|
585
|
+
const result = view.observable(params, { internal: true, roles: ['admin'] })
|
|
586
|
+
return result.then ? new ReactiveDao.ObservablePromiseProxy(result) : result
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
async serviceViewGet(serviceName, viewName, params) {
|
|
590
590
|
const service = this.startedServices[serviceName]
|
|
591
591
|
const view = service.views[viewName]
|
|
592
592
|
if(!view) throw new Error(`View ${viewName} not found in service ${serviceName}`)
|
|
593
|
-
return await view.get(params)
|
|
593
|
+
return await view.get(params, { internal: true, roles: ['admin'] })
|
|
594
594
|
}
|
|
595
595
|
|
|
596
596
|
viewObservable(viewName, params) {
|
|
597
597
|
const view = this.globalViews[viewName]
|
|
598
598
|
if(!view) throw new Error(`Global view ${viewName} not found`)
|
|
599
|
-
const result = view.observable(params)
|
|
600
|
-
return result.then ? new
|
|
599
|
+
const result = view.observable(params, { internal: true, roles: ['admin'] })
|
|
600
|
+
return result.then ? new ReactiveDao.ObservablePromiseProxy(result) : result
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
async viewGet(viewName, params) {
|
|
@@ -23,7 +23,7 @@ export default async function(service, definition, app, client) {
|
|
|
23
23
|
for(let viewName in definition.views) {
|
|
24
24
|
const view = service.definition.views[viewName]
|
|
25
25
|
if(view.internal &&
|
|
26
|
-
!(client.roles.includes('admin')
|
|
26
|
+
!(client.roles.includes('admin'))) {
|
|
27
27
|
delete definition.views[viewName]
|
|
28
28
|
}
|
|
29
29
|
if(!view.access) continue;
|
|
@@ -4,7 +4,6 @@ export default function getAccessMethod(access) {
|
|
|
4
4
|
} else if(Array.isArray(access)) {
|
|
5
5
|
return (params, { service, client }) => {
|
|
6
6
|
if(client.internal) return true
|
|
7
|
-
if(client.roles.includes('administrator')) return true
|
|
8
7
|
if(client.roles.includes('admin')) return true
|
|
9
8
|
for(let role of access) if(client.roles.includes(role)) return true
|
|
10
9
|
return false
|
|
@@ -12,7 +11,6 @@ export default function getAccessMethod(access) {
|
|
|
12
11
|
} else if(access === 'internal') {
|
|
13
12
|
return (params, { service, client }) => {
|
|
14
13
|
if(client.internal) return true
|
|
15
|
-
if(client.roles.includes('administrator')) return true
|
|
16
14
|
if(client.roles.includes('admin')) return true
|
|
17
15
|
return false
|
|
18
16
|
}
|
|
@@ -22,7 +22,7 @@ class TriggerHandler {
|
|
|
22
22
|
const preparedParams = await prepareParameters(parameters, this.definition.properties, this.service)
|
|
23
23
|
//console.log("PREP PARAMS", preparedParams)
|
|
24
24
|
|
|
25
|
-
let resultPromise = this.definition.execute({
|
|
25
|
+
let resultPromise = Promise.resolve(this.definition.execute({
|
|
26
26
|
...preparedParams
|
|
27
27
|
}, {
|
|
28
28
|
...trig,
|
|
@@ -38,8 +38,8 @@ class TriggerHandler {
|
|
|
38
38
|
cause: trig.id,
|
|
39
39
|
...trigger
|
|
40
40
|
}, data, returnArray)
|
|
41
|
-
}, emit)
|
|
42
|
-
|
|
41
|
+
}, emit))
|
|
42
|
+
console.log("RESULT PROMISE", resultPromise, resultPromise.then)
|
|
43
43
|
resultPromise = resultPromise.then(async result => {
|
|
44
44
|
const processedResult = await processReturn(result, this.definition.returns, this.service)
|
|
45
45
|
return processedResult
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/framework",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.76",
|
|
4
4
|
"description": "Live Change Framework - ultimate solution for real time mobile/web apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/live-change/live-change-stack",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@live-change/dao": "^0.8.
|
|
26
|
-
"@live-change/uid": "^0.8.
|
|
25
|
+
"@live-change/dao": "^0.8.76",
|
|
26
|
+
"@live-change/uid": "^0.8.76"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "70c9a5ffb257f57b77754027d9c543584ca3423b"
|
|
29
29
|
}
|