* Used to transform record after fetching from database.
* According to AdminForth convention, if {@link AdminForthResourceColumn.type} is set to {@link AdminForthDataTypes.DATETIME} then it should be transformed to ISO string.
* This method is reused both to list records and show one record (by passing limit 1 and offset 0) .
*
* Fields are returned from db "as is" then {@link AdminForthBaseConnector.getData} will transform each field using {@link IAdminForthDataSourceConnector.getFieldValue}
* Called by AdminForth to initialize all endpoints for REST API.
*/
registerEndpoints(server: IHttpServer): void;
/**
* Called by login endpoint to process login callbacks. Also might be called by plugins, to prevent action if user is not allowed to login.
* For example signup or login via google might want to check if user is allowed to login by calling this method.
* @param adminUser - plugin/af pases current adminUser
* @param toReturn - this is an object which will get status of login process. If at least one callback returns error or redirectTo, login process will be stopped (future callbacks will not be called).
* Internal flag which indicates if AdminForth is running in hot reload mode.
*/
runningHotReload: boolean;
/**
* 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.
*/
discoverDatabases(): 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.
* Place file `logo.svg` to `./custom` folder and set this option:
*
* ```ts
* brandLogo: '@@/logo.svg',
* ```
*
*/
brandLogo?: string,
/**
* Path to your app favicon
*
* Example:
* Place file `favicon.png` to `./custom` folder and set this option:
*
* ```ts
* favicon: '@@/favicon.png',
* ```
*/
favicon?: string,
/**
* DayJS format string for all dates in the app.
* Defaulted to 'MMM D, YYYY'
*/
datesFormat?: string,
/**
* DayJS format string for all datetimes in the app.
* Defaulted to 'HH:mm:ss'
*/
timeFormat?: string,
/**
* HTML title tag value, defaults to brandName
*/
title?: string,
/**
* Placeholder for empty fields in lists and show views, by default empty string ''
*/
emptyFieldPlaceholder?: {
show?: string,
list?: string,
}|string,
/**
* Relative or absolute path to custom components directory
* By default equals `./custom`.
*
* Custom .vue files, images, and any other assets placed in this directory can be accessed in AdminForth components and configs with `@@/`.
*
* For example if file path is `./custom/comp/my.vue`, you can use it in AdminForth config like this:
*
* ```ts
* components: {
* show: '@@/comp/my.vue',
* }
* ```
*
*/
customComponentsDir?: string,
/**
* Path to custom .ts file which allows to inject custom Vue uses in SPA or add custom imports.
*
* Example: Create file: `./custom/vue-uses.ts` with next content:
*
* ```ts
* import HighchartsVue from 'highcharts-vue';
* // import '@@/custom.scss'; // here is how you can import custom styles
*
* export default function (app) {
* app.use(HighchartsVue);
* }
* ```
*
* Install HighCharts into custom folder:
*
* ```bashcreating rec
* cd custom
* npm init -y
* npm install highcharts highcharts-vue
* ```
*
* And specify vueUsesFile in AdminForth config:
*
* ```ts
* vueUsesFile: '@@/vue-uses.ts',
* ```
*
*/
vueUsesFile?: string,
/**
* Object to redefine default styles for AdminForth components. Use this file as reference for all possible adjustments https://github.com/devforth/adminforth/blob/main/adminforth/modules/styles.ts
*/
styles?: Object,
/**
* Description of custom pages which will let register custom pages for custom routes in AdminForth.
*/
customPages?: Array<AdminForthPageDeclaration>,
/**
* Function to return custom badge in side bar for users. Can return text or html
* If function is not passed or returns null, badge will not be shown.