()
| 268 | } |
| 269 | |
| 270 | toApiFormat() { |
| 271 | const query = {}; |
| 272 | |
| 273 | this.mappingItems.forEach(({ id, schema, properties }) => { |
| 274 | const queryItem = { |
| 275 | schema: schema.name, |
| 276 | keys: this.getMappingKeys(id), |
| 277 | properties, |
| 278 | }; |
| 279 | if (!schema?.isThing()) { |
| 280 | queryItem.key_literal = schema.name; |
| 281 | } |
| 282 | query[id] = queryItem; |
| 283 | }); |
| 284 | |
| 285 | return query; |
| 286 | } |
| 287 | |
| 288 | static fromApiFormat(model, mappingData) { |
| 289 | return new MappingList(model, mappingData); |
no test coverage detected