Skip to main content

IAdminForth

Properties

activatedPlugins

activatedPlugins: IAdminForthPlugin[]


auth

auth: IAdminForthAuth


baseUrlSlashed

baseUrlSlashed: string


codeInjector

codeInjector: ICodeInjector


config

config: AdminForthConfig


connectors

connectors: object

Index signature

[key: string]: IAdminForthDataSourceConnectorBase


express

express: IHttpServer


runningHotReload

runningHotReload: boolean

Internal flag which indicates if AdminForth is running in hot reload mode.


statuses

statuses: object

dbDiscover

dbDiscover: "running" | "done"

Methods

bundleNow()

bundleNow(__namedParameters): Promise<void>

Bundles AdminForth SPA by injecting custom components into internal pre-made SPA source code. It generates internally dist which then will be served by AdminForth HTTP adapter. Bundle is generated in /tmp folder so if you have ramfs or tmpfs this operation will be faster.

We recommend calling this method from dedicated script which will be run by CI/CD pipeline in build time. This ensures lowest downtime for your users. However for simple setup you can call it from your main script, and users will see some "AdminForth is bundling" message in the admin panel while app is bundling.

Parameters

ParameterType
__namedParametersobject
__namedParameters.hotReloadboolean
__namedParameters.verboseboolean

Returns

Promise<void>


createResourceRecord()

createResourceRecord(params): Promise<object>

Parameters

ParameterType
paramsobject
params.adminUserAdminUser
params.recordany
params.resourceAdminForthResource

Returns

Promise<object>

createdRecord?

optional createdRecord: any

error?

optional error: string

ok

ok: boolean


discoverDatabases()

discoverDatabases(): Promise<void>

Connects to databases defined in datasources and fetches described resource columns to find out data types and constraints. You must call this method as soon as possible after AdminForth class is instantiated.

Returns

Promise<void>


setupEndpoints()

setupEndpoints(server): void

This method will be automatically called from AdminForth HTTP adapter to serve AdminForth SPA.

Parameters

ParameterType
serverIHttpServer

Returns

void