(id)
| 108 | } |
| 109 | |
| 110 | getMappingKeys(id) { |
| 111 | const mapping = this.getMapping(id); |
| 112 | if (!mapping) { |
| 113 | return []; |
| 114 | } |
| 115 | const { keys, properties, schema } = mapping; |
| 116 | |
| 117 | if (schema.isEdge) { |
| 118 | let sourceKeys = [], |
| 119 | targetKeys = []; |
| 120 | const { source, target } = schema.edge; |
| 121 | |
| 122 | if (properties[source]) { |
| 123 | sourceKeys = this.getMappingKeys(properties[source].entity); |
| 124 | } |
| 125 | if (properties[target]) { |
| 126 | targetKeys = this.getMappingKeys(properties[target].entity); |
| 127 | } |
| 128 | |
| 129 | return [...new Set([...sourceKeys, ...targetKeys, ...keys])]; |
| 130 | } else { |
| 131 | return keys; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | // returns pseudo-entity for mapping, in order to be allow Entity ftm components to be used |
| 136 | getMappingAsEntity(id) { |
no test coverage detected