Skip to main content

AdminForthClass

Properties

auth

auth: object

issueJWT()

Parameters
ParameterType
payloadObject
typestring
Returns

string

verify()

Parameters
ParameterType
jwtstring
mustHaveTypestring
Returns

Promise<any>


codeInjector

codeInjector: CodeInjectorType


config

config: AdminForthConfig


connectors

connectors: object

Index signature

[key: string]: AdminForthDataSourceConnector


express

express: GenericHttpServer


runningHotReload

runningHotReload: boolean

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

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<any>

Parameters

ParameterType
paramsobject
params.adminUserAdminUser
params.recordany
params.resourceAdminForthResource

Returns

Promise<any>


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
serverGenericHttpServer

Returns

void