AdminForthClass
Properties
auth
auth:
object
issueJWT()
Parameters
Parameter | Type |
---|---|
payload | Object |
type | string |
Returns
string
verify()
Parameters
Parameter | Type |
---|---|
jwt | string |
mustHaveType | string |
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
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.hotReload | boolean |
__namedParameters.verbose | boolean |
Returns
Promise
<void
>
createResourceRecord()
createResourceRecord(
params
):Promise
<any
>
Parameters
Parameter | Type |
---|---|
params | object |
params.adminUser | AdminUser |
params.record | any |
params.resource | AdminForthResource |
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
Parameter | Type |
---|---|
server | GenericHttpServer |
Returns
void