IAdminForth
Properties
activatedPlugins
activatedPlugins:
IAdminForthPlugin
[]
auth
auth:
IAdminForthAuth
codeInjector
codeInjector:
ICodeInjector
config
config:
AdminForthConfig
connectors
connectors:
object
Index signature
[key
: string
]: IAdminForthDataSourceConnectorBase
express
express:
IHttpServer
restApi
restApi:
IAdminForthRestAPI
runningHotReload
runningHotReload:
boolean
Internal flag which indicates if AdminForth is running in hot reload mode.
statuses
statuses:
object
dbDiscover
dbDiscover:
"running"
|"done"
websocket
websocket:
IWebSocketBroker
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
<object
>
Parameters
Parameter | Type |
---|---|
params | object |
params.adminUser | AdminUser |
params.extra ? | HttpExtra |
params.record | any |
params.resource | AdminForthResource |
Returns
Promise
<object
>
createdRecord?
optional
createdRecord:any
error?
optional
error:string
deleteResourceRecord()
deleteResourceRecord(
params
):Promise
<object
>
Parameters
Parameter | Type |
---|---|
params | object |
params.adminUser | AdminUser |
params.extra ? | HttpExtra |
params.record | any |
params.recordId | string |
params.resource | AdminForthResource |
Returns
Promise
<object
>
error?
optional
error:string
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
>
resource()
resource(
resourceId
):IOperationalResource
Resource to get access to operational resources for data api fetching and manipulation.
Parameters
Parameter | Type |
---|---|
resourceId | string |
Returns
setupEndpoints()
setupEndpoints(
server
):void
This method will be automatically called from AdminForth HTTP adapter to serve AdminForth SPA.
Parameters
Parameter | Type |
---|---|
server | IHttpServer |
Returns
void
tr()
tr(
msg
,category
,lang
,params
):Promise
<string
>
Parameters
Parameter | Type |
---|---|
msg | string |
category | string |
lang | string |
params | any |
Returns
Promise
<string
>
updateResourceRecord()
updateResourceRecord(
params
):Promise
<object
>
Parameters
Parameter | Type |
---|---|
params | object |
params.adminUser | AdminUser |
params.extra ? | HttpExtra |
params.oldRecord | any |
params.record | any |
params.recordId | any |
params.resource | AdminForthResource |
Returns
Promise
<object
>
error?
optional
error:string