13 lines
463 B
JavaScript
13 lines
463 B
JavaScript
import { appDefinitionFile } from "../common"
|
|
import { constructHierarchy } from "./createNodes"
|
|
|
|
export const getApplicationDefinition = datastore => async () => {
|
|
const exists = await datastore.exists(appDefinitionFile)
|
|
|
|
if (!exists) throw new Error("Application definition does not exist")
|
|
|
|
const appDefinition = await datastore.loadJson(appDefinitionFile)
|
|
appDefinition.hierarchy = constructHierarchy(appDefinition.hierarchy)
|
|
return appDefinition
|
|
}
|