lowcode-data-app
Version:
LowCode App Environment
116 lines (84 loc) • 2.25 kB
JavaScript
/* LOWCODE-DATA-APP / copyright 2024 by ma-ha https://github.com/ma-ha / MIT License */
// This example launches the Low-Code-App in standalone mode.
// ... see "app-embedded.js" how to use it embedded with in your app.
const lowCodeApp = require( './index' )
const bunyan = require( 'bunyan' )
let log = bunyan.createLogger({
name : 'example',
level : 'info'
})
// let lowCodeApp = require( 'lowcode-data-app' ) // ... when using the npm package
lowCodeApp.init({
PERSISTENCE : DB,
GUI_URL : 'http://localhost:8888/app/',
URL_PATH : '/app',
OIDC_SERVER : true,
SUPER_TENANT_ADMIN: 'demo' // comma separated user ids
})
const DB = {
USER : {}
}
// ----------------------------------------------------------------------------
DB.prepDB = async () => {
log.info( 'prepDB' )
// TODO
}
DB.loadData = async ( tbl, query ) => {
}
DB.loadDataById = async ( tbl, id ) => {
// return obj
}
DB.savedDataObj = async ( tbl, id, obj ) => {
// return dtaEvt
}
DB.delData = async ( tbl, id ) => {
// return "Deleted"
}
// ----------------------------------------------------------------------------
// USER
DB.USER.getNextScopeId = async () => {
// return newId
}
DB.USER.writeScope = async () => {
// return
}
DB.USER.loadScopes = async () => {
// return scopeMap
}
DB.USER.saveScope = async ( id, scope ) => {
// return
}
DB.USER.delScope = async ( id ) => {
// return
}
//-----------------------------------------------------------------------------
DB.USER.loadUserArr = async () => {
// return authMap
}
DB.USER.loadUserById = async ( uid ) => {
// return identity
}
DB.USER.saveUser = async ( user ) => {
// return
}
DB.USER.delUser = async ( uid ) => {
// return 'OK'
// return 'Not found'
}
//-----------------------------------------------------------------------------
DB.USER.loadUserScope = async ( userId ) => {
// return scope
}
DB.USER.saveUserScope = async ( uid, scopeId ) => {
// return
}
DB.USER.writeUserScope = async () => {
// return
}
//-----------------------------------------------------------------------------
DB.USER.loadOidcSessions = async () => {
// return oidcSessions
}
DB.USER.saveOidcSessions = async ( oidcSessions ) => {
// return
}