@viewdo/dxp-story-cli
Version:
README.md
45 lines (36 loc) • 1.06 kB
JavaScript
/*
// for preview
let preview_data = {}
story.inputs.forEach(input => {
preview_data[input.key] = this._getDefaultInputValue(input)
})
let organization = new OrganizationConfig(story.organizationKey, this.output).config
_getDefaultInputValue (input) {
switch(input.type) {
case "String":
return input.value || "Text"
case "Boolean":
return input.value || false
case "Number":
return input.value || 0
case "DateTime":
return input.value || new Date()
case "Object":
return input.value || {}
default:
return input.value
}
}
preview: {
// key: '$example',
// data: preview_data,
// user: {},
// organization,
// milestone: null,
// events: [],
// progress: 'New',
// currentEpisodeKey: null,
// childEntityKey: organization.entities.length ? organization.entities[0].key : null
//}
// this is what gets attached to the story-config. -
*/