asciidoctor-liquibase
Version:
Asciidoctor.js extension to render liquibase changesets as entity relationship diagram
66 lines (62 loc) • 2.7 kB
JavaScript
// *** WARNING: DO NOT MODIFY *** This is a generated JavaScript source code!
//
// Generated by LF-ET 2.2.1 (230826a), https://www.lohrfink.de/lfet
// From decision table
// "/opt/data/github/asciidoctor/asciidoctor-liquibase/lfet/extractor/changeSet.lfet"
// 10.09.2023 22:22
//
// Changes to this code resulting from refactorings can be synchronised
// with LF-ET using the function "Scrapbook Import".
//
// Prolog Decision Table ---->
const { stringify } = require('../utils')
function changeSet (element, currentFile, processModel, logger, vfs) {
// Prolog Decision Table <----
// Condition B01/01: definition is based on ... format / yaml / yaml definition
if (currentFile.endsWith('yaml')) {
// Condition B02/01: Contains liquibase element changeSet a nested property changes / yaml / yaml
if (element.changeSet.changes) {
// Rule R01 ---->
// Trace ---->
logger.info(`changeSet - 20230910.222205 - 1 / 4 - ${currentFile} - ${stringify(processModel)}`)
// Trace <----
// Action A01/01: extract ... / yaml / extract table on yaml definition
require('../liquibase-parser.js').parseLiquibaseChangeSet(processModel, currentFile, element.changeSet.changes, logger, vfs)
// Rule R01 <----
} else {
// Rule R02 ---->
// Trace ---->
logger.info(`changeSet - 20230910.222205 - 2 / 4 - ${currentFile} - ${stringify(processModel)}`)
// Trace <----
// Action A03/01: ignore / X / execute action
// ignore
// Rule R02 <----
}
// Condition B01/02: definition is based on ... format / xml / xml definition
} else if (currentFile.endsWith('xml')) {
// Rule R03 ---->
// Trace ---->
logger.info(`changeSet - 20230910.222205 - 3 / 4 - ${currentFile} - ${stringify(processModel)}`)
// Trace <----
// Action A01/02: extract ... / xml / extract on xml definition
require('../liquibase-parser.js').parseLiquibaseChangeSet(processModel, currentFile, element.$$, logger, vfs)
// Rule R03 <----
} else {
// Rule R04 ---->
// Trace ---->
logger.info(`changeSet - 20230910.222205 - 4 / 4 - ${currentFile} - ${stringify(processModel)}`)
// Trace <----
// Action A02/01: error / X / execute action
logger.error(`changeSet - 20230910.222205 - Format for ${currentFile} is not supported.`)
// Rule R04 <----
}
// Epilog Decision Table ---->
}
module.exports = {
extract: (element, currentFile, processModel, logger, vfs) => {
return changeSet(element, currentFile, processModel, logger, vfs)
}
}
// Epilog Decision Table <----
// End of generated JavaScript source code
// Generated by LF-ET 2.2.1 (230826a), https://www.lohrfink.de/lfet