@live-change/session-service 0.2.5 → 0.2.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/session-service",
3
- "version": "0.2.5",
3
+ "version": "0.2.12",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,5 +24,5 @@
24
24
  "@live-change/framework": "^0.5.7",
25
25
  "@live-change/relations-plugin": "^0.1.10"
26
26
  },
27
- "gitHead": "e9f8af40d836388f6847cf958c1d941dc8e273b1"
27
+ "gitHead": "a0dce761d803684a74e4cf4d50c63a0dc80dd4cf"
28
28
  }
package/sessionItem.js CHANGED
@@ -45,7 +45,7 @@ definition.processor(function(service, app) {
45
45
  const viewName = 'mySession' + modelName + 'sBy' + sortFieldUc
46
46
  service.views[viewName] = new ViewDefinition({
47
47
  name: viewName,
48
- access: config.readAccess,
48
+ access: config.sessionReadAccess,
49
49
  properties: App.rangeProperties,
50
50
  daoPath(range, { client, context }) {
51
51
  return modelRuntime().sortedIndexRangePath('bySession' + sortFieldUc, [client.session], range )
@@ -35,11 +35,25 @@ definition.processor(function(service, app) {
35
35
  access: config.sessionReadAccess,
36
36
  daoPath(params, { client, context }) {
37
37
  return modelRuntime().path(client.session)
38
- //return modelRuntime().indexObjectPath('bySession', client.session)
39
38
  }
40
39
  })
41
40
  }
42
41
 
42
+ if(config.sessionViews) {
43
+ for(const view of config.sessionViews) {
44
+ const viewName = view.name || ('mySession' + (view.prefix || '') + modelName + (view.suffix || ''))
45
+ service.views[viewName] = new ViewDefinition({
46
+ name: viewName,
47
+ access: view.access,
48
+ daoPath(params, { client, context }) {
49
+ return view.fields
50
+ ? modelRuntime().limitedPath(client.session, view.fields)
51
+ : modelRuntime().path(client.session)
52
+ }
53
+ })
54
+ }
55
+ }
56
+
43
57
  if(config.sessionSetAccess || config.sessionWriteAccess) {
44
58
  const eventName = 'sessionOwned' + modelName + 'Set'
45
59
  const actionName = 'setMySession' + modelName