@live-change/access-control-service 0.9.85 → 0.9.87

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 (3) hide show
  1. package/access.js +3 -2
  2. package/indexes.js +4 -4
  3. package/package.json +3 -3
package/access.js CHANGED
@@ -170,8 +170,9 @@ export default (definition) => {
170
170
  await disposeParents()
171
171
  node.parents = objectData ? await Promise.all(parentsSources.map(parentSource => {
172
172
  const parentType = parentSource.type || objectData[parentSource.property + 'Type']
173
- const property = objectData[parentSource.property]
174
- const parents = Array.isArray(property) ? property : [ property ]
173
+ if(!parentType) return []
174
+ const property = objectData[parentSource.property]
175
+ const parents = (Array.isArray(property) ? property : [ property ]).filter(p => !!p)
175
176
  return parents.map(parent => treeNode(parentType, parent))
176
177
  }).flat()) : []
177
178
  obsv = true
package/indexes.js CHANGED
@@ -60,7 +60,7 @@ if(config.indexed) {
60
60
  const reindexerBucket = 128
61
61
 
62
62
  function indexEntry(parentType, childType, parent, child, property) {
63
- output.debug('indexEntry', parentType, childType, parent, child, property)
63
+ //output.debug('indexEntry', parentType, childType, parent, child, property)
64
64
  const indexPart = [parentType, parent, childType, child]
65
65
  .map(v => JSON.stringify(v)).join(':')
66
66
  return {
@@ -74,7 +74,7 @@ if(config.indexed) {
74
74
  }
75
75
 
76
76
  function indexEntryByProperty(childType, item, property) {
77
- output.debug('indexEntryByProperty', childType, item, property)
77
+ //output.debug('indexEntryByProperty', childType, item, property)
78
78
  const value = item?.[property.property]
79
79
  if(!value) return
80
80
  const type = property.type || item[property.property + 'Type']
@@ -118,14 +118,14 @@ if(config.indexed) {
118
118
  }
119
119
 
120
120
  async index(item, oldItem) {
121
- output.debug("!!!", item, oldItem, this.properties)
121
+ //output.debug("!!!", item, oldItem, this.properties)
122
122
  for(const property of this.removedProperties) {
123
123
  await output.remove(indexEntryByProperty(this.childType, item, property))
124
124
  }
125
125
  for(const property of this.properties) {
126
126
  const newEntry = indexEntryByProperty(this.childType, item, property)
127
127
  const oldEntry = indexEntryByProperty(this.childType, oldItem, property)
128
- output.debug('<-->', newEntry, oldEntry)
128
+ //output.debug('<-->', newEntry, oldEntry)
129
129
  if(newEntry || oldEntry) await output.change(newEntry, oldEntry)
130
130
  }
131
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/access-control-service",
3
- "version": "0.9.85",
3
+ "version": "0.9.87",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,8 +21,8 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.9.85"
24
+ "@live-change/framework": "^0.9.87"
25
25
  },
26
- "gitHead": "126afb0aad3ab6e03aa5742726f429c95c46783a",
26
+ "gitHead": "7a7694ad2801b7ffa16f347aed441ca5f81ab5fd",
27
27
  "type": "module"
28
28
  }